-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ui_adaptor: don't invalidate uis below when exiting game #76000
Conversation
@Qrox can you take a look please? It has been a minute since I've looked at this code |
Looks good to me, thanks for fixing it! I'm a bit surprised this hasn't been caught by static analysis though... |
It seems to only happen on handling signals with ui present and requires using a user dir flag apparently. We don't run tests with ui present. |
Thanks |
I think this needs to be backported to the 0.H release candidate. I was testing and when I exited the curses version (probably applicable to tiles, too) it spat out this backtrace, which looks to me as if this fix would address this.
|
@andrei8l does this stack look related? https://github.com/CleverRaven/Cataclysm-DDA/actions/runs/10713363162/job/29705360471?pr=76153#step:18:298
That should have been on new enough code because of auto rebase, but I'll resubmit after a manual rebase and see if it comes back... |
Summary
None
Purpose of change
Fixes: #54886
Fixes: #73667 (duplicate)
Closes: #75992 (invalidates)
The destructor for
ui_adaptor()
relies on UB wrt the state of static global objects.Describe the solution
Don't try to invalidate
ui_adaptor
s below if we're quitting the gameDescribe alternatives you've considered
Figure out a stable order of initialization for
g
(game) andui_stack
so thatg
and itsui_adaptor
s die beforeui_stack
: this PR is simpler and less invasiveA better solution is probably to move the code from
~ui_adaptor()
to some kind of helper guard struct.Testing
Using the binaries from this release:
Wait till you wake up
static popup is running its animation, send a SIGTERM to the gameAdditional context
N/A