-
Notifications
You must be signed in to change notification settings - Fork 235
Github: Enforce expected amount of cxa_atexit registrations #5235
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
Open
Sonicadvance1
wants to merge
6
commits into
FEX-Emu:main
Choose a base branch
from
Sonicadvance1:59
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
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
neobrain
reviewed
Jan 14, 2026
This was a nasty race condition where each thread could be accessing the DRM cache at any given moment. Move it over to a per thread object that is only allocated once it gets used. Also removes an `atexit` registration that contributes to crashing on exit.
…ic object Just a little bit of late initialization to this pmr object using placement new. Removes an `atexit` registration that contributes to crashing on exit.
Even though we leak `Alloc64` on shutdown, that isn't good enough to avoid the `atexit` handler deallocating memory. So we need to use a raw pointer and leak it. Removes an `atexit` registration that contributes to crashing on exit.
These need to be late initialized because they allocate memory and register an `atexit` handler to deallocate. Removes an `atexit` registration that contributes to crashing on exit.
There is only one registration that I've not been able to track down why it happens, but it is something to do with std::ostream. This just ensures in CI that we don't ever register anymore atexit handlers so we don't regress on crashing on `exit`.
Member
Author
|
Looks like the bash implementation doesn't work. I don't know bash well enough to know what's wrong. 🤷 |
neobrain
reviewed
Jan 14, 2026
.github/workflows/ccpp.yml
Outdated
Comment on lines
240
to
244
| COUNT = `llvm-objdump -D ${{runner.workspace}}/build/Bin/FEX | grep "__cxa_atexit@plt>$" | wc -l` | ||
| if [ $COUNT -eq 1 ] | ||
| echo "Expected 1 atexit handlers, found $COUNT" | ||
| exit 1 | ||
| fi |
Member
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggested change
| COUNT = `llvm-objdump -D ${{runner.workspace}}/build/Bin/FEX | grep "__cxa_atexit@plt>$" | wc -l` | |
| if [ $COUNT -eq 1 ] | |
| echo "Expected 1 atexit handlers, found $COUNT" | |
| exit 1 | |
| fi | |
| COUNT=`llvm-objdump -D ${{runner.workspace}}/build/Bin/FEX | grep '__cxa_atexit@plt>\\$' | wc -l` | |
| if [ $COUNT -ne 1 ] | |
| echo "Expected 1 atexit handlers, found $COUNT" | |
| exit 1 | |
| fi |
Something to this effect should be good. Otherwise you might need to open a terminal and run it once to find the last typo.
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.
On top of the previous PRs.
There is only one registration that I've not been able to track down why
it happens, but it is something to do with std::ostream. This just
ensures in CI that we don't ever register anymore atexit handlers so we
don't regress on crashing on
exit.