Skip to content

posix_spawn and posix_spawnp tests failing on NetBSD with stack limit assertions #131624

Closed
@furkanonder

Description

@furkanonder

Bug report

Bug description:

Multiple tests in test_posix for posix_spawn and posix_spawnp functionality are failing on NetBSD with stack limit-related assertions in the spawned processes. All failing tests show child processes exiting with code -6 (SIGABRT).

Environment

CPython version: 3.14.0a6+ (heads/main:557d2d20d48, Mar 23 2025)
Platform: NetBSD-10.0-amd64-x86_64-64bit-ELF little-endian
Build Flags: --with-debug

Tests

./python -m test test_posix -m TestPosixSpawn -m TestPosixSpawnP -v

Output:

─./python -m test test_posix -m TestPosixSpawn -m TestPosixSpawnP -v                                                                                                                                  
== CPython 3.14.0a6+ (heads/main:557d2d20d48, Mar 23 2025, 15:29:59) [GCC 10.5.0]
== NetBSD-10.0-amd64-x86_64-64bit-ELF little-endian
== Python build: debug
== cwd: /home/blue/cpython/build/test_python_worker_362æ
== CPU count: 16
== encodings: locale=UTF-8 FS=utf-8
== resources: all test resources are disabled, use -u option to unskip tests

