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
2.7 core crashes with generator.gi_frame.f_restricted #67040
Comments
seen with the current 2.7 branch: $ cat > x.py
def foo(): yield
gen = foo()
print gen.gi_frame.f_restricted
for i in gen: pass
print gen.gi_frame
gen = foo()
print gen.next()
print gen.gi_frame.f_restricted
$ python x.py
False
None
None
Segmentation fault Program received signal SIGSEGV, Segmentation fault. |
This is related to the fix for bpo-14432. gen_send_ex sets f->f_tstate to NULL, so PyFrame_IsRestricted segfaults: #define PyFrame_IsRestricted(f) \
((f)->f_builtins != (f)->f_tstate->interp->builtins) |
Related change: New changeset aa324af42c0e by Victor Stinner in branch '2.7': |
This appears to be 2.7 only as 3.4.2 stops on the first print with AttributeError: 'frame' object has no attribute 'f_restricted', which is not a crash. |
The fix for bpo-14432 was applied to 3.3, but I'm pretty sure 2.x PyFrame_IsRestricted is the only problem. Nothing else should see f_tstate when it's NULL. Also, f_tstate was dropped from PyFrameObject in 3.4. |
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: