Skip to content

Reset default signal handlers on child processes before spawning them. #732

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 27, 2024

Conversation

grynspan
Copy link
Contributor

@grynspan grynspan commented Sep 25, 2024

On platforms that use posix_spawn(), we should take care to reset the signal handlers of child processes to their defaults, right? Or should this be valid?

signal(SIGABRT, SIG_IGN)
await #expect(exitsWith: .success) {
  raise(SIGABRT) // does nothing because we set it to SIG_IGN in the parent
  exit(0)
}

Checklist:

  • Code and documentation should follow the style of the Style Guide.
  • If public symbols are renamed or modified, DocC references should be updated.

@grynspan grynspan added bug 🪲 Something isn't working linux 🐧 Linux support (all distros) darwin 🍎 macOS, iOS, watchOS, tvOS, and visionOS support exit-tests ☠️ Work related to exit tests freebsd 😈 FreeBSD support labels Sep 25, 2024
@grynspan grynspan self-assigned this Sep 25, 2024
@grynspan
Copy link
Contributor Author

@swift-ci test

@grynspan grynspan added this to the Swift 6.1 milestone Sep 25, 2024
On platforms that use `posix_spawn()`, we should take care to reset the signal
handlers of child processes to their defaults, right? Or should this be valid?

```swift
signal(SIGABRT, SIG_IGN)
await #expect(exitsWith: .success) {
  raise(SIGABRT) // does nothing because we set it to SIG_IGN in the parent
  exit(0)
}
```
@grynspan grynspan force-pushed the jgrynspan/set-sigdef branch from adce4d6 to 62371bb Compare September 26, 2024 20:58
@grynspan
Copy link
Contributor Author

@swift-ci test

@grynspan grynspan merged commit 050d2f2 into main Sep 27, 2024
3 checks passed
@grynspan grynspan deleted the jgrynspan/set-sigdef branch September 27, 2024 17:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🪲 Something isn't working darwin 🍎 macOS, iOS, watchOS, tvOS, and visionOS support exit-tests ☠️ Work related to exit tests freebsd 😈 FreeBSD support linux 🐧 Linux support (all distros)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants