Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Raising during line tracing events causes assertion failures when opcode tracing is enabled #96864

Closed
Assignees
brandtbucher
Labels
3.10only security fixes3.11only security fixes3.12only security fixesinterpreter-core(Objects, Python, Grammar, and Parser dirs)release-blockertype-crashA hard crash of the interpreter, possibly with a core dump
@chgnrdv

Description

@chgnrdv

Example:

importsysdeftracefunc(frame,event,arg):frame.f_trace_opcodes=Trueifevent=='line':1/0returntracefuncdefmain():passsys.settrace(tracefunc)main()

3.12.0a0 (main:e47b96c44f) crashes with the following message:

$ ../cpython/python -Xfaulthandler crash.py python: Python/ceval.c:1107: _PyEval_EvalFrameDefault: Assertion `!_PyErr_Occurred(tstate)' failed.Fatal Python error: AbortedCurrent thread 0x00007f06c1a47740 (most recent call first):  File "/home/.../crash.py", line 13 in <module>Aborted (core dumped)

Stack trace:

#0  0x00007ffff7d3f34c in __pthread_kill_implementation () from /usr/lib/libc.so.6#1  0x00007ffff7cf24b8 in raise () from /usr/lib/libc.so.6#2  0x00007ffff7cdc534 in abort () from /usr/lib/libc.so.6#3  0x00007ffff7cdc45c in __assert_fail_base.cold () from /usr/lib/libc.so.6#4  0x00007ffff7ceb116 in __assert_fail () from /usr/lib/libc.so.6#5  0x00005555557b7497 in _PyEval_EvalFrameDefault (tstate=0x555555b46aa8 <_PyRuntime+180616>, frame=0x7ffff7fbc020, throwflag=0)atPython/ceval.c:1107#6  0x00005555557c9d3b in _PyEval_EvalFrame (tstate=tstate@entry=0x555555b46aa8 <_PyRuntime+180616>, frame=frame@entry=0x7ffff7fbc020,throwflag=throwflag@entry=0)at ./Include/internal/pycore_ceval.h:95#7  0x00005555557c9e53 in _PyEval_Vector (tstate=tstate@entry=0x555555b46aa8 <_PyRuntime+180616>, func=func@entry=0x7ffff77e5e90,locals=locals@entry=0x7ffff77895b0,args=args@entry=0x0,argcount=argcount@entry=0,kwnames=kwnames@entry=0x0)atPython/ceval.c:5789#8  0x00005555557c9f69 in PyEval_EvalCode (co=co@entry=0x7ffff79a1fe0, globals=globals@entry=0x7ffff77895b0, locals=locals@entry=0x7ffff77895b0)atPython/ceval.c:591#9  0x00005555558246b3 in run_eval_code_obj (tstate=tstate@entry=0x555555b46aa8 <_PyRuntime+180616>, co=co@entry=0x7ffff79a1fe0,globals=globals@entry=0x7ffff77895b0,locals=locals@entry=0x7ffff77895b0)atPython/pythonrun.c:1713#10 0x0000555555824778 in run_mod (mod=mod@entry=0x555555c3fb10, filename=filename@entry=0x7ffff77f1310, globals=globals@entry=0x7ffff77895b0,locals=locals@entry=0x7ffff77895b0,flags=flags@entry=0x7fffffffe548,arena=arena@entry=0x7ffff77ec040)atPython/pythonrun.c:1734#11 0x0000555555824840 in pyrun_file (fp=fp@entry=0x555555b8f530, filename=filename@entry=0x7ffff77f1310, start=start@entry=257,globals=globals@entry=0x7ffff77895b0,locals=locals@entry=0x7ffff77895b0,closeit=closeit@entry=1,flags=0x7fffffffe548)atPython/pythonrun.c:1629#12 0x0000555555827664 in _PyRun_SimpleFileObject (fp=fp@entry=0x555555b8f530, filename=filename@entry=0x7ffff77f1310, closeit=closeit@entry=1,flags=flags@entry=0x7fffffffe548)atPython/pythonrun.c:439#13 0x0000555555827823 in _PyRun_AnyFileObject (fp=fp@entry=0x555555b8f530, filename=filename@entry=0x7ffff77f1310, closeit=closeit@entry=1,flags=flags@entry=0x7fffffffe548)atPython/pythonrun.c:78#14 0x0000555555845d79 in pymain_run_file_obj (program_name=program_name@entry=0x7ffff77f1380, filename=filename@entry=0x7ffff77f1310,skip_source_first_line=0)atModules/main.c:360#15 0x0000555555845ea1 in pymain_run_file (config=config@entry=0x555555b2b818 <_PyRuntime+69368>) at Modules/main.c:379#16 0x0000555555846637 in pymain_run_python (exitcode=exitcode@entry=0x7fffffffe6c4) at Modules/main.c:610#17 0x00005555558468e3 in Py_RunMain () at Modules/main.c:689#18 0x000055555584695a in pymain_main (args=args@entry=0x7fffffffe720) at Modules/main.c:719#19 0x0000555555846a20 in Py_BytesMain (argc=<optimized out>, argv=<optimized out>) at Modules/main.c:743#20 0x000055555564c742 in main (argc=<optimized out>, argv=<optimized out>) at ./Programs/python.c:15

3.10.7 prints this traceback:

$ python -Xfaulthandler crash.py Traceback (most recent call last):  File "/home/.../crash.py", line 10, in main    pass  File "/home/.../crash.py", line 6, in tracefunc    1 / 0ZeroDivisionError: division by zeroThe above exception was the direct cause of the following exception:Traceback (most recent call last):  File "/home/.../crash.py", line 13, in <module>    main()SystemError: _PyEval_EvalFrameDefault returned a result with an exception set

OS version: Linux 5.16.9-arch1-1 x86_64.

Metadata

Metadata

Assignees

Labels

3.10only security fixes3.11only security fixes3.12only security fixesinterpreter-core(Objects, Python, Grammar, and Parser dirs)release-blockertype-crashA hard crash of the interpreter, possibly with a core dump

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions


    [8]ページ先頭

    ©2009-2025 Movatter.jp