FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

test_manual_unwind_respects_frame_pointers fails on x86_64 Fedora Linux with enabled JIT (`yes-off`) · Issue #144741 · python/cpython · GitHub

Repository navigation

test_manual_unwind_respects_frame_pointers fails on x86_64 Fedora Linux with enabled JIT (yes-off) #144741

Closed

Description

Bug report

Bug description:

We build Python on x86_64 and aarch64 with --enable-experimental-jit=yes-off . The newly added test passes for aarch64 but doesn't for x86_64, with the following traceback.
For completeness, the CFLAGS we build with are:

CFLAGS=' -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Wno-complain-wrong-lang -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer  '

I am unable to reproduce this outside of the rpm build context yet, but I'm happy to test any ideas.

Full traceback:

Re-running test_frame_pointer_unwind in verbose mode (matching: test_manual_unwind_respects_frame_pointers)
test_manual_unwind_respects_frame_pointers (test.test_frame_pointer_unwind.FramePointerUnwindTests.test_manual_unwind_respects_frame_pointers) ... #00 0x7f8763378fda -> other
#01 0x7f87632eeac7 -> other
#02 0x7f87632efb77 -> other
#03 0x7f87634ddd3c -> other
#04 0x7f87634e6604 -> other
#05 0x7f87634da121 -> other
#06 0x7f876351552d -> other
#07 0x7f87632eff85 -> other
#08 0x7f87632eeac7 -> other
#09 0x7f87632efb77 -> other
#10 0x7f8763852186 -> other
#11 0x7f87634de1f1 -> other
#12 0x7f87634e8cdc -> other
#13 0x7f87634da121 -> other
#14 0x7f876351552d -> other
#15 0x7f87632eff85 -> other
#16 0x7f87632eeac7 -> other
#17 0x7f87632efb77 -> other
#18 0x7f8763852186 -> other
#19 0x7f87634de1f1 -> other
#20 0x7f87634e8cdc -> other
#21 0x7f87634da121 -> other
#22 0x7f876351552d -> other
#23 0x7f87632eff85 -> other
#24 0x7f87632eeac7 -> other
#25 0x7f87632efb77 -> other
#26 0x7f8763852186 -> other
#27 0x7f87634de1f1 -> other
#28 0x7f87634e8cdc -> other
#29 0x7f87634da121 -> other
#30 0x7f876351552d -> other
#31 0x7f87632eff85 -> other
#32 0x7f87632eeac7 -> other
#33 0x7f87632efb77 -> other
#34 0x7f8763852186 -> other
#35 0x7f87634de1f1 -> other
#36 0x7f87634e8cdc -> other
#37 0x7f87634da121 -> other
#38 0x7f876351552d -> other
#39 0x7f87632eff85 -> other
#40 0x7f87632eeac7 -> other
#41 0x7f87632efb77 -> other
#42 0x7f8763852186 -> other
#43 0x7f87634de1f1 -> other
#44 0x7f87634e8cdc -> other
#45 0x7f87634da121 -> other
#46 0x7f876351552d -> other
#47 0x7f87632eff85 -> other
#48 0x7f87632eeac7 -> other
#49 0x7f87632efb77 -> other
#50 0x7f8763852186 -> other
#51 0x7f87634de1f1 -> other
#52 0x7f87634e8cdc -> other
#53 0x7f87634da121 -> other
#54 0x7f876351552d -> other
#55 0x7f87632eff85 -> other
#56 0x7f87632eeac7 -> other
#57 0x7f87632efb77 -> other
#58 0x7f8763852186 -> other
#59 0x7f87634de1f1 -> other
#60 0x7f87634e8cdc -> other
#61 0x7f87634da121 -> other
#62 0x7f876351552d -> other
#63 0x7f87632eff85 -> other
#64 0x7f87632eeac7 -> other
#65 0x7f87632efb77 -> other
#66 0x7f8763852186 -> other
#67 0x7f87634de1f1 -> other
#68 0x7f87634e8cdc -> other
#69 0x7f87634da121 -> other
#70 0x7f876351552d -> other
#71 0x7f87632eff85 -> other
#72 0x7f87632eeac7 -> other
#73 0x7f87632efb77 -> other
#74 0x7f8763852186 -> other
#75 0x7f87634de1f1 -> other
#76 0x7f87634e8cdc -> other
#77 0x7f87634da121 -> other
#78 0x7f876351552d -> other
#79 0x7f87632eff85 -> other
#80 0x7f87632eeac7 -> other
#81 0x7f87632efb77 -> other
#82 0x7f8763852186 -> other
#83 0x7f8763378e09 -> other
#84 0x7f87632eeac7 -> other
#85 0x7f87632efb77 -> other
#86 0x7f87634ddd3c -> other
#87 0x7f87634e6604 -> other
#88 0x7f87634da121 -> other
#89 0x7f876351552d -> other
#90 0x7f87634dd758 -> other
#91 0x7f876374d7ed -> other
#92 0x7f876374dc58 -> other
#93 0x7f876374d40e -> other
#94 0x7f876374b98d -> other
#95 0x7f876378b0fd -> other
#96 0x7f876378c121 -> other
#97 0x7f876378c2f3 -> other
#98 0x7f876378c3c9 -> other
#99 0x7f876378c491 -> other
#100 0x55f0d60984bd -> python
#101 0x7f8763008681 -> other
#102 0x7f8763008798 -> other
#103 0x55f0d60983d5 -> python
{"length": 104, "python_frames": 2, "jit_frames": 0, "other_frames": 102, "jit_backend": "jit"}
JIT ranges:
  0x7fb224624000-0x7fb224647000
