bug-ncurses
[Top][All Lists]
Advanced

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

Re: bug found when freeing screen(s)


From: Thomas Dickey
Subject: Re: bug found when freeing screen(s)
Date: Fri, 17 Sep 2010 04:59:15 -0400 (EDT)

On Fri, 17 Sep 2010, Thomas Dickey wrote:

On Fri, Sep 17, 2010 at 10:27:19AM +0200, Fr?d?ric Boiteux wrote:
    Hello,

When porting an own application using ncurses from an old 5.5 version to
a current 5.7 (from 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.

  I think the bug is already present in latest version of ncurses.

The current code has this fix, from 2010/4/24:

The previous change to this section in 2008/3/29 introduced the error, but fixed a similar error. My change comment was:

   split-out delink_screen() so I can ensure the screen is found before
   trying to free it.  Noticed this problem when looking to see how to
   use each_screen().

--
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net

reply via email to

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