Using random seed: 1713724710
0:00:00 load avg: 0.17 Run 1 test sequentially in a single process
0:00:00 load avg: 0.17 [1/1] test_posix
test_bad_file_actions (test.test_posix.TestPosixSpawn.test_bad_file_actions) ... ok
test_close_file (test.test_posix.TestPosixSpawn.test_close_file) ... assertion "here_addr < _tstate->c_stack_top" failed: file "Python/ceval.c", line 468, function "_Py_InitializeRecursionLimits"
FAIL
test_dup2 (test.test_posix.TestPosixSpawn.test_dup2) ... ok
test_empty_file_actions (test.test_posix.TestPosixSpawn.test_empty_file_actions) ... ok
test_multiple_file_actions (test.test_posix.TestPosixSpawn.test_multiple_file_actions) ... assertion "here_addr < _tstate->c_stack_top" failed: file "Python/ceval.c", line 468, function "_Py_InitializeRecursionLimits"
FAIL
test_no_such_executable (test.test_posix.TestPosixSpawn.test_no_such_executable) ... ok
test_none_file_actions (test.test_posix.TestPosixSpawn.test_none_file_actions) ... ok
test_open_file (test.test_posix.TestPosixSpawn.test_open_file) ... assertion "here_addr < _tstate->c_stack_top" failed: file "Python/ceval.c", line 468, function "_Py_InitializeRecursionLimits"
FAIL
test_resetids (test.test_posix.TestPosixSpawn.test_resetids) ... assertion "here_addr < _tstate->c_stack_top" failed: file "Python/ceval.c", line 468, function "_Py_InitializeRecursionLimits"
FAIL
test_resetids_explicit_default (test.test_posix.TestPosixSpawn.test_resetids_explicit_default) ... assertion "here_addr < _tstate->c_stack_top" failed: file "Python/ceval.c", line 468, function "_Py_InitializeRecursionLimits"
FAIL
test_returns_pid (test.test_posix.TestPosixSpawn.test_returns_pid) ... assertion "here_addr < _tstate->c_stack_top" failed: file "Python/ceval.c", line 468, function "_Py_InitializeRecursionLimits"
FAIL
test_setpgroup (test.test_posix.TestPosixSpawn.test_setpgroup) ... assertion "here_addr < _tstate->c_stack_top" failed: file "Python/ceval.c", line 468, function "_Py_InitializeRecursionLimits"
FAIL
test_setpgroup_wrong_type (test.test_posix.TestPosixSpawn.test_setpgroup_wrong_type) ... ok
test_setscheduler_only_param (test.test_posix.TestPosixSpawn.test_setscheduler_only_param) ... skipped 'bpo-34685: test can fail on BSD'
test_setscheduler_with_policy (test.test_posix.TestPosixSpawn.test_setscheduler_with_policy) ... skipped 'bpo-34685: test can fail on BSD'
test_setsid (test.test_posix.TestPosixSpawn.test_setsid) ... skipped "setsid is not supported: NotImplementedError('posix_spawn: setsid unavailable on this platform')"
test_setsigdef (test.test_posix.TestPosixSpawn.test_setsigdef) ... ok
test_setsigdef_wrong_type (test.test_posix.TestPosixSpawn.test_setsigdef_wrong_type) ... ok
test_setsigmask (test.test_posix.TestPosixSpawn.test_setsigmask) ... assertion "here_addr < _tstate->c_stack_top" failed: file "Python/ceval.c", line 468, function "_Py_InitializeRecursionLimits"
FAIL
test_setsigmask_wrong_type (test.test_posix.TestPosixSpawn.test_setsigmask_wrong_type) ... ok
test_specify_environment (test.test_posix.TestPosixSpawn.test_specify_environment) ... assertion "here_addr < _tstate->c_stack_top" failed: file "Python/ceval.c", line 468, function "_Py_InitializeRecursionLimits"
FAIL
test_bad_file_actions (test.test_posix.TestPosixSpawnP.test_bad_file_actions) ... ok
test_close_file (test.test_posix.TestPosixSpawnP.test_close_file) ... assertion "here_addr < _tstate->c_stack_top" failed: file "Python/ceval.c", line 468, function "_Py_InitializeRecursionLimits"
FAIL
test_dup2 (test.test_posix.TestPosixSpawnP.test_dup2) ... assertion "here_addr < _tstate->c_stack_top" failed: file "Python/ceval.c", line 468, function "_Py_InitializeRecursionLimits"
FAIL
test_empty_file_actions (test.test_posix.TestPosixSpawnP.test_empty_file_actions) ... assertion "here_addr < _tstate->c_stack_top" failed: file "Python/ceval.c", line 468, function "_Py_InitializeRecursionLimits"
FAIL
test_multiple_file_actions (test.test_posix.TestPosixSpawnP.test_multiple_file_actions) ... assertion "here_addr < _tstate->c_stack_top" failed: file "Python/ceval.c", line 468, function "_Py_InitializeRecursionLimits"
FAIL
test_no_such_executable (test.test_posix.TestPosixSpawnP.test_no_such_executable) ... ok
test_none_file_actions (test.test_posix.TestPosixSpawnP.test_none_file_actions) ... assertion "here_addr < _tstate->c_stack_top" failed: file "Python/ceval.c", line 468, function "_Py_InitializeRecursionLimits"
FAIL
test_open_file (test.test_posix.TestPosixSpawnP.test_open_file) ... assertion "here_addr < _tstate->c_stack_top" failed: file "Python/ceval.c", line 468, function "_Py_InitializeRecursionLimits"
FAIL
test_posix_spawnp (test.test_posix.TestPosixSpawnP.test_posix_spawnp) ... ok
test_resetids (test.test_posix.TestPosixSpawnP.test_resetids) ... assertion "_tstate->c_stack_soft_limit < here_addr" failed: file "Python/ceval.c", line 467, function "_Py_InitializeRecursionLimits"
FAIL
test_resetids_explicit_default (test.test_posix.TestPosixSpawnP.test_resetids_explicit_default) ... assertion "_tstate->c_stack_soft_limit < here_addr" failed: file "Python/ceval.c", line 467, function "_Py_InitializeRecursionLimits"
FAIL
test_returns_pid (test.test_posix.TestPosixSpawnP.test_returns_pid) ... assertion "_tstate->c_stack_soft_limit < here_addr" failed: file "Python/ceval.c", line 467, function "_Py_InitializeRecursionLimits"
FAIL
test_setpgroup (test.test_posix.TestPosixSpawnP.test_setpgroup) ... assertion "_tstate->c_stack_soft_limit < here_addr" failed: file "Python/ceval.c", line 467, function "_Py_InitializeRecursionLimits"
FAIL
test_setpgroup_wrong_type (test.test_posix.TestPosixSpawnP.test_setpgroup_wrong_type) ... ok
test_setscheduler_only_param (test.test_posix.TestPosixSpawnP.test_setscheduler_only_param) ... skipped 'bpo-34685: test can fail on BSD'
test_setscheduler_with_policy (test.test_posix.TestPosixSpawnP.test_setscheduler_with_policy) ... skipped 'bpo-34685: test can fail on BSD'
test_setsid (test.test_posix.TestPosixSpawnP.test_setsid) ... skipped "setsid is not supported: NotImplementedError('posix_spawnp: setsid unavailable on this platform')"
test_setsigdef (test.test_posix.TestPosixSpawnP.test_setsigdef) ... assertion "_tstate->c_stack_soft_limit < here_addr" failed: file "Python/ceval.c", line 467, function "_Py_InitializeRecursionLimits"
FAIL
test_setsigdef_wrong_type (test.test_posix.TestPosixSpawnP.test_setsigdef_wrong_type) ... ok
test_setsigmask (test.test_posix.TestPosixSpawnP.test_setsigmask) ... ok
test_setsigmask_wrong_type (test.test_posix.TestPosixSpawnP.test_setsigmask_wrong_type) ... ok
test_specify_environment (test.test_posix.TestPosixSpawnP.test_specify_environment) ... assertion "here_addr < _tstate->c_stack_top" failed: file "Python/ceval.c", line 468, function "_Py_InitializeRecursionLimits"
FAIL

