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
atexit.register with bad input segfaults on exit #47916
Comments
The following crashes the interpreter on exit: import sys, atexit; atexit.register(lambda: 1, 0, 0, (x for x in (1,2)),
0, 0); sys.exit() Found with Fusil. |
I'm getting hundreds of lines Fatal Python error: PyThreadState_Get: no current thread The Python process segfaults in call_ll_exitfuncs -> atexit_cleanup() -> |
I was able to trace the error to its apartment. During the cleanup Conclusion: |
Why not just have atexit_callfuncs call atexit_cleanup at the end of its |
The attached patch causes an exception to print >>> import sys, atexit
>>> atexit.register(lambda: 1, 0, 0, (x for x in (1,2)), 0, 0)
<function <lambda> at 0x5c91e0>
>>> sys.exit()
Error in atexit._run_exitfuncs:
TypeError: print_exception(): Exception expected for value, str found Without the patch I get the same TypeError but it's I don't know if the patch is right or wrong, better or worse than the |
Skip: |
New patch. This also makes the various atexit_* |
I've taken this ticket. Can someone please review and give |
*thumbs up* |
Checked in as revision 66562. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: