Skip to content

[3.15] gh-157605: Accept empty native-thread stacks when sampling - #161784

Merged
pablogsal merged 1 commit into
python:3.15from
miss-islington:backport-80f9aa0-3.15
Nov 20, 2026
Merged

pablogsal merged 1 commit into
python:3.15from
miss-islington:backport-80f9aa0-3.15

Conversation

@miss-islington

@miss-islington miss-islington commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Accept empty native-thread stacks when sampling instead of raising an error. Distinguish interpreter-owned C frames from cleared Python frames so frame cleanup cannot produce a false marker.
(cherry picked from commit 80f9aa0)

Co-authored-by: Pablo Galindo Salgado Pablogsal@gmail.com

@vstinner

Copy link
Copy Markdown
Member

The test in main was flaky, it has been fixed by eeafc73 and then 921de8f. If you consider backporting the change to 3.15 (this PR), please backport also these two fixes.

@vstinner

Copy link
Copy Markdown
Member

@pablogsal: The PR now has merge conflicts. Do you still consider backporting this change to 3.15?

@pablogsal

Copy link
Copy Markdown
Member

Yes will rebase and land

@pablogsal

Copy link
Copy Markdown
Member

Thanks for the ping! 🖤

Accept empty native-thread stacks when sampling instead of raising an error. Distinguish interpreter-owned C frames from cleared Python frames so frame cleanup cannot produce a false <native> marker.
(cherry picked from commit 80f9aa0)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
Co-authored-by: Tan Long <tanloong@foxmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
@pablogsal
pablogsal force-pushed the backport-80f9aa0-3.15 branch from 911a395 to ac9e996 Compare November 20, 2026 13:31
@pablogsal
pablogsal merged commit 35710a5 into python:3.15 Nov 20, 2026
97 of 99 checks passed
@miss-islington
miss-islington deleted the backport-80f9aa0-3.15 branch November 20, 2026 14:50
@bedevere-bot

Copy link
Copy Markdown

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot ARM64 macOS 3.15 (tier-1) has failed when building commit 35710a5.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/#/builders/2118/builds/931) and take a look at the build logs.
  4. Check if the failure is related to this commit (35710a5) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/#/builders/2118/builds/931

Failed tests:

  • <regrtest
  • worker>

Summary of the results of the build (if available):

==

Click to see traceback logs
Traceback (most recent call last):
Warning --   File "/Users/buildbot/buildarea/3.15.pablogsal-macos-m1.macos-with-brew/build/Lib/test/libregrtest/run_workers.py", line 410, in run
Warning --     mp_result = self._runtest(test_name)
Warning --   File "/Users/buildbot/buildarea/3.15.pablogsal-macos-m1.macos-with-brew/build/Lib/test/libregrtest/run_workers.py", line 364, in _runtest
Warning --     stdout_file = self.create_stdout(stack)
Warning --   File "/Users/buildbot/buildarea/3.15.pablogsal-macos-m1.macos-with-brew/build/Lib/test/libregrtest/run_workers.py", line 247, in create_stdout
Warning --     stdout_file = tempfile.TemporaryFile('w+',
Warning --                                          encoding=encoding,
Warning --                                          errors='backslashreplace')
Warning --   File "/Users/buildbot/buildarea/3.15.pablogsal-macos-m1.macos-with-brew/build/Lib/tempfile.py", line 752, in TemporaryFile
Warning --     file = _io.open(dir, mode, buffering=buffering,
Warning --                     newline=newline, encoding=encoding, errors=errors,
Warning --                     opener=opener)
Warning --   File "/Users/buildbot/buildarea/3.15.pablogsal-macos-m1.macos-with-brew/build/Lib/tempfile.py", line 745, in opener
Warning --     fd, name = _mkstemp_inner(dir, prefix, suffix, flags, output_type)
Warning --                ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Warning --   File "/Users/buildbot/buildarea/3.15.pablogsal-macos-m1.macos-with-brew/build/Lib/tempfile.py", line 256, in _mkstemp_inner
Warning --     fd = _os.open(file, flags, 0o600)
Warning -- OSError: [Errno 28] No space left on device: '/var/folders/39/qz2m3x352hd7djhs80p6vf7c0000gp/T/tmpvei_4osj'


