Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 401199 - app-editors/emacs-23: infinite loop when compiled with USE=gtk or USE=gconf and used with -nw and glib >= 2.31
Summary: app-editors/emacs-23: infinite loop when compiled with USE=gtk or USE=gconf a...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Emacs project
URL: http://debbugs.gnu.org/cgi/bugreport....
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2012-01-28 16:29 UTC by Maciej Piechotka
Modified: 2012-01-31 01:56 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
0001-Fix-infinit-loop-when-emacs-is-compiled-with-GTK-sup.patch (0001-Fix-infinit-loop-when-emacs-is-compiled-with-GTK-sup.patch,1.68 KB, patch)
2012-01-28 16:29 UTC, Maciej Piechotka
Details | Diff
0001-Fix-infinit-loop-when-emacs-is-compiled-with-GTK-sup.patch (0001-Fix-infinit-loop-when-emacs-is-compiled-with-GTK-sup.patch,1.97 KB, patch)
2012-01-28 17:04 UTC, Maciej Piechotka
Details | Diff
09_all_xgselect-infloop.patch (09_all_xgselect-infloop.patch,449 bytes, patch)
2012-01-29 15:32 UTC, Ulrich Müller
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Maciej Piechotka 2012-01-28 16:29:14 UTC
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

It seems that xgselect_initialize was not called as X system is
initialized. The attached patch solves problem for me. I have sent it upstream but it didn't appear on mailing list yet (that's the reason for lack of URL).
Comment 1 Maciej Piechotka 2012-01-28 16:29:47 UTC
Created attachment 300155 [details, diff]
0001-Fix-infinit-loop-when-emacs-is-compiled-with-GTK-sup.patch
Comment 2 Maciej Piechotka 2012-01-28 17:04:11 UTC
Created attachment 300159 [details, diff]
0001-Fix-infinit-loop-when-emacs-is-compiled-with-GTK-sup.patch

Ups. I have forgotten to add 1 file to git. Corrected version attached.
Comment 3 Ulrich Müller gentoo-dev 2012-01-28 17:30:11 UTC
Has this patch been submitted and approved upstream?
Comment 4 Maciej Piechotka 2012-01-28 17:34:52 UTC
(In reply to comment #3)
> Has this patch been submitted

Yes. I have submitted to bug-gnu-emacs, as described on GNU Emacs webpage,  but the message have not appeared in the archives/gmane (I sent a few minutes before submitting this bug).

> and approved upstream?

No - at least I don't know about it.
Comment 5 Maciej Piechotka 2012-01-28 18:44:02 UTC
(In reply to comment #4)
> (In reply to comment #3)
> > Has this patch been submitted
> 
> Yes. I have submitted to bug-gnu-emacs, as described on GNU Emacs webpage,  but
> the message have not appeared in the archives/gmane (I sent a few minutes
> before submitting this bug).
> 

I've just received ack about bug (updating URL).
Comment 6 Maciej Piechotka 2012-01-28 19:11:48 UTC
(In reply to comment #4)
> (In reply to comment #3)
> > Has this patch been submitted
> 
> Yes. I have submitted to bug-gnu-emacs, as described on GNU Emacs webpage,  but
> the message have not appeared in the archives/gmane (I sent a few minutes
> before submitting this bug).
> 

It was duplicate of #9754.

> > and approved upstream?
> 
> No - at least I don't know about it.

Probably no because "The Emacs 23 branch is no longer in use and won't be modified.". Yay for packages that don't have maintained stable version.
Comment 7 Ulrich Müller gentoo-dev 2012-01-28 21:00:18 UTC
So there seem to be three possible fixes for this problem:
  1) your patch from attachment 300159 [details, diff]
  2) the patch posted to the upstream bug:
     <http://debbugs.gnu.org/cgi/bugreport.cgi?msg=14;filename=emacs-23.3-xgselect_init.patch;att=1;bug=9754>
  3) the fix applied in upstream trunk (using xpalloc)

AFAICS, we can't use 3) because xpalloc isn't available in Emacs 23. And although 1) may be more elegant, 2) is less intrusive so I would prefer it (after all, this is the stable branch).

Since I cannot reproduce the problem here, can you confirm that 2) fixes it?


(In reply to comment #6)
> > > and approved upstream?
> 
> Probably no because "The Emacs 23 branch is no longer in use and won't be
> modified.". Yay for packages that don't have maintained stable version.

Sometimes I also fail to understand upstream policy. Today they have released Emacs 23.4 from that branch that is "no longer in use".
Comment 8 Ulrich Müller gentoo-dev 2012-01-29 15:32:58 UTC
Created attachment 300271 [details, diff]
09_all_xgselect-infloop.patch

(In reply to comment #7)
> Since I cannot reproduce the problem here, can you confirm that 2) fixes it?

Or rather, could you try attached patch?
Comment 9 Maciej Piechotka 2012-01-30 21:25:02 UTC
(In reply to comment #8)
> Created attachment 300271 [details, diff] [details, diff]
> 09_all_xgselect-infloop.patch
> 
> (In reply to comment #7)
> > Since I cannot reproduce the problem here, can you confirm that 2) fixes it?
> 
> Or rather, could you try attached patch?

It works.
Comment 10 Ulrich Müller gentoo-dev 2012-01-31 01:56:04 UTC
Fixed in emacs-23.4-r1.

Thank you for reporting this bug, and for pinpointing the problem.