Skip to content

gh-121921: Make bogus_code_obj.py crash the interpreter #121922

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

Merged
merged 1 commit into from
Jul 18, 2024

Conversation

JelleZijlstra
Copy link
Member

@JelleZijlstra JelleZijlstra commented Jul 17, 2024

On a debug build I now get:

% ./python.exe Lib/test/crashers/bogus_code_obj.py          
Assertion failed: (STACK_LEVEL() > 0), function _PyEval_EvalFrameDefault, file generated_cases.c.h, line 3740.
zsh: abort      ./python.exe Lib/test/crashers/bogus_code_obj.py

On a release build it segfaults:

% ~/.pyenv/versions/3.13.0b1/bin/python Lib/test/crashers/bogus_code_obj.py 
zsh: segmentation fault  ~/.pyenv/versions/3.13.0b1/bin/python Lib/test/crashers/bogus_code_obj.py

You could do more interesting things if you write some actual bytecode that does funny things, but I'd prefer to keep the crasher as simple as possible.

Copy link
Member

@Eclips4 Eclips4 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. I'm not sure that the NEWS entry is necessary here.

@hauntsaninja hauntsaninja merged commit 63ddd28 into python:main Jul 18, 2024
36 checks passed
@JelleZijlstra JelleZijlstra deleted the crashreal branch July 18, 2024 10:01
@JelleZijlstra JelleZijlstra restored the crashreal branch September 10, 2024 23:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants