This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author michaelforney
Recipients michaelforney
Date 2021-05-19.02:08:09
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1621390090.86.0.52375337548.issue44172@roundup.psfhosted.org>
In-reply-to
Content
When subwin() is used to create a subwindow for an original window, it does not keep a reference to the original window object. This can result in the original window getting deleted with delwin() before the subwindow.

According to the X/Open curses specification[0]:
> The application must delete subwindows before deleting the main window.

This is also mentioned in the ncurses documentation[1]:
> Subwindows must be deleted before the main window can be deleted.

When building the Python curses module against NetBSD's curses implementation, deleting the windows in the wrong order causes a double-free. This results in hanging or crashing when running test_curses.

To fix this, window objects for subwindows should keep a reference to the original window object.

[0] https://pubs.opengroup.org/onlinepubs/7908799/xcurses/delwin.html
[1] https://invisible-island.net/ncurses/man/curs_window.3x.html
History
Date User Action Args
2021-05-19 02:08:10michaelforneysetrecipients: + michaelforney
2021-05-19 02:08:10michaelforneysetmessageid: <1621390090.86.0.52375337548.issue44172@roundup.psfhosted.org>
2021-05-19 02:08:10michaelforneylinkissue44172 messages
2021-05-19 02:08:09michaelforneycreate