Title: SEGV in `faulthandler.dump_traceback_later` · Issue #140815 · python/cpython · GitHub
Open Graph Title: SEGV in `faulthandler.dump_traceback_later` · Issue #140815 · python/cpython
X Title: SEGV in `faulthandler.dump_traceback_later` · Issue #140815 · python/cpython
Description: Crash report What happened? import faulthandler import sys import unittest class Test(unittest.TestCase): def setUp(self): faulthandler.dump_traceback_later(10 * 1e-308, exit=True, file=sys.__stderr__) def test_sendall(self): os.mkfifo(f...
Open Graph Description: Crash report What happened? import faulthandler import sys import unittest class Test(unittest.TestCase): def setUp(self): faulthandler.dump_traceback_later(10 * 1e-308, exit=True, file=sys.__stder...
X Description: Crash report What happened? import faulthandler import sys import unittest class Test(unittest.TestCase): def setUp(self): faulthandler.dump_traceback_later(10 * 1e-308, exit=True, file=sys.__stder...
Opengraph URL: https://github.com/python/cpython/issues/140815
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"SEGV in `faulthandler.dump_traceback_later`","articleBody":"# Crash report\n\n### What happened?\n\n```python\nimport faulthandler\nimport sys\nimport unittest\n\nclass Test(unittest.TestCase):\n def setUp(self):\n faulthandler.dump_traceback_later(10 * 1e-308, exit=True, file=sys.__stderr__)\n def test_sendall(self):\n os.mkfifo(filename)\n\nif __name__ == '__main__':\n unittest.main()\n```\n\n```\nFAILED (errors=1)\n #0 0x5646ef225cff in dump_traceback ../Python/traceback.c:1111\n #1 0x5646ef229ae2 in _Py_DumpTracebackThreads ../Python/traceback.c:1302\n #2 0x5646ef2709d4 in faulthandler_thread ../Modules/faulthandler.c:706\n #3 0x5646ef2220af in pythread_wrapper ../Python/thread_pthread.h:234\n #4 0x76c294e77a41 in asan_thread_start ../../../../src/libsanitizer/asan/asan_interceptors.cpp:234\n #5 0x76c294bbaaa3 (/lib/x86_64-linux-gnu/libc.so.6+0x9caa3) (BuildId: 282c2c16e7b6600b0b22ea0c99010d2795752b5f)\n #6 0x76c294c47a33 in __clone (/lib/x86_64-linux-gnu/libc.so.6+0x129a33) (BuildId: 282c2c16e7b6600b0b22ea0c99010d2795752b5f)\n\nAddress 0x76c292fb39da is located in stack of thread T0 at offset 2522 in frame\n #0 0x5646eeb38bcf in _PyEval_EvalFrameDefault ../Python/ceval.c:1032\n\n This frame has 37 object(s):\n [32, 36) 'method_found'\n [48, 52) 'level'\n [64, 68) 'handler'\n [80, 84) 'lasti'\n [96, 104) 'temp'\n [128, 136) 'res_o'\n [160, 168) 'match_o'\n [192, 200) 'rest_o'\n [224, 232) 'null_or_index'\n [256, 264) 'null_or_index'\n [288, 296) 'executor'\n [320, 328) 'bc_o'\n [352, 360) 'value_o'\n [384, 392) 'v_o'\n [416, 424) 'retval_o'\n [448, 456) 'ann_dict'\n [480, 488) 'kwnames' (line 1906)\n [512, 528) 'stack'\n [544, 560) 'stack'\n [576, 592) 'args'\n [608, 648) 'stack'\n [688, 752) 'stack_array' (line 1909)\n [784, 872) 'values_o_temp'\n [912, 1000) 'pieces_o_temp'\n [1040, 1128) 'args_o_temp'\n [1168, 1256) 'args_o_temp'\n [1296, 1384) 'args_o_temp'\n [1424, 1512) 'args_o_temp'\n [1552, 1640) 'args_o_temp'\n [1680, 1768) 'args_o_temp'\n [1808, 1896) 'args_o_temp'\n [1936, 2024) 'args_o_temp'\n [2064, 2152) 'args_o_temp'\n [2192, 2280) 'args_o_temp'\n [2320, 2408) 'args_o_temp'\n [2448, 2544) 'entry' (line 1051) \u003c== Memory access at offset 2522 is inside this variable\n [2576, 2656) 'buffer' (line 518)\nHINT: this may be a false positive if your program uses some custom stack unwind mechanism, swapcontext or vfork\n (longjmp and C++ exceptions *are* supported)\nSUMMARY: AddressSanitizer: stack-use-after-return ../Python/traceback.c:1111 in dump_traceback\nShadow bytes around the buggy address:\n 0x76c292fb3700: f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5\n 0x76c292fb3780: f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5\n 0x76c292fb3800: f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5\n 0x76c292fb3880: f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5\n 0x76c292fb3900: f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5\n=>0x76c292fb3980: f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5[f5]f5 f5 f5 f5\n 0x76c292fb3a00: f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5\n 0x76c292fb3a80: f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5\n 0x76c292fb3b00: f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5\n 0x76c292fb3b80: f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5\n 0x76c292fb3c00: f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5\nShadow byte legend (one shadow byte represents 8 application bytes):\n Addressable: 00\n Partially addressable: 01 02 03 04 05 06 07 \n Heap left redzone: fa\n Freed heap region: fd\n Stack left redzone: f1\n Stack mid redzone: f2\n Stack right redzone: f3\n Stack after return: f5\n Stack use after scope: f8\n Global redzone: f9\n Global init order: f6\n Poisoned by user: f7\n Container overflow: fc\n Array cookie: ac\n Intra object redzone: bb\n ASan internal: fe\n Left alloca redzone: ca\n Right alloca redzone: cb\nThread T1 created by T0 here:\n #0 0x76c294f0e1f9 in pthread_create ../../../../src/libsanitizer/asan/asan_interceptors.cpp:245\n #1 0x5646ef22228b in do_start_joinable_thread ../Python/thread_pthread.h:281\n #2 0x5646ef2229a1 in PyThread_start_new_thread ../Python/thread_pthread.h:336\n #3 0x5646ef274706 in faulthandler_dump_traceback_later_impl ../Modules/faulthandler.c:868\n #4 0x5646ef274706 in faulthandler_dump_traceback_later ../Modules/clinic/faulthandler.c.h:366\n #5 0x5646eec9f677 in _PyObject_VectorcallTstate ../Include/internal/pycore_call.h:169\n #6 0x5646eec9f677 in PyObject_Vectorcall ../Objects/call.c:327\n #7 0x5646eeb42bba in _PyEval_EvalFrameDefault ../Python/generated_cases.c.h:2920\n #8 0x5646ef020785 in _PyEval_EvalFrame ../Include/internal/pycore_ceval.h:121\n #9 0x5646ef020785 in _PyEval_Vector ../Python/ceval.c:2005\n #10 0x5646eeca90f0 in _PyObject_VectorcallTstate ../Include/internal/pycore_call.h:169\n #11 0x5646eeca90f0 in method_vectorcall ../Objects/classobject.c:95\n #12 0x5646eeca478e in _PyVectorcall_Call ../Objects/call.c:273\n #13 0x5646eeca478e in _PyObject_Call ../Objects/call.c:348\n #14 0x5646eeca478e in PyObject_Call ../Objects/call.c:373\n #15 0x5646eeb43e9c in _PyEval_EvalFrameDefault ../Python/generated_cases.c.h:2616\n #16 0x5646ef020785 in _PyEval_EvalFrame ../Include/internal/pycore_ceval.h:121\n #17 0x5646ef020785 in _PyEval_Vector ../Python/ceval.c:2005\n #18 0x5646eeca2db3 in _PyObject_VectorcallDictTstate ../Objects/call.c:135\n #19 0x5646eeca346c in _PyObject_Call_Prepend ../Objects/call.c:504\n #20 0x5646eee5ff64 in call_method ../Objects/typeobject.c:3077\n #21 0x5646eee5ff64 in slot_tp_call ../Objects/typeobject.c:10606\n #22 0x5646eec9dc5d in _PyObject_MakeTpCall ../Objects/call.c:242\n #23 0x5646eeb417ac in _PyEval_EvalFrameDefault ../Python/generated_cases.c.h:4021\n #24 0x5646ef020785 in _PyEval_EvalFrame ../Include/internal/pycore_ceval.h:121\n #25 0x5646ef020785 in _PyEval_Vector ../Python/ceval.c:2005\n #26 0x5646eeca90f0 in _PyObject_VectorcallTstate ../Include/internal/pycore_call.h:169\n #27 0x5646eeca90f0 in method_vectorcall ../Objects/classobject.c:95\n #28 0x5646eeca478e in _PyVectorcall_Call ../Objects/call.c:273\n #29 0x5646eeca478e in _PyObject_Call ../Objects/call.c:348\n #30 0x5646eeca478e in PyObject_Call ../Objects/call.c:373\n #31 0x5646eeb43e9c in _PyEval_EvalFrameDefault ../Python/generated_cases.c.h:2616\n #32 0x5646ef020785 in _PyEval_EvalFrame ../Include/internal/pycore_ceval.h:121\n #33 0x5646ef020785 in _PyEval_Vector ../Python/ceval.c:2005\n #34 0x5646eeca2db3 in _PyObject_VectorcallDictTstate ../Objects/call.c:135\n #35 0x5646eeca346c in _PyObject_Call_Prepend ../Objects/call.c:504\n #36 0x5646eee5ff64 in call_method ../Objects/typeobject.c:3077\n #37 0x5646eee5ff64 in slot_tp_call ../Objects/typeobject.c:10606\n #38 0x5646eec9dc5d in _PyObject_MakeTpCall ../Objects/call.c:242\n #39 0x5646eeb40ad2 in _PyEval_EvalFrameDefault ../Python/generated_cases.c.h:1620\n #40 0x5646ef020785 in _PyEval_EvalFrame ../Include/internal/pycore_ceval.h:121\n #41 0x5646ef020785 in _PyEval_Vector ../Python/ceval.c:2005\n #42 0x5646eeca90f0 in _PyObject_VectorcallTstate ../Include/internal/pycore_call.h:169\n #43 0x5646eeca90f0 in method_vectorcall ../Objects/classobject.c:95\n #44 0x5646eeca478e in _PyVectorcall_Call ../Objects/call.c:273\n #45 0x5646eeca478e in _PyObject_Call ../Objects/call.c:348\n #46 0x5646eeca478e in PyObject_Call ../Objects/call.c:373\n #47 0x5646eeb43e9c in _PyEval_EvalFrameDefault ../Python/generated_cases.c.h:2616\n #48 0x5646ef020785 in _PyEval_EvalFrame ../Include/internal/pycore_ceval.h:121\n #49 0x5646ef020785 in _PyEval_Vector ../Python/ceval.c:2005\n #50 0x5646eeca2db3 in _PyObject_VectorcallDictTstate ../Objects/call.c:135\n #51 0x5646eeca346c in _PyObject_Call_Prepend ../Objects/call.c:504\n #52 0x5646eee5ff64 in call_method ../Objects/typeobject.c:3077\n #53 0x5646eee5ff64 in slot_tp_call ../Objects/typeobject.c:10606\n #54 0x5646eec9dc5d in _PyObject_MakeTpCall ../Objects/call.c:242\n #55 0x5646eeb40ad2 in _PyEval_EvalFrameDefault ../Python/generated_cases.c.h:1620\n #56 0x5646ef020785 in _PyEval_EvalFrame ../Include/internal/pycore_ceval.h:121\n #57 0x5646ef020785 in _PyEval_Vector ../Python/ceval.c:2005\n #58 0x5646eeca2db3 in _PyObject_VectorcallDictTstate ../Objects/call.c:135\n #59 0x5646eeca346c in _PyObject_Call_Prepend ../Objects/call.c:504\n #60 0x5646eee4d2e0 in call_method ../Objects/typeobject.c:3077\n #61 0x5646eee4d2e0 in slot_tp_init ../Objects/typeobject.c:10835\n #62 0x5646eee3f457 in type_call ../Objects/typeobject.c:2461\n #63 0x5646eec9dc5d in _PyObject_MakeTpCall ../Objects/call.c:242\n #64 0x5646eeb5c9f8 in _PyEval_EvalFrameDefault ../Python/generated_cases.c.h:1620\n #65 0x5646ef01ffb6 in _PyEval_EvalFrame ../Include/internal/pycore_ceval.h:121\n #66 0x5646ef01ffb6 in _PyEval_Vector ../Python/ceval.c:2005\n #67 0x5646ef01ffb6 in PyEval_EvalCode ../Python/ceval.c:888\n #68 0x5646ef1de3fe in run_eval_code_obj ../Python/pythonrun.c:1365\n #69 0x5646ef1de3fe in run_mod ../Python/pythonrun.c:1459\n #70 0x5646ef1e30a7 in pyrun_file ../Python/pythonrun.c:1293\n #71 0x5646ef1e30a7 in _PyRun_SimpleFileObject ../Python/pythonrun.c:521\n #72 0x5646ef1e3bcc in _PyRun_AnyFileObject ../Python/pythonrun.c:81\n #73 0x5646ef2563cc in pymain_run_file_obj ../Modules/main.c:410\n #74 0x5646ef2563cc in pymain_run_file ../Modules/main.c:429\n #75 0x5646ef2563cc in pymain_run_python ../Modules/main.c:691\n #76 0x5646ef257cae in Py_RunMain ../Modules/main.c:772\n #77 0x5646ef257cae in pymain_main ../Modules/main.c:802\n #78 0x5646ef257cae in Py_BytesMain ../Modules/main.c:826\n #79 0x76c294b481c9 (/lib/x86_64-linux-gnu/libc.so.6+0x2a1c9) (BuildId: 282c2c16e7b6600b0b22ea0c99010d2795752b5f)\n #80 0x76c294b4828a in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2a28a) (BuildId: 282c2c16e7b6600b0b22ea0c99010d2795752b5f)\n\n==2938816==ABORTING\n```\n\n\n### CPython versions tested on:\n\nCPython main branch\n\n### Operating systems tested on:\n\nLinux\n\n### Output from running 'python -VV' on the command line:\n\n_No response_\n\n\u003c!-- gh-linked-prs -->\n### Linked PRs\n* gh-140895\n* gh-140921\n* gh-140981\n* gh-140985\n\u003c!-- /gh-linked-prs -->\n","author":{"url":"https://github.com/YuanchengJiang","@type":"Person","name":"YuanchengJiang"},"datePublished":"2025-10-31T10:07:37Z","url":"https://github.com/python/cpython/issues/140815"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:21a52194-64ef-92de-582c-609822417d45 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8726:10F057:1E094E:279C8E:6B022CB5 |
| html-safe-nonce | 0a2847225dd6e72e3c81348402c0fdeef82eee9549ceef619588054cc5354d99 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4NzI2OjEwRjA1NzoxRTA5NEU6Mjc5QzhFOjZCMDIyQ0I1IiwidmlzaXRvcl9pZCI6IjMzODkxNTQ4ODg3MDU3NTI4NSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | fd860d4849153f178b86ffe34d08bc687ae043e574e9df0dc6bf9155ae7d865c |
| hovercard-subject-tag | issue:3574261278 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/140815/issue_layout |
| twitter:image | https://opengraph.githubassets.com/50d28b2d18ec8c825db929459df2a3bfb09afc64d1b3787b204f253493fedb88/python/cpython/issues/140815 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/50d28b2d18ec8c825db929459df2a3bfb09afc64d1b3787b204f253493fedb88/python/cpython/issues/140815 |
| og:image:alt | Crash report What happened? import faulthandler import sys import unittest class Test(unittest.TestCase): def setUp(self): faulthandler.dump_traceback_later(10 * 1e-308, exit=True, file=sys.__stder... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | YuanchengJiang |
| hostname | github.com |
| expected-hostname | github.com |
| None | 87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456 |
| turbo-cache-control | no-preview |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 423dbb54c5e7bfecc838eb387c1435eb3d0e760d |
| ui-target | canary-2 |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width