Skip to content

os.openpty() acquires a controlling terminal on Solaris, hanging the test suite #154225

Description

@serhiy-storchaka

Bug report

On illumos/Solaris, os.openpty() leaves the calling process with the new pty as its controlling terminal, despite opening the slave with O_NOCTTY. The ptem STREAMS module that openpty() pushes turns the slave into a terminal, and a session leader without a controlling terminal then acquires it at push time.

This causes the whole pty-based test cluster (test_readline, test_cmd, test_pty, ...) to hang forever under python -m test -jN, because regrtest workers are session leaders: after pty_helper.run_pty's child exits, the controlling-terminal association keeps the slave open, so the master never reaches EOF.

After pushing the STREAMS modules, disown a newly-acquired controlling terminal with TIOCNOTTY (with SIGHUP ignored, since it is sent to the session leader).

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-unsupportedextension-modulesC modules in the Modules dirtype-bugAn unexpected behavior, bug, or error

    Fields

    No fields configured for issues without a type.

    Projects

    Status
    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions