GNU bug report logs - #10947
24.0.92; The variable `erc-channel-users' can be invalid after reconnection

Previous Next

Package: emacs;

Reported by: Deniz Dogan <deniz <at> dogan.se>

Date: Mon, 5 Mar 2012 16:34:01 UTC

Severity: normal

Tags: fixed, patch

Found in version 24.0.92

Fixed in version 25.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 10947 in the body.
You can then email your comments to 10947 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#10947; Package emacs. (Mon, 05 Mar 2012 16:34:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Deniz Dogan <deniz <at> dogan.se>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Mon, 05 Mar 2012 16:34:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Deniz Dogan <deniz <at> dogan.se>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.0.92;
	The variable `erc-channel-users' can be invalid after reconnection
Date: Mon, 05 Mar 2012 17:31:35 +0100
[Message part 1 (text/plain, inline)]
I noticed this when I disconnected the Internet cable from my machine
and then plugged it back in a while later to reconnect.  When I hit C-c
C-n to list the users, a bot of mine was listed among the users.  I did
/whois the_nickname and got "No such nick/channel".

After some investigation, I found that ERC doesn't clear
erc-channel-users when an unexpected disconnection occurs.  I've
attached a patch which addresses this problem.

[erc-channel-users.patch (text/x-patch, inline)]
=== modified file 'lisp/erc/ChangeLog'
--- lisp/erc/ChangeLog	2012-02-09 07:48:22 +0000
+++ lisp/erc/ChangeLog	2012-03-05 16:26:23 +0000
@@ -1,3 +1,9 @@
+2012-03-05  Deniz Dogan  <deniz <at> dogan.se>
+
+	* erc-backend.el (erc-process-sentinel): Clear channel user lists
+	upon disconnection.  This prevents invalid channel user lists when
+	reconnecting.
+
 2012-02-08  Glenn Morris  <rgm <at> gnu.org>

 	* erc-backend.el (erc-coding-system-precedence):
@@ -277,4 +283,3 @@
 ;; coding: utf-8
 ;; add-log-time-zone-rule: t
 ;; End:
-

=== modified file 'lisp/erc/erc-backend.el'
--- lisp/erc/erc-backend.el	2012-02-08 08:07:24 +0000
+++ lisp/erc/erc-backend.el	2012-03-02 15:22:22 +0000
@@ -680,6 +680,9 @@
                    (setq erc-server-ping-handler nil)))
           (run-hook-with-args 'erc-disconnected-hook
                               (erc-current-nick) (system-name) "")