#00 0x7fb233378fda -> other
#01 0x7fb2332eeac7 -> other
#02 0x7fb2332efb77 -> other
#03 0x7fb2334ddd3c -> other
#04 0x7fb2334e6604 -> other
#05 0x7fb2334da121 -> other
#06 0x7fb23351552d -> other
#07 0x7fb2332eff85 -> other
#08 0x7fb2332eeac7 -> other
#09 0x7fb2332efb77 -> other
#10 0x7fb233852186 -> other
#11 0x7fb2334de1f1 -> other
#12 0x7fb22462f00f -> jit
{"length": 13, "python_frames": 0, "jit_frames": 1, "other_frames": 12, "jit_backend": "jit"}
  test_manual_unwind_respects_frame_pointers (test.test_frame_pointer_unwind.FramePointerUnwindTests.test_manual_unwind_respects_frame_pointers) (env={'PYTHON_JIT': '1'}) ... FAIL
======================================================================
FAIL: test_manual_unwind_respects_frame_pointers (test.test_frame_pointer_unwind.FramePointerUnwindTests.test_manual_unwind_respects_frame_pointers) (env={'PYTHON_JIT': '1'})
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/python3.15-3.15.0_a6-build/Python-3.15.0a6/Lib/test/test_frame_pointer_unwind.py", line 182, in test_manual_unwind_respects_frame_pointers
    self.assertGreater(
    ~~~~~~~~~~~~~~~~~~^
        python_frames,
        ^^^^^^^^^^^^^^
        0,
        ^^
        f"expected to find Python frames on {self.machine} with env {env}",
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
AssertionError: 0 not greater than 0 : expected to find Python frames on x86_64 with env {'PYTHON_JIT': '1'}

CPython versions tested on:

3.15

Operating systems tested on:

Linux

Linked PRs

Activity

  1. vstinner commented on Mar 4, 2026

    Member

    I reproduced the failure on Fedora Rawhide with the following commands:

    make distclean ||:
    ./configure --enable-shared --with-lto --with-pydebug --enable-experimental-jit=yes-off CFLAGS='-m64 -march=x86-64 -mtune=generic -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer'
    make -j14
    LD_LIBRARY_PATH=$PWD ./python -m test test_frame_pointer_unwind -v
    

    Fedora Rawhide: gcc (GCC) 16.0.1 20260209 (Red Hat 16.0.1-0).

  2. vstinner commented on Mar 4, 2026

    Member

    Aha, I can also reproduce the failure on Fedora 43: gcc (GCC) 15.2.1 20260123 (Red Hat 15.2.1-7).

  3. vstinner commented on Mar 4, 2026

    Member

    I reduced the reproducer to:

    make distclean ||:
    ./configure --enable-shared --with-pydebug --enable-experimental-jit=yes-off
    make -j14
    LD_LIBRARY_PATH=$PWD ./python -m test test_frame_pointer_unwind -v
    
  4. vstinner commented on Mar 4, 2026

    Member

    script.py:

    from test.test_frame_pointer_unwind import _annotate_unwind
    print(_annotate_unwind())

    Python built with --enable-shared

    Output with JIT disabled (truncated): python_frames=2

    $ PYTHON_JIT=0 LD_LIBRARY_PATH=$PWD ./python script.py
    #00 0x7effb2cfc1d6 -> other
    #01 0x7effb2ca2e2e -> other
    (...)
    #100 0x7effb2fa50b5 -> other
    #101 0x7effb2fa5135 -> other
    #102 0x40046f -> python
    #103 0x7effb2a105b5 -> other
    #104 0x7effb2a10668 -> other
    #105 0x4003a5 -> python
    {"length": 106, "python_frames": 2, "jit_frames": 0, "other_frames": 104, "jit_backend": "jit"}
    

    Output with JIT enabled: python_frames=0

    $ PYTHON_JIT=1 LD_LIBRARY_PATH=$PWD ./python script.py 
    JIT ranges:
      0x7eff619cf000-0x7eff619f2000
    #00 0x7eff706fc1d6 -> other
    #01 0x7eff706a2e2e -> other
    #02 0x7eff706a2f2e -> other
    #03 0x7eff707edbd6 -> other
    #04 0x7eff707f563c -> other
    #05 0x7eff7080f2a2 -> other
    #06 0x7eff7080f477 -> other
    #07 0x7eff706a2ad1 -> other
    #08 0x7eff706a2e2e -> other
    #09 0x7eff706a2f2e -> other
    #10 0x7eff70a24446 -> other
    #11 0x7eff707ede80 -> other
    #12 0x7eff619d9e9b -> jit
    {"length": 13, "python_frames": 0, "jit_frames": 1, "other_frames": 12, "jit_backend": "jit"}
    

    Python built without --enable-shared

    Output with JIT disabled (truncated): python_frames=104

    $ PYTHON_JIT=0 LD_LIBRARY_PATH=$PWD ./python script.py
    #00 0x4e9e03 -> python
    #01 0x495fc5 -> python
    (...)
    #101 0x774fb7 -> python
    #102 0x401cef -> python
    #103 0x7f76331675b5 -> other
    #104 0x7f7633167668 -> other
    #105 0x401c25 -> python
    {"length": 106, "python_frames": 104, "jit_frames": 0, "other_frames": 2, "jit_backend": "jit"}
    

    Output with JIT enabled: python_frames=12

    $ PYTHON_JIT=1 LD_LIBRARY_PATH=$PWD ./python script.py
    JIT ranges:
      0x7f5b44c50000-0x7f5b44c73000
    #00 0x4e9e03 -> python
    #01 0x495fc5 -> python
    #02 0x49608d -> python
    #03 0x5cbe18 -> python
    #04 0x5d2f17 -> python
    #05 0x5eb2ae -> python
    #06 0x5eb460 -> python
    #07 0x495cb1 -> python
    #08 0x495fc5 -> python
    #09 0x49608d -> python
    #10 0x7ee49e -> python
    #11 0x5cc0b0 -> python
    #12 0x7f5b44c5ae9b -> jit
    {"length": 13, "python_frames": 12, "jit_frames": 1, "other_frames": 0, "jit_backend": "jit"}
    
  5. added 2 commits that reference this issue on Mar 4, 2026
  6. vstinner commented on Mar 4, 2026

    Member

    I wrote #145499 to fix this issue.

  7. added a commit that references this issue on Mar 4, 2026
  8. vstinner commented on Mar 4, 2026

    Member

    Fixed by the change a003923. Thanks for your bug report @befeleme.

  9. ferdnyc commented on Mar 10, 2026

    Contributor

    Unfortunately, even after #145499 I'm seeing test_frame_pointer_unwind segfaults on Fedora 43 x86_64 after building Python using system GCC 15.2.1 (wrapped with automatic ccache), in an out-of-tree builddir (in case that's significant) configured with --enable-shared. Exact commands used:

    mkdir _build
    cd _build
    ../configure --prefix=$(pwd)/dist --enable-shared
    make -j8
    make test -j8

    Output for failing test:

    0:00:54 load avg: 5.11 [ 81/501/1] test_frame_pointer_unwind worker non-zero exit code (Exit code -11 (SIGSEGV))
    test_manual_unwind_respects_frame_pointers (test.test_frame_pointer_unwind.FramePointerUnwindTests.test_manual_unwind_respects_frame_pointers) ... Fatal Python error: Segmentation fault
    
    Current thread 0x00007f52c3cfdbc0 [python] (most recent call first):
      File "/home/ferd/devel/cpython/Lib/test/test_frame_pointer_unwind.py", line 161 in setUp
      File "/home/ferd/devel/cpython/Lib/unittest/case.py", line 610 in _callSetUp
      File "/home/ferd/devel/cpython/Lib/unittest/case.py", line 663 in run
      File "/home/ferd/devel/cpython/Lib/unittest/case.py", line 723 in __call__
      File "/home/ferd/devel/cpython/Lib/unittest/suite.py", line 122 in run
      File "/home/ferd/devel/cpython/Lib/unittest/suite.py", line 84 in __call__
      File "/home/ferd/devel/cpython/Lib/unittest/suite.py", line 122 in run
      File "/home/ferd/devel/cpython/Lib/unittest/suite.py", line 84 in __call__
      File "/home/ferd/devel/cpython/Lib/unittest/runner.py", line 257 in run
      File "/home/ferd/devel/cpython/Lib/test/libregrtest/single.py", line 84 in _run_suite
      File "/home/ferd/devel/cpython/Lib/test/libregrtest/single.py", line 42 in run_unittest
      File "/home/ferd/devel/cpython/Lib/test/libregrtest/single.py", line 162 in test_func
      File "/home/ferd/devel/cpython/Lib/test/libregrtest/single.py", line 118 in regrtest_runner
      File "/home/ferd/devel/cpython/Lib/test/libregrtest/single.py", line 165 in _load_run_test
      File "/home/ferd/devel/cpython/Lib/test/libregrtest/single.py", line 210 in _runtest_env_changed_exc
      File "/home/ferd/devel/cpython/Lib/test/libregrtest/single.py", line 319 in _runtest
      File "/home/ferd/devel/cpython/Lib/test/libregrtest/single.py", line 348 in run_single_test
      File "/home/ferd/devel/cpython/Lib/test/libregrtest/worker.py", line 99 in worker_process
      File "/home/ferd/devel/cpython/Lib/test/libregrtest/worker.py", line 134 in main
      File "/home/ferd/devel/cpython/Lib/test/libregrtest/worker.py", line 138 in <module>
      File "<frozen runpy>", line 87 in _run_code
      File "<frozen runpy>", line 196 in _run_module_as_main
    
    Current thread's C stack trace (most recent call first):
      Binary file "/home/ferd/devel/cpython/_build/libpython3.15.so.1.0", at _Py_DumpStack+0x2e [0x7f52c38810fe]
      Binary file "/home/ferd/devel/cpython/_build/libpython3.15.so.1.0", at +0x29d5cc [0x7f52c389d5cc]
      Binary file "/lib64/libc.so.6", at +0x1a290 [0x7f52c32e3290]
      Binary file "/home/ferd/devel/cpython/_build/build/lib.linux-x86_64-3.15/_testinternalcapi.cpython-315-x86_64-linux-gnu.so", at +0x4b02 [0x7f52b41d1b02]
      Binary file "/home/ferd/devel/cpython/_build/libpython3.15.so.1.0", at PyObject_Vectorcall+0x56 [0x7f52c36675f6]
      Binary file "/home/ferd/devel/cpython/_build/libpython3.15.so.1.0", at _Py_VectorCallInstrumentation_StackRefSteal+0x76 [0x7f52c37d87b6]
      Binary file "/home/ferd/devel/cpython/_build/libpython3.15.so.1.0", at _PyEval_EvalFrameDefault+0x4cae [0x7f52c37e2e8e]
      Binary file "/home/ferd/devel/cpython/_build/libpython3.15.so.1.0", at +0x1ec544 [0x7f52c37ec544]
      Binary file "/home/ferd/devel/cpython/_build/libpython3.15.so.1.0", at +0x6aec8 [0x7f52c366aec8]
      Binary file "/home/ferd/devel/cpython/_build/libpython3.15.so.1.0", at _PyEval_EvalFrameDefault+0x63f4 [0x7f52c37e45d4]
      Binary file "/home/ferd/devel/cpython/_build/libpython3.15.so.1.0", at +0x1ec544 [0x7f52c37ec544]
      Binary file "/home/ferd/devel/cpython/_build/libpython3.15.so.1.0", at +0x68e23 [0x7f52c3668e23]
      Binary file "/home/ferd/devel/cpython/_build/libpython3.15.so.1.0", at +0x69025 [0x7f52c3669025]
      Binary file "/home/ferd/devel/cpython/_build/libpython3.15.so.1.0", at +0x11e649 [0x7f52c371e649]
      Binary file "/home/ferd/devel/cpython/_build/libpython3.15.so.1.0", at _PyObject_MakeTpCall+0xbc [0x7f52c366739c]
      Binary file "/home/ferd/devel/cpython/_build/libpython3.15.so.1.0", at _Py_VectorCall_StackRefSteal+0x5f [0x7f52c37d866f]
      Binary file "/home/ferd/devel/cpython/_build/libpython3.15.so.1.0", at _PyEval_EvalFrameDefault+0x58bf [0x7f52c37e3a9f]
      Binary file "/home/ferd/devel/cpython/_build/libpython3.15.so.1.0", at +0x1ec544 [0x7f52c37ec544]
      Binary file "/home/ferd/devel/cpython/_build/libpython3.15.so.1.0", at +0x6aec8 [0x7f52c366aec8]
      Binary file "/home/ferd/devel/cpython/_build/libpython3.15.so.1.0", at _PyEval_EvalFrameDefault+0x6768 [0x7f52c37e4948]
      Binary file "/home/ferd/devel/cpython/_build/libpython3.15.so.1.0", at +0x1ec544 [0x7f52c37ec544]
      Binary file "/home/ferd/devel/cpython/_build/libpython3.15.so.1.0", at +0x68e23 [0x7f52c3668e23]
      Binary file "/home/ferd/devel/cpython/_build/libpython3.15.so.1.0", at +0x69025 [0x7f52c3669025]
      Binary file "/home/ferd/devel/cpython/_build/libpython3.15.so.1.0", at +0x11e649 [0x7f52c371e649]
      Binary file "/home/ferd/devel/cpython/_build/libpython3.15.so.1.0", at _PyObject_MakeTpCall+0xbc [0x7f52c366739c]
      Binary file "/home/ferd/devel/cpython/_build/libpython3.15.so.1.0", at _Py_VectorCallInstrumentation_StackRefSteal+0x76 [0x7f52c37d87b6]
      Binary file "/home/ferd/devel/cpython/_build/libpython3.15.so.1.0", at _PyEval_EvalFrameDefault+0x4cae [0x7f52c37e2e8e]
      Binary file "/home/ferd/devel/cpython/_build/libpython3.15.so.1.0", at +0x1ec544 [0x7f52c37ec544]
      Binary file "/home/ferd/devel/cpython/_build/libpython3.15.so.1.0", at +0x6aec8 [0x7f52c366aec8]
      Binary file "/home/ferd/devel/cpython/_build/libpython3.15.so.1.0", at _PyEval_EvalFrameDefault+0x63f4 [0x7f52c37e45d4]
      Binary file "/home/ferd/devel/cpython/_build/libpython3.15.so.1.0", at +0x1ec544 [0x7f52c37ec544]
      Binary file "/home/ferd/devel/cpython/_build/libpython3.15.so.1.0", at +0x68e23 [0x7f52c3668e23]
      <truncated rest of calls>
    
    Extension modules: _testinternalcapi (total: 1)
    
  10. hroncok commented on Mar 10, 2026

    Contributor

    I was about to say that 3.15.0a7 indeed fixed this for us. Will try on Fedora 43 as well.

  11. ferdnyc commented on Mar 10, 2026

    Contributor

    Running the individual test through gdb, the segfault seems to happen in the new _testinternalcapi.c function manual_unwind_from_fp, when it gets passed a very suspicious frame_pointer value:

    $ LD_LIBRARY_PATH=/home/ferd/devel/cpython/_build gdb ./python
    (gdb) run /home/ferd/devel/cpython/Lib/test/test_frame_pointer_unwind.py
    Starting program: /home/ferd/devel/cpython/_build/python /home/ferd/devel/cpython/Lib/test/test_frame_pointer_unwind.py
    [Thread debugging using libthread_db enabled]
    Using host libthread_db library "/lib64/libthread_db.so.1".
    
    Program received signal SIGSEGV, Segmentation fault.
    manual_unwind_from_fp (frame_pointer=0x8000000000000000)
        at ../Modules/_testinternalcapi.c:355
    355	        PyObject *addr_obj = PyLong_FromUnsignedLongLong(return_addr);

    (return_addr is set to frame_pointer[1] a few lines earlier, but given that it appears to be no sort of pointer..)

    Here's the start of the backtrace, up to the point it gets ugly and redundant. Not that it's very useful with the arguments to manual_frame_pointer_unwind optimized out:

    (gdb) bt
    #0  manual_unwind_from_fp (frame_pointer=0x8000000000000000)
        at ../Modules/_testinternalcapi.c:355
    #1  manual_frame_pointer_unwind (self=<optimized out>, args=<optimized out>)
        at ../Modules/_testinternalcapi.c:393
    #2  0x00007ffff78675f6 in _PyObject_VectorcallTstate (
        tstate=0x7ffff7e4f2f0 <_PyRuntime+344624>, 
        callable=<built-in method manual_frame_pointer_unwind of module object at remote 0x7fffe8f1b1c0>, args=0x7fffffffb768, nargsf=9223372036854775808, 
        kwnames=0x0) at ../Include/internal/pycore_call.h:136
    #3  PyObject_Vectorcall (
        callable=callable@entry=<built-in method manual_frame_pointer_unwind of module object at remote 0x7fffe8f1b1c0>, args=args@entry=0x7fffffffb768, 
        nargsf=9223372036854775808, kwnames=0x0) at ../Objects/call.c:327

    (Is nargsf supposed to be an argument count? Because if so, seems like something is already way wrong.)

  12. ferdnyc commented on Mar 10, 2026

    Contributor

    I'm running on x86_64, as I said, building without any omit-frame-pointer flags in the CFLAGS. As a result, when the test's setUp method runs _frame_pointers_expected("x86_64"), it gets back False, as expected. (Confirmed by manually defining and executing the function in the REPL.)

    It then executes this:

    try:
        _testinternalcapi.manual_frame_pointer_unwind()
    except RuntimeError as exc:
        if "not supported" in str(exc):
            self.skipTest("manual frame pointer unwinding not supported on this platform")
            raise

    ...Which is where it segfaults.

    I assume if I was building with -fno-omit-frame-pointer (like the Fedora official builds are, according to @befeleme's OP) then it wouldn't be an issue, but my build doesn't have that compile flag set.

  13. ferdnyc commented on Mar 11, 2026

    Contributor

    Huh. Stepping through with gdb, I'm inside a manual_unwind_from_fp() call that was passed a valid ("valid-looking") frame_pointer=0x7fffffffb6f0. But here's what I get if I pick that value apart roughly the way the code does:

    (gdb) print frame_pointer
    $50 = (uintptr_t *) 0x7fffffffb6f0
    (gdb) print (uintptr_t*[])frame_pointer[1]
    $49 = {0x7ffff78675f6 <PyObject_Vectorcall+86>}
    (gdb) print (uintptr_t*[])frame_pointer[0]
    $48 = {0x8000000000000000}

    So, that's where the crazy-looking frame_pointer=0x8000000000000000 is coming from; it's when the code gets to the second iteration of this loop, because next_fp is apparently neither NULL, nor less than min_frame_pointer_addr, nor a valid frame pointer...

    Methinks something is not the size/shape we think it is. (The return type from __builtin_frame_address() is void*, after all.)

    for (Py_ssize_t depth = 0;
    depth < max_depth && frame_pointer != NULL;
    depth++)
    {
    uintptr_t fp_addr = (uintptr_t)frame_pointer;
    if ((fp_addr % sizeof(uintptr_t)) != 0) {
    break;
    }
    uintptr_t return_addr = frame_pointer[1];
    PyObject *addr_obj = PyLong_FromUnsignedLongLong(return_addr);
    if (addr_obj == NULL) {
    Py_DECREF(result);
    return NULL;
    }
    if (PyList_Append(result, addr_obj) < 0) {
    Py_DECREF(addr_obj);
    Py_DECREF(result);
    return NULL;
    }
    Py_DECREF(addr_obj);
    uintptr_t *next_fp = (uintptr_t *)frame_pointer[0];
    // Stop if the frame pointer is extremely low.
    if ((uintptr_t)next_fp < min_frame_pointer_addr) {
    break;
    }
    uintptr_t next_addr = (uintptr_t)next_fp;
    if (stack_grows_down) {
    if (next_addr <= fp_addr) {
    break;
    }
    }
    else {
    if (next_addr >= fp_addr) {
    break;
    }
    }
    frame_pointer = next_fp;
    }

  14. vstinner commented on Mar 11, 2026

    Member

    Please open a new issue for your crash.

  15. vstinner commented on Mar 11, 2026

    Member

    I was about to say that 3.15.0a7 indeed fixed this for us. Will try on Fedora 43 as well.

    Thanks for the confirmation, I close the issue.

  16. mcepl commented on Apr 8, 2026

    Contributor

    What’s the relationship between this and #126910 ?

  17. vstinner commented on Apr 8, 2026

    Member

    What’s the relationship between this and #126910 ?

    This issue is about a failure of test_frame_pointer_unwind.

    test_frame_pointer_unwind, _testinernalcapi.manual_frame_pointer_unwind() and _testinternalcapi.classify_stack_addresses() were added by the issue GH-126910 (commit 66055d0).

  18. added a commit that references this issue on Apr 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    testsTests in the Lib/test dirtopic-JITtype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions


      Back | FazBrowse Home | New Git URL