Github: Enforce expected amount of cxa_atexit registrations#5235
Open
Sonicadvance1 wants to merge 5 commits intoFEX-Emu:mainfrom
Open
Github: Enforce expected amount of cxa_atexit registrations#5235Sonicadvance1 wants to merge 5 commits intoFEX-Emu:mainfrom
Sonicadvance1 wants to merge 5 commits intoFEX-Emu:mainfrom
Conversation
neobrain
reviewed
Jan 14, 2026
68faf8b to
7ce6dda
Compare
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
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.
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.
9e813de to
905df53
Compare
crueter
reviewed
Jan 19, 2026
ba52cbd to
937a26e
Compare
neobrain
requested changes
Feb 24, 2026
Member
neobrain
left a comment
There was a problem hiding this comment.
(pending on the other PRs that are stalled; marking as "requesting changes" to help distinguish this from active PRs in our crowded PR list)
…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`.
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.
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.