+          (dolist (buf (erc-buffer-filter (lambda () (boundp 'erc-channel-users)) cproc))
+            (with-current-buffer buf
+              (setq erc-channel-users (make-hash-table :test 'equal))))
           ;; Remove the prompt
           (goto-char (or (marker-position erc-input-marker) (point-max)))
           (forward-line 0)
[Message part 3 (text/plain, inline)]


In GNU Emacs 24.0.92.1 (i386-mingw-nt6.1.7601)
 of 2012-01-17 on MARVIN
Windowing system distributor `Microsoft Corp.', version 6.1.7601
configured using `configure --with-gcc (4.6) --no-opt --cflags -ID:/devel/emacs/libs/libXpm-3.5.8/include -ID:/devel/emacs/libs/libXpm-3.5.8/src -ID:/devel/emacs/libs/libpng-dev_1.4.3-1/include -ID:/devel/emacs/libs/zlib-dev_1.2.5-2/include -ID:/devel/emacs/libs/giflib-4.1.4-1/include -ID:/devel/emacs/libs/jpeg-6b-4/include -ID:/devel/emacs/libs/tiff-3.8.2-1/include -ID:/devel/emacs/libs/gnutls-3.0.9/include --ldflags -LD:/devel/emacs/libs/gnutls-3.0.9/lib'

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: SVE
  value of $XMODIFIERS: nil
  locale-coding-system: cp1252
  default enable-multibyte-characters: t

Major mode: Help

Minor modes in effect:
  diff-auto-refine-mode: t
  erc-truncate-mode: t
  erc-services-mode: t
  erc-ring-mode: t
  erc-networks-mode: t
  erc-netsplit-mode: t
  erc-menu-mode: t
  erc-list-mode: t
  erc-pcomplete-mode: t
  erc-button-mode: t
  erc-fill-mode: t
  erc-stamp-mode: t
  erc-autojoin-mode: t
  popcmp-group-alternatives: t
  popcmp-short-help-beside-alts: t
  erc-track-mode: t
  erc-track-minor-mode: t
  erc-match-mode: t
  erc-irccontrols-mode: t
  erc-noncommands-mode: t
  erc-move-to-prompt-mode: t
  erc-readonly-mode: t
  erc-scrolltobottom-mode: t
  electric-indent-mode: t
  nxhtml-menu-mode: t
  rcirc-track-minor-mode: t
  tooltip-mode: t
  mouse-wheel-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  size-indication-mode: t
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent messages:
Wrote d:/repos/emacs/trunk/lisp/erc/ChangeLog
Finding changes in d:/repos/emacs/trunk/lisp/erc/...done
Mark set [2 times]
Quit
Saving file d:/erc-channel-users.patch...
Wrote d:/erc-channel-users.patch
Quit
Making completion list...
Type "q" in help window to restore its previous buffer.
Mark activated

Load-path shadows:
d:/repos/nxhtml/related/django hides ~/.emacs.d/django
d:/repos/nima/json hides c:/misc/emacs/lisp/json
d:/repos/nxhtml/util/org-odt hides c:/misc/emacs/lisp/org/org-odt

Features:
(shadow sort mail-extr message rfc822 mml mml-sec mm-decode mm-bodies
mm-encode mail-parse rfc2231 rfc2047 rfc2045 ietf-drums mailabbrev
mail-utils gmm-utils mailheader emacsbug smerge-mode newcomment
whitespace vc-sccs vc-svn vc-cvs vc-rcs vc-dir ewoc vc ediff-merg
ediff-diff ediff-wind ediff-help ediff-util ediff-mult ediff-init ediff
vc-dispatcher magit diff-mode log-edit pcvs-util add-log magit-key-mode
dired-aux apropos debug help-mode view multi-isearch browse-url iswitchb
vc-git network-stream auth-source eieio byte-opt bytecomp byte-compile
cconv macroexp assoc gnus-util mm-util mail-prsvr password-cache
starttls tls magit-autoloads package tabulated-list uniquify
erc-truncate erc-services erc-ring erc-networks erc-netsplit erc-menu
erc-pcomplete pcomplete comint erc-button erc-fill erc-stamp wid-edit
erc-join nathalie-theme popcmp erc-track erc-match erc-goodies erc
erc-backend erc-compat format-spec thingatpt pp electric cus-start
cus-load flymake-files advice help-fns advice-preload flymakemsg
nxhtml-autostart nxhtml-autoload majmodpri vc-bzr nxhtml-menu
web-autoload nxhtml-base dired-x easymenu dired regexp-opt filmtipset
sgml-mode helo derived nginx-mode notepad rcirc easy-mmode edmacro
kmacro cl ring ido time-date tooltip ediff-hook vc-hooks lisp-float-type
mwheel dos-w32 disp-table ls-lisp w32-win w32-vars tool-bar dnd fontset
image fringe lisp-mode register page menu-bar rfn-eshadow timer select
scroll-bar mouse jit-lock font-lock syntax facemenu font-core frame cham
georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao
korean japanese hebrew greek romanian slovak czech european ethiopic
indian cyrillic chinese case-table epa-hook jka-cmpr-hook help simple
abbrev minibuffer button faces cus-face files text-properties overlay
sha1 md5 base64 format env code-pages mule custom widget
hashtable-print-readable backquote make-network-process multi-tty emacs)

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#10947; Package emacs. (Sun, 27 Dec 2015 21:38:02 GMT) Full text and rfc822 format available.

Message #8 received at 10947 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Deniz Dogan <deniz <at> dogan.se>
Cc: 10947 <at> debbugs.gnu.org
Subject: Re: bug#10947: 24.0.92;
 The variable `erc-channel-users' can be invalid after reconnection
Date: Sun, 27 Dec 2015 22:37:18 +0100
Deniz Dogan <deniz <at> dogan.se> writes:

> I noticed this when I disconnected the Internet cable from my machine
> and then plugged it back in a while later to reconnect.  When I hit C-c
> C-n to list the users, a bot of mine was listed among the users.  I did
> /whois the_nickname and got "No such nick/channel".
>
> After some investigation, I found that ERC doesn't clear
> erc-channel-users when an unexpected disconnection occurs.  I've
> attached a patch which addresses this problem.

Thanks; applied to Emacs 25.1.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Added tag(s) fixed. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Sun, 27 Dec 2015 21:38:02 GMT) Full text and rfc822 format available.

bug marked as fixed in version 25.1, send any further explanations to 10947 <at> debbugs.gnu.org and Deniz Dogan <deniz <at> dogan.se> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Sun, 27 Dec 2015 21:38:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 25 Jan 2016 12:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 9 years and 229 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.