======================================================================
FAIL: test_close_file (test.test_posix.TestPosixSpawn.test_close_file)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/blue/cpython/Lib/test/test_posix.py", line 2087, in test_close_file
    support.wait_process(pid, exitcode=0)
    ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
  File "/home/blue/cpython/Lib/test/support/__init__.py", line 2241, in wait_process
    raise AssertionError(f"process {pid} exited with code {exitcode2}, "
                         f"but exit code {exitcode} is expected")
AssertionError: process 14888 exited with code -6, but exit code 0 is expected

======================================================================
FAIL: test_multiple_file_actions (test.test_posix.TestPosixSpawn.test_multiple_file_actions)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/blue/cpython/Lib/test/test_posix.py", line 2021, in test_multiple_file_actions
    support.wait_process(pid, exitcode=0)
    ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
  File "/home/blue/cpython/Lib/test/support/__init__.py", line 2241, in wait_process
    raise AssertionError(f"process {pid} exited with code {exitcode2}, "
                         f"but exit code {exitcode} is expected")
AssertionError: process 4875 exited with code -6, but exit code 0 is expected

======================================================================
FAIL: test_open_file (test.test_posix.TestPosixSpawn.test_open_file)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/blue/cpython/Lib/test/test_posix.py", line 2068, in test_open_file
    support.wait_process(pid, exitcode=0)
    ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
  File "/home/blue/cpython/Lib/test/support/__init__.py", line 2241, in wait_process
    raise AssertionError(f"process {pid} exited with code {exitcode2}, "
                         f"but exit code {exitcode} is expected")
AssertionError: process 22411 exited with code -6, but exit code 0 is expected

======================================================================
FAIL: test_resetids (test.test_posix.TestPosixSpawn.test_resetids)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/blue/cpython/Lib/test/test_posix.py", line 1860, in test_resetids
    support.wait_process(pid, exitcode=0)
    ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
  File "/home/blue/cpython/Lib/test/support/__init__.py", line 2241, in wait_process
    raise AssertionError(f"process {pid} exited with code {exitcode2}, "
                         f"but exit code {exitcode} is expected")
AssertionError: process 6982 exited with code -6, but exit code 0 is expected

======================================================================
FAIL: test_resetids_explicit_default (test.test_posix.TestPosixSpawn.test_resetids_explicit_default)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/blue/cpython/Lib/test/test_posix.py", line 1851, in test_resetids_explicit_default
    support.wait_process(pid, exitcode=0)
    ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
  File "/home/blue/cpython/Lib/test/support/__init__.py", line 2241, in wait_process
    raise AssertionError(f"process {pid} exited with code {exitcode2}, "
                         f"but exit code {exitcode} is expected")
AssertionError: process 9121 exited with code -6, but exit code 0 is expected

======================================================================
FAIL: test_returns_pid (test.test_posix.TestPosixSpawn.test_returns_pid)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/blue/cpython/Lib/test/test_posix.py", line 1792, in test_returns_pid
    support.wait_process(pid, exitcode=0)
    ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
  File "/home/blue/cpython/Lib/test/support/__init__.py", line 2241, in wait_process
    raise AssertionError(f"process {pid} exited with code {exitcode2}, "
                         f"but exit code {exitcode} is expected")
AssertionError: process 20376 exited with code -6, but exit code 0 is expected

======================================================================
FAIL: test_setpgroup (test.test_posix.TestPosixSpawn.test_setpgroup)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/blue/cpython/Lib/test/test_posix.py", line 1869, in test_setpgroup
    support.wait_process(pid, exitcode=0)
    ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
  File "/home/blue/cpython/Lib/test/support/__init__.py", line 2241, in wait_process
    raise AssertionError(f"process {pid} exited with code {exitcode2}, "
                         f"but exit code {exitcode} is expected")
