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
peephole optimizer bug relating to JUMP_IF_NOT_EXC_MATCH #86223
Comments
I've observed that pytest becomes segmentation fault on python 3.9.0 with attached case. I've tested the case with several python versions;
So I've bisected and a result is as follows; 9af0e47 is the first bad commit
Doc/library/dis.rst | 21 + |
Here is a result of running pytest on python 3.9.0 with gdb. ==================================================== test session starts ==================================================== test_main.py . |
A test code does not always reproduce the issue. Please try it in several times. It seems to be happened when multiple threads try execute a same function which produces an exception, and both callers try to catch the exception at the same time. |
The test example has no reference to pytest in it. How are you running it? |
I confirmed the issue. The simple version of the reproducer is:
I can see assertion failure consisntently, when I use python --with-pydebug. It seems peephole bug. Without peephole:
And with peephole:
JUMP_IF_TRUE_OR_POP is converted into POP_JUMP_IF_TRUE. Exception is popped although JUMP_IF_NOT_EXC_MATCH needs it. |
I confirmed fix42057.patch fix the assertion failure. But I don't know where and how to write test yet. |
Thank you for reporting with reproducer. |
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: