Skip to content

3.15.0b2, openSUSE/Factory, i586: failing test: test_c_stack_unwind (specifically test_manual_unwind_finds_expected_frames) #151602

Open

Description

@mcepl

Bug report

Bug description:

As a followup to #151040 I am creating this separate ticket for i586. The traceback is exactly the same:

[ 3208s]   test_manual_unwind_finds_expected_frames (test.test_c_stack_unwind.ManualStackUnwindTests.test_manual_unwind_finds_expected_frames) (env={'PYTHON_JIT': '0'}) ... FAIL
[ 3208s] 
[ 3208s] ======================================================================
[ 3208s] FAIL: test_manual_unwind_finds_expected_frames (test.test_c_stack_unwind.ManualStackUnwindTests.test_manual_unwind_finds_expected_frames) (env={'PYTHON_JIT': '0'})
[ 3208s] ----------------------------------------------------------------------
[ 3208s] Traceback (most recent call last):
[ 3208s]   File "/home/abuild/rpmbuild/BUILD/python315-3.15.0_b2-build/Python-3.15.0b2/Lib/test/test_c_stack_unwind.py", line 285, in test_manual_unwind_finds_expected_frames
[ 3208s]     self.assertGreaterEqual(
[ 3208s]     ~~~~~~~~~~~~~~~~~~~~~~~^
[ 3208s]         python_frames,
[ 3208s]         ^^^^^^^^^^^^^^
[ 3208s]         STACK_DEPTH,
[ 3208s]         ^^^^^^^^^^^^
[ 3208s]         f"expected to find Python frames on {self.machine} with env {env}",
[ 3208s]         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[ 3208s]     )
[ 3208s]     ^
[ 3208s] AssertionError: 1 not greater than or equal to 10 : expected to find Python frames on i686 with env {'PYTHON_JIT': '0'}
[ 3208s] 
[ 3208s] ----------------------------------------------------------------------
[ 3208s] Ran 1 test in 0.276s
[ 3208s] 
[ 3208s] FAILED (failures=1)

Build log shows all used packages and steps required to be taken. The repository with the package source is https://src.opensuse.org/python-interpreters/python315

@vstinner on the other ticket commented:

That's a different architecture. If you care, you should open a separated issue for i586. You pass explicitly -fomit-frame-pointer which goes against PEP 831 (approved in Python 3.15).

Yes, we have -fomit-frame-pointer specifically for i586 architecture.

CPython versions tested on:

3.15

Operating systems tested on:

Linux

Activity

  1. added
    type-bugAn unexpected behavior, bug, or error
    on Jun 17, 2026
  2. vstinner commented on Jun 17, 2026

    @vstinner
    Member

    The test checks:

        if "no-omit-frame-pointer" in cflags:
            # For example, configure adds -fno-omit-frame-pointer by default on
            # supported GCC-compatible builds.
            return True
        if "omit-frame-pointer" in cflags:
            return False

    It checks for -fno-omit-frame-pointer first, even if -fomit-frame-pointer is defined after. Instead, we should check for flags in order and remembers the last option. See for example:

    def python_is_optimized():
        """Find if Python was built with optimizations."""
        cflags = sysconfig.get_config_var('PY_CFLAGS') or ''
        final_opt = ""
        for opt in cflags.split():
            if opt.startswith('-O'):
                final_opt = opt
        if sysconfig.get_config_var("CC") == "gcc":
            non_opts = ('', '-O0', '-Og')
        else:
            non_opts = ('', '-O0')
        return final_opt not in non_opts
  3. vstinner commented on Jun 17, 2026

    @vstinner
    Member

    Yes, we have -fomit-frame-pointer specifically for i586 architecture.

    You don't want to implement PEP 831? Is there a reason to not implement it?

  4. mcepl commented on Jun 17, 2026

    @mcepl
    ContributorAuthor

    Our GCC people persuaded me that we omit frame pointers only on archs like i586 for a reason, so in the end I added to ./configure command for 3.15 only

    %ifarch &ix86
        --without-frame-pointers \
    %endif

    I don’t think we care that much about the maximum performance and profiling on those architectures. We’ll see how it ends up working.

    Perhaps what this ticket can stand for in the end is that in this situation a user would get some better error/warning message, but &ix86 architectures are probably so inconsequential that it doesn’t matter that much.

  5. vstinner commented on Jun 18, 2026

    @vstinner
    Member

    Oh. I forgot that _Py_WITH_FRAME_POINTERS macro was added recently to pyconfig.h. It's set to 1 by default.

    Can you test setting _Py_WITH_FRAME_POINTERS to 0 in pyconfig.h to see if it does fix test_c_stack_unwind?

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 dirtype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions