Skip to content

Set RLIMIT_CORE=1 instead of =0 on Linux. #737

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 27, 2024

The Linux kernel special-cases RLIMIT_CORE=1 to mean "no, really, don't write a core file even if it'd be to a pipe." Which sounds like a niche use case but Ubuntu 24 by default enables Apport for crash reporting and Apport works by setting the core pattern to write to a pipe.

This resolves a performance issue on Linux where exit tests would always take almost exactly one second instead of a few microseconds (unless you explicitly turned off Apport.

Checklist:

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

The Linux kernel special-cases `RLIMIT_CORE=1` to mean "no, really, don't write a core file even if it'd be to a pipe." Which sounds like a niche use case but Ubuntu 24 by default enables Apport for crash reporting and Apport works by setting the core pattern to write to a pipe.

This resolves a performance issue on Linux where exit tests would always take almost exactly one second instead of a few microseconds (unless you explicitly turned off Apport.)
@grynspan grynspan added bug 🪲 Something isn't working linux 🐧 Linux support (all distros) performance Performance issues exit-tests ☠️ Work related to exit tests labels Sep 27, 2024
@grynspan grynspan self-assigned this Sep 27, 2024
@grynspan
Copy link
Contributor Author

@swift-ci test

@grynspan
Copy link
Contributor Author

@swift-ci test Windows

1 similar comment
@grynspan
Copy link
Contributor Author

@swift-ci test Windows

@grynspan grynspan added this to the Swift 6.1 milestone Sep 27, 2024
@grynspan grynspan merged commit bf1479e into main Sep 27, 2024
3 checks passed
@grynspan grynspan deleted the jgrynspan/rlimit-1-on-linux branch September 27, 2024 22:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🪲 Something isn't working exit-tests ☠️ Work related to exit tests linux 🐧 Linux support (all distros) performance Performance issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants