Skip to content

Fix signal handler initialization in forked child processes#3284

Merged
sporksmith merged 4 commits intoshadow:mainfrom
sporksmith:clone-clear-sighand
Jan 17, 2024
Merged

Fix signal handler initialization in forked child processes#3284
sporksmith merged 4 commits intoshadow:mainfrom
sporksmith:clone-clear-sighand

Conversation

@sporksmith
Copy link
Copy Markdown
Contributor

No description provided.

@sporksmith sporksmith self-assigned this Jan 16, 2024
@github-actions github-actions bot added Component: Libraries Support functions like LD_PRELOAD and logging Component: Testing Unit and integration tests and frameworks Component: Main Composing the core Shadow executable Component: Documentation In-repository documentation, under docs/ labels Jan 16, 2024
@sporksmith sporksmith changed the title Clone clear sighand Fix signal handler initialization in forked child processes Jan 16, 2024
This is currently enabled for linux-only, since it's not yet implemented
in shadow.
Previously fork-like invocations of clone incorrectly reset signal
handlers, as if `CLONE_CLEAR_SIGHAND` was used.

The default is now fixed to copy signal handlers from the parent
process, and we add support for the `CLONE_CLEAR_SIGHAND` flag to clear
them.
@sporksmith sporksmith marked this pull request as ready for review January 17, 2024 00:09
@sporksmith sporksmith requested a review from robgjansen January 17, 2024 00:09
@sporksmith
Copy link
Copy Markdown
Contributor Author

Verified this fixes the fork-linux test on fedora:39 (though there are still other tests failing)

$ ci/run.sh -i -c fedora:39 -C gcc -b debug
...
The following tests FAILED:
	 61 - simple_http-shadow (Failed)
	 62 - gc-linux (Failed)
	 63 - gc-shadow (Failed)
	 65 - goroutines-linux (Failed)
	 66 - goroutines-shadow (Failed)

@sporksmith sporksmith linked an issue Jan 17, 2024 that may be closed by this pull request
@robgjansen
Copy link
Copy Markdown
Member

I believe those other failures are #3267

Copy link
Copy Markdown
Member

@robgjansen robgjansen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@sporksmith sporksmith merged commit 73bdff2 into shadow:main Jan 17, 2024
@sporksmith sporksmith deleted the clone-clear-sighand branch January 17, 2024 16:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Component: Documentation In-repository documentation, under docs/ Component: Libraries Support functions like LD_PRELOAD and logging Component: Main Composing the core Shadow executable Component: Testing Unit and integration tests and frameworks

Projects

None yet

Development

Successfully merging this pull request may close these issues.

posix_spawn fails starting in glibc-2.38

2 participants