gh-152789: Skip curses tests needing newterm() on ncurses before 6.5#152880
Merged
serhiy-storchaka merged 1 commit intoJul 2, 2026
Merged
Conversation
…e 6.5 ncurses before 6.5 can crash on repeated newterm(). Fall back to initscr() in TestCurses and skip ScreenTests and SLKTests, which need several screens. The shared initscr() screen also needs its rendition and background reset between tests. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ncurses before 6.5 mishandles repeated
newterm(): a later call per process can corrupt screen state and crash (SIGSEGV inwnoutrefresh()), as seen on the ARM64 Raspbian buildbot. It was fixed in ncurses 6.5.On such a build,
TestCursesnow falls back toinitscr()instead ofnewterm(), andScreenTestsandSLKTests(which need severalnewterm()screens and have noinitscr()fallback) are skipped. Since the fallback makes every test share oneinitscr()screen instead of getting a fresh one fromnewterm(),setUp()also resets the current rendition and the background, which a previous test would otherwise leave to bleed into this one.Verified against locally built ncurses 6.4, 6.5 and 6.6 (widec + sp-funcs): 6.4 crashes without the change and passes with it (headless and on a real pty); 6.5 and 6.6 run the full suite unchanged, with nothing over-skipped.