bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#10629: Infinite loop in emacs 23 on terminal (-nw option) on xgselec


From: Maciej Marcin Piechotka
Subject: bug#10629: 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 17:01:34 +0000

On Sat, 2012-01-28 at 16:24 +0000, Maciej Marcin Piechotka wrote:
> 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
> 

Ups. Sorry - I forgot to add one file to git index. Corrected patch
attached.

Best regards

Attachment: 0001-Fix-infinit-loop-when-emacs-is-compiled-with-GTK-sup.patch
Description: Text Data

Attachment: signature.asc
Description: This is a digitally signed message part


reply via email to

[Prev in Thread] Current Thread [Next in Thread]