Traceback (most recent call last):
  File "/Users/buildbot/buildarea/3.15.pablogsal-macos-m1.macos-with-brew/build/Lib/test/libregrtest/single.py", line 212, in _runtest_env_changed_exc
    _load_run_test(result, runtests)
    ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
  File "/Users/buildbot/buildarea/3.15.pablogsal-macos-m1.macos-with-brew/build/Lib/test/libregrtest/single.py", line 165, in _load_run_test
    regrtest_runner(result, test_func, runtests)
    ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/buildbot/buildarea/3.15.pablogsal-macos-m1.macos-with-brew/build/Lib/test/libregrtest/single.py", line 118, in regrtest_runner
    test_result = test_func()
  File "/Users/buildbot/buildarea/3.15.pablogsal-macos-m1.macos-with-brew/build/Lib/test/libregrtest/single.py", line 162, in test_func
    return run_unittest(test_mod, runtests)
  File "/Users/buildbot/buildarea/3.15.pablogsal-macos-m1.macos-with-brew/build/Lib/test/libregrtest/single.py", line 42, in run_unittest
    return _run_suite(tests)
  File "/Users/buildbot/buildarea/3.15.pablogsal-macos-m1.macos-with-brew/build/Lib/test/libregrtest/single.py", line 84, in _run_suite
    result = runner.run(suite)
  File "/Users/buildbot/buildarea/3.15.pablogsal-macos-m1.macos-with-brew/build/Lib/unittest/runner.py", line 256, in run
    test(result)
    ~~~~^^^^^^^^
  File "/Users/buildbot/buildarea/3.15.pablogsal-macos-m1.macos-with-brew/build/Lib/unittest/suite.py", line 84, in __call__
    return self.run(*args, **kwds)
           ~~~~~~~~^^^^^^^^^^^^^^^
  File "/Users/buildbot/buildarea/3.15.pablogsal-macos-m1.macos-with-brew/build/Lib/unittest/suite.py", line 122, in run
    test(result)
    ~~~~^^^^^^^^
  File "/Users/buildbot/buildarea/3.15.pablogsal-macos-m1.macos-with-brew/build/Lib/unittest/suite.py", line 84, in __call__
    return self.run(*args, **kwds)
           ~~~~~~~~^^^^^^^^^^^^^^^
  File "/Users/buildbot/buildarea/3.15.pablogsal-macos-m1.macos-with-brew/build/Lib/unittest/suite.py", line 122, in run
    test(result)
    ~~~~^^^^^^^^
  File "/Users/buildbot/buildarea/3.15.pablogsal-macos-m1.macos-with-brew/build/Lib/unittest/case.py", line 747, in __call__
    return self.run(*args, **kwds)
           ~~~~~~~~^^^^^^^^^^^^^^^
  File "/Users/buildbot/buildarea/3.15.pablogsal-macos-m1.macos-with-brew/build/Lib/unittest/case.py", line 690, in run
    with outcome.testPartExecutor(self):
         ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
  File "/Users/buildbot/buildarea/3.15.pablogsal-macos-m1.macos-with-brew/build/Lib/contextlib.py", line 224, in __exit__
    self.gen.throw(value)
    ~~~~~~~~~~~~~~^^^^^^^
  File "/Users/buildbot/buildarea/3.15.pablogsal-macos-m1.macos-with-brew/build/Lib/unittest/case.py", line 75, in testPartExecutor
    _addError(self.result, test_case, exc_info)
    ~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/buildbot/buildarea/3.15.pablogsal-macos-m1.macos-with-brew/build/Lib/unittest/case.py", line 100, in _addError
    result.addError(test, exc_info)
    ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^
  File "/Users/buildbot/buildarea/3.15.pablogsal-macos-m1.macos-with-brew/build/Lib/test/libregrtest/testresult.py", line 109, in addError
    super().addError(test, err)
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^
  File "/Users/buildbot/buildarea/3.15.pablogsal-macos-m1.macos-with-brew/build/Lib/unittest/runner.py", line 108, in addError
    self._write_status(test, f"{t.fail}ERROR{t.reset}")
    ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/buildbot/buildarea/3.15.pablogsal-macos-m1.macos-with-brew/build/Lib/unittest/runner.py", line 75, in _write_status
    self.stream.writeln(status)
    ~~~~~~~~~~~~~~~~~~~^^^^^^^^
  File "/Users/buildbot/buildarea/3.15.pablogsal-macos-m1.macos-with-brew/build/Lib/unittest/runner.py", line 27, in writeln
    self.write(arg)
    ~~~~~~~~~~^^^^^
