Le 17/09/2010 14:15, Sven Joachim a écrit :
> On 2010-09-17 11:48 +0200, Frédéric Boiteux wrote:
>
>   
>>   When porting an own application using ncurses from an old 5.5 version to
>> a current 5.7 (i.e. on a Debian Lenny system), I found a bug related to free
>> of screens (the application manages multiple terminals) : when the close
>> of terminals was in the same order they was created, the application
>> segfaulted or looped indefinitely. I identified the bug in the
>> delscreen() function, and more precisely in delink_screen() where the
>> global list of screens is incorrectly updated.
>>   I've successfully tested my application with the simple patch attached.
>>     
> Could you show some sample code that triggers the bug?  The patch looks
> correct to me, but I'd like to verify that it works.
>   
The application is quite complex and not a free code, so not suitable as
a sample test code.
But the fix from Thomas Dickey, from ncurses, was identical :

--- lib_set_term.c      2010/04/24 23:09:24     1.136 
+++ lib_set_term.c      2010/05/01 19:47:51     1.137 
@@ -47,7 +47,7 @@ 
 #define CUR SP_TERMTYPE
 #endif

-MODULE_ID("$Id: lib_set_term.c,v 1.135 2009/11/28 21:49:24 tom Exp $") 
+MODULE_ID("$Id: lib_set_term.c,v 1.136 2010/04/24 23:09:24 tom Exp $") 

 #ifdef USE_TERM_DRIVER
 #define MaxColors      InfoOf(sp).maxcolors
@@ -117,7 +117,7 @@ 
     for (each_screen(temp)) {
        if (temp == sp) {
            if (last)
-               last = sp->_next_screen; 
+               last->_next_screen = sp->_next_screen; 
            else
                _nc_screen_chain = sp->_next_screen;
            result = TRUE;


>   
>>   This bug is also present in Squeeze and Sid. It has been fixed
>> upstream in 2010/4/24 (last version of Sid is 20100313), I checked this
>> with upstream authors (T. Dickey).
>>     
> Actually it was fixed in 2010/5/01.
>   
Ok.

>   
>>   It would be nice if the patch could be integrated in next Lenny
>> release (if any)
>>     
> Could be difficult, since the requirements for stable updates are rather
> strict¹.
>   
I wasn't sure… What I would not like is to have a new libncurses5 Lenny
package (for another reason) *without* this bug fix, it could be
domagable for me.

>> and also in coming Squeeze.
>>     
> That's certainly possible.  As soon as the current version migrates to
> Squeeze (should happen by the end of next week), we can upload to sid
> and ask for another freeze exception.
>   
Thanks Sven for your help on this topic (previously on -dbg package's
usage).

Fred.





--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to