AssertionError: process 29677 exited with code -6, but exit code 0 is expected

======================================================================
FAIL: test_setsigmask (test.test_posix.TestPosixSpawn.test_setsigmask)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/blue/cpython/Lib/test/test_posix.py", line 1890, in test_setsigmask
    support.wait_process(pid, exitcode=0)
    ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
  File "/home/blue/cpython/Lib/test/support/__init__.py", line 2241, in wait_process
    raise AssertionError(f"process {pid} exited with code {exitcode2}, "
                         f"but exit code {exitcode} is expected")
AssertionError: process 29091 exited with code -6, but exit code 0 is expected

======================================================================
FAIL: test_specify_environment (test.test_posix.TestPosixSpawn.test_specify_environment)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/blue/cpython/Lib/test/test_posix.py", line 1822, in test_specify_environment
    support.wait_process(pid, exitcode=0)
    ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
  File "/home/blue/cpython/Lib/test/support/__init__.py", line 2241, in wait_process
    raise AssertionError(f"process {pid} exited with code {exitcode2}, "
                         f"but exit code {exitcode} is expected")
AssertionError: process 26401 exited with code -6, but exit code 0 is expected

======================================================================
FAIL: test_close_file (test.test_posix.TestPosixSpawnP.test_close_file)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/blue/cpython/Lib/test/test_posix.py", line 2087, in test_close_file
    support.wait_process(pid, exitcode=0)
    ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
  File "/home/blue/cpython/Lib/test/support/__init__.py", line 2241, in wait_process
    raise AssertionError(f"process {pid} exited with code {exitcode2}, "
                         f"but exit code {exitcode} is expected")
AssertionError: process 2519 exited with code -6, but exit code 0 is expected

======================================================================
FAIL: test_dup2 (test.test_posix.TestPosixSpawnP.test_dup2)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/blue/cpython/Lib/test/test_posix.py", line 2105, in test_dup2
    support.wait_process(pid, exitcode=0)
    ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
  File "/home/blue/cpython/Lib/test/support/__init__.py", line 2241, in wait_process
    raise AssertionError(f"process {pid} exited with code {exitcode2}, "
                         f"but exit code {exitcode} is expected")
AssertionError: process 10663 exited with code -6, but exit code 0 is expected

======================================================================
FAIL: test_empty_file_actions (test.test_posix.TestPosixSpawnP.test_empty_file_actions)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/blue/cpython/Lib/test/test_posix.py", line 1842, in test_empty_file_actions
    support.wait_process(pid, exitcode=0)
    ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
  File "/home/blue/cpython/Lib/test/support/__init__.py", line 2241, in wait_process
    raise AssertionError(f"process {pid} exited with code {exitcode2}, "
                         f"but exit code {exitcode} is expected")
AssertionError: process 29538 exited with code -6, but exit code 0 is expected

======================================================================
FAIL: test_multiple_file_actions (test.test_posix.TestPosixSpawnP.test_multiple_file_actions)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/blue/cpython/Lib/test/test_posix.py", line 2021, in test_multiple_file_actions
    support.wait_process(pid, exitcode=0)
    ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
  File "/home/blue/cpython/Lib/test/support/__init__.py", line 2241, in wait_process
    raise AssertionError(f"process {pid} exited with code {exitcode2}, "
                         f"but exit code {exitcode} is expected")
AssertionError: process 13306 exited with code -6, but exit code 0 is expected

======================================================================
FAIL: test_none_file_actions (test.test_posix.TestPosixSpawnP.test_none_file_actions)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/blue/cpython/Lib/test/test_posix.py", line 1833, in test_none_file_actions
    support.wait_process(pid, exitcode=0)
    ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
  File "/home/blue/cpython/Lib/test/support/__init__.py", line 2241, in wait_process
    raise AssertionError(f"process {pid} exited with code {exitcode2}, "
                         f"but exit code {exitcode} is expected")
AssertionError: process 4660 exited with code -6, but exit code 0 is expected

======================================================================
FAIL: test_open_file (test.test_posix.TestPosixSpawnP.test_open_file)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/blue/cpython/Lib/test/test_posix.py", line 2068, in test_open_file
    support.wait_process(pid, exitcode=0)
    ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
  File "/home/blue/cpython/Lib/test/support/__init__.py", line 2241, in wait_process
    raise AssertionError(f"process {pid} exited with code {exitcode2}, "
                         f"but exit code {exitcode} is expected")