OSError: [Errno 28] No space left on device


Traceback (most recent call last):
  File "/Users/buildbot/buildarea/3.15.pablogsal-macos-m1.macos-with-brew/build/Lib/unittest/case.py", line 58, in testPartExecutor
    yield
  File "/Users/buildbot/buildarea/3.15.pablogsal-macos-m1.macos-with-brew/build/Lib/unittest/case.py", line 691, in run
    self._callTestMethod(testMethod)
    ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^
  File "/Users/buildbot/buildarea/3.15.pablogsal-macos-m1.macos-with-brew/build/Lib/unittest/case.py", line 637, in _callTestMethod
    result = method()
  File "/Users/buildbot/buildarea/3.15.pablogsal-macos-m1.macos-with-brew/build/Lib/test/test_embed.py", line 1795, in test_init_pyvenv_cfg
    tempfile.TemporaryDirectory() as pyvenv_home:
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/Users/buildbot/buildarea/3.15.pablogsal-macos-m1.macos-with-brew/build/Lib/tempfile.py", line 961, in __init__
    self.name = mkdtemp(suffix, prefix, dir)
                ~~~~~~~^^^^^^^^^^^^^^^^^^^^^
  File "/Users/buildbot/buildarea/3.15.pablogsal-macos-m1.macos-with-brew/build/Lib/tempfile.py", line 435, in mkdtemp
    _os.mkdir(file, 0o700)
    ~~~~~~~~~^^^^^^^^^^^^^
OSError: [Errno 28] No space left on device: '/var/folders/39/qz2m3x352hd7djhs80p6vf7c0000gp/T/test_python_4u2o_y84/tmp1buvmbtb'


Traceback (most recent call last):
Warning --   File "/Users/buildbot/buildarea/3.15.pablogsal-macos-m1.macos-with-brew/build/Lib/test/libregrtest/run_workers.py", line 410, in run
Warning --     mp_result = self._runtest(test_name)
Warning --   File "/Users/buildbot/buildarea/3.15.pablogsal-macos-m1.macos-with-brew/build/Lib/test/libregrtest/run_workers.py", line 364, in _runtest
Warning --     stdout_file = self.create_stdout(stack)
Warning --   File "/Users/buildbot/buildarea/3.15.pablogsal-macos-m1.macos-with-brew/build/Lib/test/libregrtest/run_workers.py", line 247, in create_stdout
Warning --     stdout_file = tempfile.TemporaryFile('w+',
Warning --                                          encoding=encoding,
Warning --                                          errors='backslashreplace')
Warning --   File "/Users/buildbot/buildarea/3.15.pablogsal-macos-m1.macos-with-brew/build/Lib/tempfile.py", line 752, in TemporaryFile
Warning --     file = _io.open(dir, mode, buffering=buffering,
Warning --                     newline=newline, encoding=encoding, errors=errors,
Warning --                     opener=opener)
Warning --   File "/Users/buildbot/buildarea/3.15.pablogsal-macos-m1.macos-with-brew/build/Lib/tempfile.py", line 745, in opener
Warning --     fd, name = _mkstemp_inner(dir, prefix, suffix, flags, output_type)
Warning --                ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Warning --   File "/Users/buildbot/buildarea/3.15.pablogsal-macos-m1.macos-with-brew/build/Lib/tempfile.py", line 256, in _mkstemp_inner
Warning --     fd = _os.open(file, flags, 0o600)
Warning -- OSError: [Errno 28] No space left on device: '/var/folders/39/qz2m3x352hd7djhs80p6vf7c0000gp/T/tmphfqdg5ka'
Kill <WorkerThread #1 running test=test_calendar pid=38809 time=813 ms> process group
Warning -- sys.stdout was modified by test_unittest
Kill <WorkerThread #2 running test=test.test_multiprocessing_forkserver.test_misc pid=38443 time=20.1 sec> process group
Kill <WorkerThread #3 running test=test_peg_generator pid=38705 time=9.6 sec> process group

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants