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

Assertion failure on interrupt when catching exception group #102056

Closed
Assignees
iritkatriel
Labels
interpreter-core(Objects, Python, Grammar, and Parser dirs)type-crashA hard crash of the interpreter, possibly with a core dump
@chgnrdv

Description

@chgnrdv

This (maybe too made-up and detached from reality) repro causes assertion failure when executed on current main (32df540).
On 3.11 it warns about "lost sys.stderr" and terminates.

importtimeimportthreadingimport_threaddeff():try:f()exceptRecursionError:f()defg():try:raiseValueError()    except*ValueError:f()defh():time.sleep(1)_thread.interrupt_main()t=threading.Thread(target=h)t.start()g()t.join()

Output:

python: Objects/typeobject.c:4183: _PyType_Lookup: Assertion `!PyErr_Occurred()' failed.Aborted (core dumped)

Stack trace:

#00x00007ffff7d3f34c in__pthread_kill_implementation () from /usr/lib/libc.so.6#10x00007ffff7cf24b8 inraise () from /usr/lib/libc.so.6#20x00007ffff7cdc534 inabort () from /usr/lib/libc.so.6#30x00007ffff7cdc45c in __assert_fail_base.cold () from /usr/lib/libc.so.6#40x00007ffff7ceb116 in__assert_fail () from /usr/lib/libc.so.6#50x000055555574ecd9 in_PyType_Lookup (type=type@entry=0x555555be5430, name=name@entry=0x555555bb7c10 <_PyRuntime+334480>)    at Objects/typeobject.c:4183#60x00005555557319e3 in_PyObject_GenericGetAttrWithDict (obj=0x7ffff77a7c90, name=0x555555bb7c10 <_PyRuntime+334480>, dict=dict@entry=0x0,     suppress=suppress@entry=1) at Objects/object.c:1266#70x0000555555731d8d in_PyObject_LookupAttr (v=0x7ffff77a7c90, name=<optimized out>, result=result@entry=0x7ffffff40780) at Objects/object.c:933#80x000055555582764c inprint_exception_file_and_line (ctx=ctx@entry=0x7fffffffe270, value_p=value_p@entry=0x7ffffff40808)    at Python/pythonrun.c:941#90x0000555555827ed2 inprint_exception (ctx=ctx@entry=0x7fffffffe270, value=value@entry=0x7ffff77a7c90) at Python/pythonrun.c:1209#100x0000555555827fcc inprint_exception_group (ctx=ctx@entry=0x7fffffffe270, value=value@entry=0x7ffff77a7c90) at Python/pythonrun.c:1377#110x0000555555828418 inprint_exception_recursive (ctx=ctx@entry=0x7fffffffe270, value=value@entry=0x7ffff77a7c90) at Python/pythonrun.c:1491#120x0000555555828491 inprint_chained (ctx=ctx@entry=0x7fffffffe270, value=value@entry=0x7ffff77a7c90,     message=message@entry=0x55555594b200 <context_message>"During handling of the above exception, another exception occurred:\n",     tag=tag@entry=0x5555558deda0"context") at Python/pythonrun.c:1254#130x000055555582868e inprint_exception_cause_and_context (ctx=ctx@entry=0x7fffffffe270, value=value@entry=0x7ffff780e900)    at Python/pythonrun.c:1344#140x00005555558283d3 inprint_exception_recursive (ctx=ctx@entry=0x7fffffffe270, value=value@entry=0x7ffff780e900) at Python/pythonrun.c:1482#150x0000555555828491 inprint_chained (ctx=ctx@entry=0x7fffffffe270, value=value@entry=0x7ffff780e900,     message=message@entry=0x55555594b200 <context_message>"During handling of the above exception, another exception occurred:\n",     tag=tag@entry=0x5555558deda0"context") at Python/pythonrun.c:1254...#161860x000055555582868e inprint_exception_cause_and_context (ctx=ctx@entry=0x7fffffffe270, value=value@entry=0x7ffff6be0ec0)    at Python/pythonrun.c:1344#161870x00005555558283d3 inprint_exception_recursive (ctx=ctx@entry=0x7fffffffe270, value=value@entry=0x7ffff6be0ec0) at Python/pythonrun.c:1482#161880x0000555555828491 inprint_chained (ctx=ctx@entry=0x7fffffffe270, value=value@entry=0x7ffff6be0ec0,    message=message@entry=0x55555594b200 <context_message>"During handling of the above exception, another exception occurred:\n",    tag=tag@entry=0x5555558deda0"context") at Python/pythonrun.c:1254#161890x000055555582868e inprint_exception_cause_and_context (ctx=ctx@entry=0x7fffffffe270, value=value@entry=0x7ffff6be0f30)    at Python/pythonrun.c:1344#161900x00005555558283d3 inprint_exception_recursive (ctx=ctx@entry=0x7fffffffe270, value=value@entry=0x7ffff6be0f30) at Python/pythonrun.c:1482#161910x0000555555828969 in_PyErr_Display (file=file@entry=0x7ffff79ba7b0, exception=exception@entry=0x555555a75160 <_PyExc_KeyboardInterrupt>,    value=value@entry=0x7ffff6be0f30, tb=tb@entry=0x7ffff6c22ad0) at Python/pythonrun.c:1530#161920x0000555555828ad3 inPyErr_Display (exception=0x555555a75160 <_PyExc_KeyboardInterrupt>, value=0x7ffff6be0f30, tb=0x7ffff6c22ad0)    at Python/pythonrun.c:1562#161930x0000555555835660 insys_excepthook_impl (module=module@entry=0x7ffff7947f50, exctype=<optimized out>, value=<optimized out>,    traceback=<optimized out>) at ./Python/sysmodule.c:748#161940x00005555558356c6 insys_excepthook (module=0x7ffff7947f50, args=args@entry=0x7fffffffe3f0, nargs=nargs@entry=3)    at ./Python/clinic/sysmodule.c.h:102#161950x000055555572c28c incfunction_vectorcall_FASTCALL (func=0x7ffff7948470, args=0x7fffffffe3f0, nargsf=<optimized out>, kwnames=<optimized out>)    at Objects/methodobject.c:422#161960x00005555556e1aa0 in_PyObject_VectorcallTstate (tstate=0x555555bd8808 <_PyRuntime+468616>, callable=callable@entry=0x7ffff7948470,    args=0x7fffffffe3f0, args@entry=0x7fffffffe360, nargsf=nargsf@entry=3, kwnames=kwnames@entry=0x0) at ./Include/internal/pycore_call.h:92#161970x00005555556e1b90 in_PyObject_FastCallTstate (nargs=3, args=0x7fffffffe360, func=0x7ffff7948470, tstate=<optimized out>)    at ./Include/internal/pycore_call.h:116#16198_PyObject_FastCall (func=func@entry=0x7ffff7948470, args=args@entry=0x7fffffffe3f0, nargs=nargs@entry=3) at Objects/call.c:310#161990x0000555555828c2b in_PyErr_PrintEx (tstate=0x555555bd8808 <_PyRuntime+468616>, set_sys_last_vars=set_sys_last_vars@entry=1)    at Python/pythonrun.c:813#162000x0000555555828eb1 inPyErr_PrintEx (set_sys_last_vars=set_sys_last_vars@entry=1) at Python/pythonrun.c:861#162010x0000555555828ec1 inPyErr_Print () at Python/pythonrun.c:867#162020x00005555558293ab in_PyRun_SimpleFileObject (fp=fp@entry=0x555555bdb530, filename=filename@entry=0x7ffff77adbc0, closeit=closeit@entry=1,    flags=flags@entry=0x7fffffffe508) at Python/pythonrun.c:439#162030x000055555582951d in_PyRun_AnyFileObject (fp=fp@entry=0x555555bdb530, filename=filename@entry=0x7ffff77adbc0, closeit=closeit@entry=1,    flags=flags@entry=0x7fffffffe508) at Python/pythonrun.c:78#162040x00005555558487a5 inpymain_run_file_obj (program_name=program_name@entry=0x7ffff77c7370, filename=filename@entry=0x7ffff77adbc0,    skip_source_first_line=0) at Modules/main.c:360#162050x00005555558488cd inpymain_run_file (config=config@entry=0x555555bbd3c0 <_PyRuntime+356928>) at Modules/main.c:379#162060x0000555555849063 inpymain_run_python (exitcode=exitcode@entry=0x7fffffffe684) at Modules/main.c:610#162070x000055555584930f inPy_RunMain () at Modules/main.c:689#162080x0000555555849386 inpymain_main (args=args@entry=0x7fffffffe6e0) at Modules/main.c:719#162090x000055555584944c inPy_BytesMain (argc=<optimized out>, argv=<optimized out>) at Modules/main.c:743#162100x0000555555651772 inmain (argc=<optimized out>, argv=<optimized out>) at ./Programs/python.c:15

Linked PRs

Metadata

Metadata

Assignees

Labels

interpreter-core(Objects, Python, Grammar, and Parser dirs)type-crashA hard crash of the interpreter, possibly with a core dump

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions


    [8]ページ先頭

    ©2009-2025 Movatter.jp