Closed
Description
Full reproducer:
import sys
def fun():
a = 1 # <---- jump location
x = [i for i in range(10)]
c = 3 # current location
def trace(frame, event, arg):
if event == "line" and frame.f_lineno == 9:
frame.f_lineno = 4
return trace
sys.settrace(trace)
if __name__ == "__main__":
fun()
Jumping from line current location
to jump location
yields SIGSEGV
Error messages
.venv/bin/python <cwd>/cakeshop.py
Fatal Python error: Segmentation fault
Current thread 0x00007f16eaae5280 (most recent call first):
File "<cwd>/cakeshop.py", line 14 in trace
File "<cwd>/cakeshop.py", line 9 in fun
File "<cwd>/cakeshop.py", line 22 in <module>
Process finished with exit code 139 (interrupted by signal 11: SIGSEGV)
Your environment
- CPython versions tested on: 3.9.11, 3.10.1 (3.11.x works as expected same as <3.9)
- Operating system and architecture: Linux q 5.4.0-42-generic x64