Skip to content

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

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-mtesttest_posix-mTestPosixSpawn-mTestPosixSpawnP-v==CPython3.14.0a6+ (heads/main:557d2d20d48, Mar232025, 15:29:59) [GCC10.5.0]
==NetBSD-10.0-amd64-x86_64-64bit-ELFlittle-endian==Pythonbuild: debug==cwd:/home/blue/cpython/build/test_python_worker_362æ==CPUcount: 16==encodings: locale=UTF-8FS=utf-8==resources: alltestresourcesaredisabled, use-uoptiontounskiptestsUsingrandomseed: 17137247100:00:00loadavg: 0.17Run1testsequentiallyinasingleprocess0:00:00loadavg: 0.17 [1/1] test_posixtest_bad_file_actions (test.test_posix.TestPosixSpawn.test_bad_file_actions) ... oktest_close_file (test.test_posix.TestPosixSpawn.test_close_file) ... assertion"here_addr < _tstate->c_stack_top"failed: file"Python/ceval.c", line468, function"_Py_InitializeRecursionLimits"FAILtest_dup2 (test.test_posix.TestPosixSpawn.test_dup2) ... oktest_empty_file_actions (test.test_posix.TestPosixSpawn.test_empty_file_actions) ... oktest_multiple_file_actions (test.test_posix.TestPosixSpawn.test_multiple_file_actions) ... assertion"here_addr < _tstate->c_stack_top"failed: file"Python/ceval.c", line468, function"_Py_InitializeRecursionLimits"FAILtest_no_such_executable (test.test_posix.TestPosixSpawn.test_no_such_executable) ... oktest_none_file_actions (test.test_posix.TestPosixSpawn.test_none_file_actions) ... oktest_open_file (test.test_posix.TestPosixSpawn.test_open_file) ... assertion"here_addr < _tstate->c_stack_top"failed: file"Python/ceval.c", line468, function"_Py_InitializeRecursionLimits"FAILtest_resetids (test.test_posix.TestPosixSpawn.test_resetids) ... assertion"here_addr < _tstate->c_stack_top"failed: file"Python/ceval.c", line468, function"_Py_InitializeRecursionLimits"FAILtest_resetids_explicit_default (test.test_posix.TestPosixSpawn.test_resetids_explicit_default) ... assertion"here_addr < _tstate->c_stack_top"failed: file"Python/ceval.c", line468, function"_Py_InitializeRecursionLimits"FAILtest_returns_pid (test.test_posix.TestPosixSpawn.test_returns_pid) ... assertion"here_addr < _tstate->c_stack_top"failed: file"Python/ceval.c", line468, function"_Py_InitializeRecursionLimits"FAILtest_setpgroup (test.test_posix.TestPosixSpawn.test_setpgroup) ... assertion"here_addr < _tstate->c_stack_top"failed: file"Python/ceval.c", line468, function"_Py_InitializeRecursionLimits"FAILtest_setpgroup_wrong_type (test.test_posix.TestPosixSpawn.test_setpgroup_wrong_type) ... oktest_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) ... oktest_setsigdef_wrong_type (test.test_posix.TestPosixSpawn.test_setsigdef_wrong_type) ... oktest_setsigmask (test.test_posix.TestPosixSpawn.test_setsigmask) ... assertion"here_addr < _tstate->c_stack_top"failed: file"Python/ceval.c", line468, function"_Py_InitializeRecursionLimits"FAILtest_setsigmask_wrong_type (test.test_posix.TestPosixSpawn.test_setsigmask_wrong_type) ... oktest_specify_environment (test.test_posix.TestPosixSpawn.test_specify_environment) ... assertion"here_addr < _tstate->c_stack_top"failed: file"Python/ceval.c", line468, function"_Py_InitializeRecursionLimits"FAILtest_bad_file_actions (test.test_posix.TestPosixSpawnP.test_bad_file_actions) ... oktest_close_file (test.test_posix.TestPosixSpawnP.test_close_file) ... assertion"here_addr < _tstate->c_stack_top"failed: file"Python/ceval.c", line468, function"_Py_InitializeRecursionLimits"FAILtest_dup2 (test.test_posix.TestPosixSpawnP.test_dup2) ... assertion"here_addr < _tstate->c_stack_top"failed: file"Python/ceval.c", line468, function"_Py_InitializeRecursionLimits"FAILtest_empty_file_actions (test.test_posix.TestPosixSpawnP.test_empty_file_actions) ... assertion"here_addr < _tstate->c_stack_top"failed: file"Python/ceval.c", line468, function"_Py_InitializeRecursionLimits"FAILtest_multiple_file_actions (test.test_posix.TestPosixSpawnP.test_multiple_file_actions) ... assertion"here_addr < _tstate->c_stack_top"failed: file"Python/ceval.c", line468, function"_Py_InitializeRecursionLimits"FAILtest_no_such_executable (test.test_posix.TestPosixSpawnP.test_no_such_executable) ... oktest_none_file_actions (test.test_posix.TestPosixSpawnP.test_none_file_actions) ... assertion"here_addr < _tstate->c_stack_top"failed: file"Python/ceval.c", line468, function"_Py_InitializeRecursionLimits"FAILtest_open_file (test.test_posix.TestPosixSpawnP.test_open_file) ... assertion"here_addr < _tstate->c_stack_top"failed: file"Python/ceval.c", line468, function"_Py_InitializeRecursionLimits"FAILtest_posix_spawnp (test.test_posix.TestPosixSpawnP.test_posix_spawnp) ... oktest_resetids (test.test_posix.TestPosixSpawnP.test_resetids) ... assertion"_tstate->c_stack_soft_limit < here_addr"failed: file"Python/ceval.c", line467, function"_Py_InitializeRecursionLimits"FAILtest_resetids_explicit_default (test.test_posix.TestPosixSpawnP.test_resetids_explicit_default) ... assertion"_tstate->c_stack_soft_limit < here_addr"failed: file"Python/ceval.c", line467, function"_Py_InitializeRecursionLimits"FAILtest_returns_pid (test.test_posix.TestPosixSpawnP.test_returns_pid) ... assertion"_tstate->c_stack_soft_limit < here_addr"failed: file"Python/ceval.c", line467, function"_Py_InitializeRecursionLimits"FAILtest_setpgroup (test.test_posix.TestPosixSpawnP.test_setpgroup) ... assertion"_tstate->c_stack_soft_limit < here_addr"failed: file"Python/ceval.c", line467, function"_Py_InitializeRecursionLimits"FAILtest_setpgroup_wrong_type (test.test_posix.TestPosixSpawnP.test_setpgroup_wrong_type) ... oktest_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", line467, function"_Py_InitializeRecursionLimits"FAILtest_setsigdef_wrong_type (test.test_posix.TestPosixSpawnP.test_setsigdef_wrong_type) ... oktest_setsigmask (test.test_posix.TestPosixSpawnP.test_setsigmask) ... oktest_setsigmask_wrong_type (test.test_posix.TestPosixSpawnP.test_setsigmask_wrong_type) ... oktest_specify_environment (test.test_posix.TestPosixSpawnP.test_specify_environment) ... assertion"here_addr < _tstate->c_stack_top"failed: file"Python/ceval.c", line468, function"_Py_InitializeRecursionLimits"FAIL======================================================================FAIL: test_close_file (test.test_posix.TestPosixSpawn.test_close_file)
----------------------------------------------------------------------Traceback (mostrecentcalllast):
File"/home/blue/cpython/Lib/test/test_posix.py", line2087, intest_close_filesupport.wait_process(pid, exitcode=0)
~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^File"/home/blue/cpython/Lib/test/support/__init__.py", line2241, inwait_processraiseAssertionError(f"process {pid} exited with code {exitcode2}, "f"but exit code {exitcode} is expected")
AssertionError: process14888exitedwithcode-6, butexitcode0isexpected======================================================================FAIL: test_multiple_file_actions (test.test_posix.TestPosixSpawn.test_multiple_file_actions)
----------------------------------------------------------------------Traceback (mostrecentcalllast):
File"/home/blue/cpython/Lib/test/test_posix.py", line2021, intest_multiple_file_actionssupport.wait_process(pid, exitcode=0)
~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^File"/home/blue/cpython/Lib/test/support/__init__.py", line2241, inwait_processraiseAssertionError(f"process {pid} exited with code {exitcode2}, "f"but exit code {exitcode} is expected")
AssertionError: process4875exitedwithcode-6, butexitcode0isexpected======================================================================FAIL: test_open_file (test.test_posix.TestPosixSpawn.test_open_file)
----------------------------------------------------------------------Traceback (mostrecentcalllast):
File"/home/blue/cpython/Lib/test/test_posix.py", line2068, intest_open_filesupport.wait_process(pid, exitcode=0)
~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^File"/home/blue/cpython/Lib/test/support/__init__.py", line2241, inwait_processraiseAssertionError(f"process {pid} exited with code {exitcode2}, "f"but exit code {exitcode} is expected")
AssertionError: process22411exitedwithcode-6, butexitcode0isexpected======================================================================FAIL: test_resetids (test.test_posix.TestPosixSpawn.test_resetids)
----------------------------------------------------------------------Traceback (mostrecentcalllast):
File"/home/blue/cpython/Lib/test/test_posix.py", line1860, intest_resetidssupport.wait_process(pid, exitcode=0)
~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^File"/home/blue/cpython/Lib/test/support/__init__.py", line2241, inwait_processraiseAssertionError(f"process {pid} exited with code {exitcode2}, "f"but exit code {exitcode} is expected")
AssertionError: process6982exitedwithcode-6, butexitcode0isexpected======================================================================FAIL: test_resetids_explicit_default (test.test_posix.TestPosixSpawn.test_resetids_explicit_default)
----------------------------------------------------------------------Traceback (mostrecentcalllast):
File"/home/blue/cpython/Lib/test/test_posix.py", line1851, intest_resetids_explicit_defaultsupport.wait_process(pid, exitcode=0)
~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^File"/home/blue/cpython/Lib/test/support/__init__.py", line2241, inwait_processraiseAssertionError(f"process {pid} exited with code {exitcode2}, "f"but exit code {exitcode} is expected")
AssertionError: process9121exitedwithcode-6, butexitcode0isexpected======================================================================FAIL: test_returns_pid (test.test_posix.TestPosixSpawn.test_returns_pid)
----------------------------------------------------------------------Traceback (mostrecentcalllast):
File"/home/blue/cpython/Lib/test/test_posix.py", line1792, intest_returns_pidsupport.wait_process(pid, exitcode=0)
~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^File"/home/blue/cpython/Lib/test/support/__init__.py", line2241, inwait_processraiseAssertionError(f"process {pid} exited with code {exitcode2}, "f"but exit code {exitcode} is expected")
AssertionError: process20376exitedwithcode-6, butexitcode0isexpected======================================================================FAIL: test_setpgroup (test.test_posix.TestPosixSpawn.test_setpgroup)
----------------------------------------------------------------------Traceback (mostrecentcalllast):
File"/home/blue/cpython/Lib/test/test_posix.py", line1869, intest_setpgroupsupport.wait_process(pid, exitcode=0)
~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^File"/home/blue/cpython/Lib/test/support/__init__.py", line2241, inwait_processraiseAssertionError(f"process {pid} exited with code {exitcode2}, "f"but exit code {exitcode} is expected")
AssertionError: process29677exitedwithcode-6, butexitcode0isexpected======================================================================FAIL: test_setsigmask (test.test_posix.TestPosixSpawn.test_setsigmask)
----------------------------------------------------------------------Traceback (mostrecentcalllast):
File"/home/blue/cpython/Lib/test/test_posix.py", line1890, intest_setsigmasksupport.wait_process(pid, exitcode=0)
~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^File"/home/blue/cpython/Lib/test/support/__init__.py", line2241, inwait_processraiseAssertionError(f"process {pid} exited with code {exitcode2}, "f"but exit code {exitcode} is expected")
AssertionError: process29091exitedwithcode-6, butexitcode0isexpected======================================================================FAIL: test_specify_environment (test.test_posix.TestPosixSpawn.test_specify_environment)
----------------------------------------------------------------------Traceback (mostrecentcalllast):
File"/home/blue/cpython/Lib/test/test_posix.py", line1822, intest_specify_environmentsupport.wait_process(pid, exitcode=0)
~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^File"/home/blue/cpython/Lib/test/support/__init__.py", line2241, inwait_processraiseAssertionError(f"process {pid} exited with code {exitcode2}, "f"but exit code {exitcode} is expected")
AssertionError: process26401exitedwithcode-6, butexitcode0isexpected======================================================================FAIL: test_close_file (test.test_posix.TestPosixSpawnP.test_close_file)
----------------------------------------------------------------------Traceback (mostrecentcalllast):
File"/home/blue/cpython/Lib/test/test_posix.py", line2087, intest_close_filesupport.wait_process(pid, exitcode=0)
~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^File"/home/blue/cpython/Lib/test/support/__init__.py", line2241, inwait_processraiseAssertionError(f"process {pid} exited with code {exitcode2}, "f"but exit code {exitcode} is expected")
AssertionError: process2519exitedwithcode-6, butexitcode0isexpected======================================================================FAIL: test_dup2 (test.test_posix.TestPosixSpawnP.test_dup2)
----------------------------------------------------------------------Traceback (mostrecentcalllast):
File"/home/blue/cpython/Lib/test/test_posix.py", line2105, intest_dup2support.wait_process(pid, exitcode=0)
~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^File"/home/blue/cpython/Lib/test/support/__init__.py", line2241, inwait_processraiseAssertionError(f"process {pid} exited with code {exitcode2}, "f"but exit code {exitcode} is expected")
AssertionError: process10663exitedwithcode-6, butexitcode0isexpected======================================================================FAIL: test_empty_file_actions (test.test_posix.TestPosixSpawnP.test_empty_file_actions)
----------------------------------------------------------------------Traceback (mostrecentcalllast):
File"/home/blue/cpython/Lib/test/test_posix.py", line1842, intest_empty_file_actionssupport.wait_process(pid, exitcode=0)
~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^File"/home/blue/cpython/Lib/test/support/__init__.py", line2241, inwait_processraiseAssertionError(f"process {pid} exited with code {exitcode2}, "f"but exit code {exitcode} is expected")
AssertionError: process29538exitedwithcode-6, butexitcode0isexpected======================================================================FAIL: test_multiple_file_actions (test.test_posix.TestPosixSpawnP.test_multiple_file_actions)
----------------------------------------------------------------------Traceback (mostrecentcalllast):
File"/home/blue/cpython/Lib/test/test_posix.py", line2021, intest_multiple_file_actionssupport.wait_process(pid, exitcode=0)
~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^File"/home/blue/cpython/Lib/test/support/__init__.py", line2241, inwait_processraiseAssertionError(f"process {pid} exited with code {exitcode2}, "f"but exit code {exitcode} is expected")
AssertionError: process13306exitedwithcode-6, butexitcode0isexpected======================================================================FAIL: test_none_file_actions (test.test_posix.TestPosixSpawnP.test_none_file_actions)
----------------------------------------------------------------------Traceback (mostrecentcalllast):
File"/home/blue/cpython/Lib/test/test_posix.py", line1833, intest_none_file_actionssupport.wait_process(pid, exitcode=0)
~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^File"/home/blue/cpython/Lib/test/support/__init__.py", line2241, inwait_processraiseAssertionError(f"process {pid} exited with code {exitcode2}, "f"but exit code {exitcode} is expected")
AssertionError: process4660exitedwithcode-6, butexitcode0isexpected======================================================================FAIL: test_open_file (test.test_posix.TestPosixSpawnP.test_open_file)
----------------------------------------------------------------------Traceback (mostrecentcalllast):
File"/home/blue/cpython/Lib/test/test_posix.py", line2068, intest_open_filesupport.wait_process(pid, exitcode=0)
~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^File"/home/blue/cpython/Lib/test/support/__init__.py", line2241, inwait_processraiseAssertionError(f"process {pid} exited with code {exitcode2}, "f"but exit code {exitcode} is expected")
AssertionError: process15283exitedwithcode-6, butexitcode0isexpected======================================================================FAIL: test_resetids (test.test_posix.TestPosixSpawnP.test_resetids)
----------------------------------------------------------------------Traceback (mostrecentcalllast):
File"/home/blue/cpython/Lib/test/test_posix.py", line1860, intest_resetidssupport.wait_process(pid, exitcode=0)
~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^File"/home/blue/cpython/Lib/test/support/__init__.py", line2241, inwait_processraiseAssertionError(f"process {pid} exited with code {exitcode2}, "f"but exit code {exitcode} is expected")
AssertionError: process27835exitedwithcode-6, butexitcode0isexpected======================================================================FAIL: test_resetids_explicit_default (test.test_posix.TestPosixSpawnP.test_resetids_explicit_default)
----------------------------------------------------------------------Traceback (mostrecentcalllast):
File"/home/blue/cpython/Lib/test/test_posix.py", line1851, intest_resetids_explicit_defaultsupport.wait_process(pid, exitcode=0)
~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^File"/home/blue/cpython/Lib/test/support/__init__.py", line2241, inwait_processraiseAssertionError(f"process {pid} exited with code {exitcode2}, "f"but exit code {exitcode} is expected")
AssertionError: process12737exitedwithcode-6, butexitcode0isexpected======================================================================FAIL: test_returns_pid (test.test_posix.TestPosixSpawnP.test_returns_pid)
----------------------------------------------------------------------Traceback (mostrecentcalllast):
File"/home/blue/cpython/Lib/test/test_posix.py", line1792, intest_returns_pidsupport.wait_process(pid, exitcode=0)
~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^File"/home/blue/cpython/Lib/test/support/__init__.py", line2241, inwait_processraiseAssertionError(f"process {pid} exited with code {exitcode2}, "f"but exit code {exitcode} is expected")
AssertionError: process1830exitedwithcode-6, butexitcode0isexpected======================================================================FAIL: test_setpgroup (test.test_posix.TestPosixSpawnP.test_setpgroup)
----------------------------------------------------------------------Traceback (mostrecentcalllast):
File"/home/blue/cpython/Lib/test/test_posix.py", line1869, intest_setpgroupsupport.wait_process(pid, exitcode=0)
~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^File"/home/blue/cpython/Lib/test/support/__init__.py", line2241, inwait_processraiseAssertionError(f"process {pid} exited with code {exitcode2}, "f"but exit code {exitcode} is expected")
AssertionError: process24458exitedwithcode-6, butexitcode0isexpected======================================================================FAIL: test_setsigdef (test.test_posix.TestPosixSpawnP.test_setsigdef)
----------------------------------------------------------------------Traceback (mostrecentcalllast):
File"/home/blue/cpython/Lib/test/test_posix.py", line1955, intest_setsigdefsupport.wait_process(pid, exitcode=-signal.SIGUSR1)
~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^File"/home/blue/cpython/Lib/test/support/__init__.py", line2241, inwait_processraiseAssertionError(f"process {pid} exited with code {exitcode2}, "f"but exit code {exitcode} is expected")
AssertionError: process11736exitedwithcode-6, butexitcode-30isexpected======================================================================FAIL: test_specify_environment (test.test_posix.TestPosixSpawnP.test_specify_environment)
----------------------------------------------------------------------Traceback (mostrecentcalllast):
File"/home/blue/cpython/Lib/test/test_posix.py", line1822, intest_specify_environmentsupport.wait_process(pid, exitcode=0)
~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^File"/home/blue/cpython/Lib/test/support/__init__.py", line2241, inwait_processraiseAssertionError(f"process {pid} exited with code {exitcode2}, "f"but exit code {exitcode} is expected")
AssertionError: process28506exitedwithcode-6, butexitcode0isexpected----------------------------------------------------------------------Ran43testsin2.545sFAILED (failures=21, skipped=6)
Warning--fileswasmodifiedbytest_posixWarning--Before: []
Warning--After: ['python.core']
testtest_posixfailed0:00:02loadavg: 0.17 [1/1/1] test_posixfailed (21failures)
==Testsresult: FAILURE==1testfailed:
test_posixTotalduration: 2.7secTotaltests: run=43 (filtered) failures=21skipped=6Totaltestfiles: run=1/1 (filtered) failed=1Result: 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