GNU bug report logs - #10631
Infinite loop in emacs 23 on terminal (-nw option) on xgselect.c:58-59 when compiled with gtk+ or gconf support

Previous Next

Package: emacs;

Reported by: Maciej Marcin Piechotka <uzytkownik2 <at> gmail.com>

Date: Sat, 28 Jan 2012 18:43:03 UTC

Severity: normal

Tags: moreinfo

Merged with 6975, 9754

Fixed in version 24.2

Done: Ken Brown <kbrown <at> cornell.edu>

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 10631 in the body.
You can then email your comments to 10631 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#10631; Package emacs. (Sat, 28 Jan 2012 18:43:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Maciej Marcin Piechotka <uzytkownik2 <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sat, 28 Jan 2012 18:43:03 GMT) Full text and rfc822 format available.

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

From: Maciej Marcin Piechotka <uzytkownik2 <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: Infinite loop in emacs 23 on terminal (-nw option) on
	xgselect.c:58-59 when compiled with gtk+ or gconf support
Date: Sat, 28 Jan 2012 16:24:48 +0000
[Message part 1 (text/plain, inline)]
I hit an infinite loop on gselect.c:58-59. After quick debugging I found
that the problem is in loop xgselect.c:58-59:

while(n_gfds > gfds_size)
  gfds_size *= 2;

Problem is that:

(gdb) p n_gfds
$3 = 1
(gdb) p gfds_size
$4 = 0

1. It seems that xgselect_initialize was not called as X system is
initialized.

2. Is there a reason why the code is not using (much more efficient but
equivalent) such code in the first place:

if (ngfds > gfds_size)
  {
    gfds_size = 1 << g_bit_storage (ngfds);
    xfree (gfds);
    gfds = xmalloc (sizeof (*gfds) * gfds_size);
  }

3. The attached file get rids of initialization at all initializing at
the cost of conditional freeing of gfds (and starting mallocing from 1
instead of 128).

Best regards

[0001-Fix-infinit-loop-when-emacs-is-compiled-with-GTK-sup.patch (text/x-patch, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#10631; Package emacs. (Sat, 28 Jan 2012 18:49:02 GMT) Full text and rfc822 format available.

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

From: Maciej Marcin Piechotka <uzytkownik2 <at> gmail.com>
To: 10631 <at> debbugs.gnu.org
Subject: Update of patch
Date: Sat, 28 Jan 2012 18:46:51 +0000
[Message part 1 (text/plain, inline)]
Ups. Sorry - I forgot to add one file to git index. Corrected patch
attached.
[0001-Fix-infinit-loop-when-emacs-is-compiled-with-GTK-sup.patch (text/x-patch, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#10631; Package emacs. (Sat, 28 Jan 2012 19:06:01 GMT) Full text and rfc822 format available.

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

From: Glenn Morris <rgm <at> gnu.org>
To: Maciej Marcin Piechotka <uzytkownik2 <at> gmail.com>
Cc: 10631 <at> debbugs.gnu.org
Subject: Re: bug#10631: Update of patch
Date: Sat, 28 Jan 2012 14:04:28 -0500
Thanks for the report. This seems like a duplicate of
http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9754

The same comments apply:
http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9754#11

You can see the current xgselect.c at eg
http://bzr.savannah.gnu.org/lh/emacs/trunk/annotate/head:/src/xgselect.c

It would be great if you could test the 24.0.92 pretest from
http://alpha.gnu.org/gnu/emacs/pretest/




Merged 9754 10631. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Sat, 28 Jan 2012 19:07:02 GMT) Full text and rfc822 format available.

bug closed, send any further explanations to 9754 <at> debbugs.gnu.org and Ryan Lortie <desrt <at> desrt.ca> Request was from Chong Yidong <cyd <at> gnu.org> to control <at> debbugs.gnu.org. (Sat, 10 Mar 2012 10:08: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. (Sat, 07 Apr 2012 11:24:03 GMT) Full text and rfc822 format available.

bug unarchived. Request was from Ken Brown <kbrown <at> cornell.edu> to control <at> debbugs.gnu.org. (Tue, 15 May 2012 19:06:02 GMT) Full text and rfc822 format available.

Did not alter fixed versions and reopened. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 15 May 2012 21:43:01 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. (Sat, 23 Jun 2012 11:24:03 GMT) Full text and rfc822 format available.

bug unarchived. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Wed, 06 Feb 2013 17:20:02 GMT) Full text and rfc822 format available.

Forcibly Merged 6975 9754 10631. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Wed, 06 Feb 2013 17:20: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. (Thu, 07 Mar 2013 12:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 12 years and 158 days ago.

Previous Next


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