AssertionError: process 15283 exited with code -6, but exit code 0 is expected

======================================================================
FAIL: test_resetids (test.test_posix.TestPosixSpawnP.test_resetids)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/blue/cpython/Lib/test/test_posix.py", line 1860, in test_resetids
    support.wait_process(pid, exitcode=0)
    ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
  File "/home/blue/cpython/Lib/test/support/__init__.py", line 2241, in wait_process
    raise AssertionError(f"process {pid} exited with code {exitcode2}, "
                         f"but exit code {exitcode} is expected")
AssertionError: process 27835 exited with code -6, but exit code 0 is expected

======================================================================
FAIL: test_resetids_explicit_default (test.test_posix.TestPosixSpawnP.test_resetids_explicit_default)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/blue/cpython/Lib/test/test_posix.py", line 1851, in test_resetids_explicit_default
    support.wait_process(pid, exitcode=0)
    ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
  File "/home/blue/cpython/Lib/test/support/__init__.py", line 2241, in wait_process
    raise AssertionError(f"process {pid} exited with code {exitcode2}, "
                         f"but exit code {exitcode} is expected")
AssertionError: process 12737 exited with code -6, but exit code 0 is expected

======================================================================
FAIL: test_returns_pid (test.test_posix.TestPosixSpawnP.test_returns_pid)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/blue/cpython/Lib/test/test_posix.py", line 1792, in test_returns_pid
    support.wait_process(pid, exitcode=0)
    ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
  File "/home/blue/cpython/Lib/test/support/__init__.py", line 2241, in wait_process
    raise AssertionError(f"process {pid} exited with code {exitcode2}, "
                         f"but exit code {exitcode} is expected")
AssertionError: process 1830 exited with code -6, but exit code 0 is expected

======================================================================
FAIL: test_setpgroup (test.test_posix.TestPosixSpawnP.test_setpgroup)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/blue/cpython/Lib/test/test_posix.py", line 1869, in test_setpgroup
    support.wait_process(pid, exitcode=0)
    ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
  File "/home/blue/cpython/Lib/test/support/__init__.py", line 2241, in wait_process
    raise AssertionError(f"process {pid} exited with code {exitcode2}, "
                         f"but exit code {exitcode} is expected")
AssertionError: process 24458 exited with code -6, but exit code 0 is expected

======================================================================
FAIL: test_setsigdef (test.test_posix.TestPosixSpawnP.test_setsigdef)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/blue/cpython/Lib/test/test_posix.py", line 1955, in test_setsigdef
    support.wait_process(pid, exitcode=-signal.SIGUSR1)
    ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/blue/cpython/Lib/test/support/__init__.py", line 2241, in wait_process
    raise AssertionError(f"process {pid} exited with code {exitcode2}, "
                         f"but exit code {exitcode} is expected")
AssertionError: process 11736 exited with code -6, but exit code -30 is expected

======================================================================
FAIL: test_specify_environment (test.test_posix.TestPosixSpawnP.test_specify_environment)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/blue/cpython/Lib/test/test_posix.py", line 1822, in test_specify_environment
    support.wait_process(pid, exitcode=0)
    ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
  File "/home/blue/cpython/Lib/test/support/__init__.py", line 2241, in wait_process
    raise AssertionError(f"process {pid} exited with code {exitcode2}, "
                         f"but exit code {exitcode} is expected")
AssertionError: process 28506 exited with code -6, but exit code 0 is expected

----------------------------------------------------------------------
Ran 43 tests in 2.545s

FAILED (failures=21, skipped=6)
Warning -- files was modified by test_posix
Warning --   Before: []
Warning --   After:  ['python.core']
test test_posix failed
0:00:02 load avg: 0.17 [1/1/1] test_posix failed (21 failures)

== Tests result: FAILURE ==

1 test failed:
    test_posix

Total duration: 2.7 sec
Total tests: run=43 (filtered) failures=21 skipped=6
Total test files: run=1/1 (filtered) failed=1
Result: FAILURE

CPython versions tested on:

CPython main branch, 3.14

Operating systems tested on:

Other

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.14bugs and security fixesOS-netbsdinterpreter-core(Objects, Python, Grammar, and Parser dirs)type-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions