-
Notifications
You must be signed in to change notification settings - Fork 531
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
Ensure Platform globals are freed on error #2685
Conversation
By default, AFAIU, the C language always auto initializes globals with zero. I don't think PR is doing anything, |
I'm not so sure of that; in the test failure that inspired me to make this fix, these globals were just addresses and non-NULL, which caused the test to crash when trying to free them. Perhaps it was from a previous run, but the globals should be set to NULL at the end of the run, so I don't think it is that. |
Globals are definitely 0 initialized on program start. So I'd be more inclined to look at a bug with a previous run not resetting everything correctly. |
How about try writing a test that validates the initial conditions between resets? |
I'm first adding some debug asserts to ensure we catch when these are not-NULL. I'll brainstorm some more on how to write a test for this. Seems spinquic might be exercising this scenario quite a bit, and is likely the best place to catch it. |
@anrossi there are a couple spinquic failures. Can you double check to see if they are hitting your new asserts? |
Description
Free platform globals in error path. Fixes #2683
Testing
SpinQuic is how this was found, and the fix was validated against the SpinQuic scenario which found it.
Documentation
N/A.