Skip to content
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

unix: Don't override existing SIGSEGV/BUS handlers #69685

Merged
merged 1 commit into from
Mar 9, 2020

Conversation

cuviper
Copy link
Member

@cuviper cuviper commented Mar 4, 2020

Although stack_overflow::init runs very early in the process, even
before main, there may already be signal handlers installed for things
like the address sanitizer. In that case, just leave it alone, and don't
bother trying to allocate our own signal stacks either.

Fixes #69524.

@Mark-Simulacrum
Copy link
Member

r? @joshtriplett

I suspect this will want libs team FCP, but seems good to me, though I'm not super familiar with this area.

@joshtriplett
Copy link
Member

This seems reasonable to me.

(I don't especially like installing a signal handler even if there isn't already a handler, since sometimes you do want the default behavior; for instance, you might want to debug it. But as an incremental change, this seems fine.)

@JohnTitor JohnTitor added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Mar 4, 2020
@cuviper
Copy link
Member Author

cuviper commented Mar 6, 2020

@joshtriplett -- is that an r+? Or do we need input from anyone else first?

@Mark-Simulacrum
Copy link
Member

I would suggest libs FCP. randomly, let's r? @sfackler

@sfackler
Copy link
Member

sfackler commented Mar 7, 2020

@bors r+

@bors
Copy link
Contributor

bors commented Mar 7, 2020

📌 Commit db75c97 has been approved by sfackler

@bors
Copy link
Contributor

bors commented Mar 7, 2020

🌲 The tree is currently closed for pull requests below priority 1000, this pull request will be tested once the tree is reopened

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Mar 7, 2020
Centril added a commit to Centril/rust that referenced this pull request Mar 8, 2020
unix: Don't override existing SIGSEGV/BUS handlers

Although `stack_overflow::init` runs very early in the process, even
before `main`, there may already be signal handlers installed for things
like the address sanitizer. In that case, just leave it alone, and don't
bother trying to allocate our own signal stacks either.

Fixes rust-lang#69524.
bors added a commit that referenced this pull request Mar 8, 2020
Rollup of 8 pull requests

Successful merges:

 - #69631 (remove non-sysroot sources from rust-src component)
 - #69646 (Miri visitor: detect primitive types based on type, not layout (also, more tests))
 - #69651 (Try to ensure usize marker does not get merged)
 - #69668 (More documentation and simplification of BTreeMap's internals)
 - #69685 (unix: Don't override existing SIGSEGV/BUS handlers)
 - #69771 (Cleanup E0390 explanation)
 - #69777 (Add missing ` in doc for File::with_options())
 - #69812 (Refactorings to method/probe.rs and CrateId)

Failed merges:

r? @ghost
@Centril
Copy link
Contributor

Centril commented Mar 8, 2020

Failed in #69827 (comment), @bors r-

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Mar 8, 2020
Although `stack_overflow::init` runs very early in the process, even
before `main`, there may already be signal handlers installed for things
like the address sanitizer. In that case, just leave it alone, and don't
bother trying to allocate our own signal stacks either.
@cuviper
Copy link
Member Author

cuviper commented Mar 9, 2020

Sorry, missed the newly unused import in the no-op targets, should be fixed now.

@bors r=sfackler

@bors
Copy link
Contributor

bors commented Mar 9, 2020

📌 Commit 676b9bc has been approved by sfackler

@bors
Copy link
Contributor

bors commented Mar 9, 2020

🌲 The tree is currently closed for pull requests below priority 1000, this pull request will be tested once the tree is reopened

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Mar 9, 2020
Centril added a commit to Centril/rust that referenced this pull request Mar 9, 2020
unix: Don't override existing SIGSEGV/BUS handlers

Although `stack_overflow::init` runs very early in the process, even
before `main`, there may already be signal handlers installed for things
like the address sanitizer. In that case, just leave it alone, and don't
bother trying to allocate our own signal stacks either.

Fixes rust-lang#69524.
Centril added a commit to Centril/rust that referenced this pull request Mar 9, 2020
unix: Don't override existing SIGSEGV/BUS handlers

Although `stack_overflow::init` runs very early in the process, even
before `main`, there may already be signal handlers installed for things
like the address sanitizer. In that case, just leave it alone, and don't
bother trying to allocate our own signal stacks either.

Fixes rust-lang#69524.
bors added a commit that referenced this pull request Mar 9, 2020
Rollup of 6 pull requests

Successful merges:

 - #69201 (Permit attributes on 'if' expressions)
 - #69402 (Extend search)
 - #69519 ( Don't use static crt by default when build proc-macro)
 - #69685 (unix: Don't override existing SIGSEGV/BUS handlers)
 - #69762 (Ensure that validity only raises validity errors)
 - #69779 (librustc_codegen_llvm: Use slices in preference to 0-terminated strings)

Failed merges:

r? @ghost
Centril added a commit to Centril/rust that referenced this pull request Mar 9, 2020
unix: Don't override existing SIGSEGV/BUS handlers

Although `stack_overflow::init` runs very early in the process, even
before `main`, there may already be signal handlers installed for things
like the address sanitizer. In that case, just leave it alone, and don't
bother trying to allocate our own signal stacks either.

Fixes rust-lang#69524.
bors added a commit that referenced this pull request Mar 9, 2020
Rollup of 6 pull requests

Successful merges:

 - #69201 (Permit attributes on 'if' expressions)
 - #69685 (unix: Don't override existing SIGSEGV/BUS handlers)
 - #69762 (Ensure that validity only raises validity errors)
 - #69779 (librustc_codegen_llvm: Use slices in preference to 0-terminated strings)
 - #69801 (rustc_parse: Remove `Parser::normalized(_prev)_token`)
 - #69842 (Add more regression tests)

Failed merges:

r? @ghost
@bors bors merged commit eaf6905 into rust-lang:master Mar 9, 2020
facebook-github-bot pushed a commit to facebookexperimental/rust-shed that referenced this pull request Mar 11, 2020
Summary:
This diff upgrades fbcode platform007 and platform009 to rust 1.42.0 + a cherry-pick of rust-lang/rust#69685 for AddressSanitizer support, and xplat to plain 1.42.0.

Be aware that the xplat toolchain, for which we use the official upstream releases and don't build from source, no longer supports armv7-apple-ios and armv7s-apple-ios targets as of 1.42.0.

Differential Revision: D20379253

fbshipit-source-id: c98fecc35dbe077f8dd1b8c7a7bab098795ac2dd
facebook-github-bot pushed a commit to facebook/hhvm that referenced this pull request Mar 11, 2020
Summary:
This diff upgrades fbcode platform007 and platform009 to rust 1.42.0 + a cherry-pick of rust-lang/rust#69685 for AddressSanitizer support, and xplat to plain 1.42.0.

Be aware that the xplat toolchain, for which we use the official upstream releases and don't build from source, no longer supports armv7-apple-ios and armv7s-apple-ios targets as of 1.42.0.

Differential Revision: D20379253

fbshipit-source-id: c98fecc35dbe077f8dd1b8c7a7bab098795ac2dd
@cuviper cuviper deleted the soft-segv branch April 3, 2020 18:37
github-merge-queue bot pushed a commit to leanprover/lean4 that referenced this pull request Aug 19, 2024
Such handlers can come from address sanitizers and similar. When
combined with #4971, this forward-ports
rust-lang/rust@676b9bc
/ rust-lang/rust#69685

---------

Co-authored-by: Sebastian Ullrich <sebasti@nullri.ch>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

-Zsanitizer=address failing to catch SIGSEGV
7 participants