Skip to content

Remove the flaky setproctitle crash canary on macOS - #658

Merged
boxed merged 1 commit into
boxed:mainfrom
zyv:remove-setproctitle-canary
Dec 2, 2026
Merged

boxed merged 1 commit into
boxed:mainfrom
zyv:remove-setproctitle-canary

Conversation

@zyv

@zyv zyv commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

test_setproctitle_crashes_after_fork_with_corefoundation_loaded fails in about half of the runs on macOS, because the crash asserted by the test is not deterministic: a forked child calling setproctitle segfaults in about half of the runs and exits cleanly in the rest.

A canary cannot be made reliable here: trial over several children only raises the chance of a crash. The CAVEATS of Apple's fork(2) say that every framework API must be assumed unsafe in a forked child until it calls exec, and the LaunchServices call made by setproctitle on macOS is one of them.

The setproctitle maintainers treat the crash as a platform limitation (dvarrazzo/py-setproctitle#127), so a child that exits cleanly does NOT mean that the workaround can go; test_safe_setproctitle_does_not_crash_after_fork stays, as it tests the workaround in safe_setproctitle.

Closes #622.


Further reading:

`test_setproctitle_crashes_after_fork_with_corefoundation_loaded` fails in
about half of the runs on macOS, because the crash asserted by the test is
not deterministic: a forked child calling `setproctitle` segfaults in about
half of the runs and exits cleanly in the rest.

A canary cannot be made reliable here. The CAVEATS of Apple's `fork(2)` say
that every framework API must be assumed unsafe in a forked child until it
calls `exec`, and the LaunchServices call made by `setproctitle` on macOS is
one of them. The setproctitle maintainers treat the crash as a platform
limitation (dvarrazzo/py-setproctitle#127), so a child that exits cleanly
does NOT mean that the workaround can go.

`test_safe_setproctitle_does_not_crash_after_fork` stays, as it tests the
workaround in `safe_setproctitle`.

Closes boxed#622.
@boxed
boxed merged commit f17c33b into boxed:main Dec 2, 2026
13 checks passed
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.

macOS : test_setproctitle_crashes_after_fork_with_corefoundation_loaded fails in about half of the runs

2 participants