Skip to content

test_posix_pty_functions kills the regrtest worker on Solaris #154345

Description

@serhiy-storchaka

Bug report

test_os.test_posix_pty_functions() kills the worker process when the test suite is run in parallel on Solaris:

$ ./python -m test -j1 test_os.test_os
0:00:01 load avg: 0.12 [1/1/1] test_os.test_os worker non-zero exit code (Exit code -1 (SIGHUP))
Total tests: run=0

The whole test file is lost, so none of its 363 tests are reported. It only happens in a worker, because regrtest workers are session leaders without a controlling terminal; in sequential mode the test passes.

gh-154226 added pushing the ptem and ldterm STREAMS modules onto the slave, to make it a terminal. But that is exactly the operation which makes such a session leader acquire the slave as its controlling terminal despite O_NOCTTY — the reason why os.openpty() disowns it in gh-154225. The test does not, so closing the file descriptors revokes the controlling terminal and the kernel sends SIGHUP to the session.

sid=16933 pid=16933
CTTY ACQUIRED by the push
ttyname ok: True
SURVIVED close
rc=-1

Disowning the controlling terminal after the pushes, as os.openpty() does, fixes it.

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.13bugs and security fixes3.14bugs and security fixes3.15pre-release feature fixes, bugs and security fixes3.16new features, bugs and security fixesOS-unsupportedtestsTests in the Lib/test dirtype-bugAn unexpected behavior, bug, or error

    Projects

    Status
    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions