Skip to content

fix: guard fork() sites against multi-threaded regressions#40

Open
raphaelcoeffic wants to merge 1 commit intomainfrom
fork-safety-guard
Open

fix: guard fork() sites against multi-threaded regressions#40
raphaelcoeffic wants to merge 1 commit intomainfrom
fork-safety-guard

Conversation

@raphaelcoeffic
Copy link
Copy Markdown
Owner

The three fork() callers run Rust code in the child before exec/exit, which is only safe while the process is single-threaded. Add a small runtime check (panics in debug, warns in release) before each fork and SAFETY comments documenting the invariant. Also annotate the truncated clone3_args struct so its short prefix isn't mistaken for a bug.

The three fork() callers run Rust code in the child before exec/exit,
which is only safe while the process is single-threaded. Add a small
runtime check (panics in debug, warns in release) before each fork and
SAFETY comments documenting the invariant. Also annotate the truncated
clone3_args struct so its short prefix isn't mistaken for a bug.
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.

1 participant