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

[illumos] enable SIGSEGV handler to detect stack overflows #130132

Merged
merged 1 commit into from
Sep 10, 2024

Conversation

sunshowers
Copy link
Contributor

Use the same code as Solaris. I couldn't find any tests regarding this, but I did test a stage0 build against my stack-exhaust-test binary [1]. Before:

running with use_stacker = No, new_thread = false, make_large_local = false
zsh: segmentation fault (core dumped)  cargo run

After:

running with use_stacker = No, new_thread = false, make_large_local = false

thread 'main' has overflowed its stack
fatal runtime error: stack overflow
zsh: IOT instruction (core dumped)  cargo +stage0 run

Fixes #128568.

[1] https://github.com/sunshowers/stack-exhaust-test/

Use the same code as Solaris. I couldn't find any tests regarding this, but I
did test a stage0 build against my stack-exhaust-test binary [1]. Before:

```
running with use_stacker = No, new_thread = false, make_large_local = false
zsh: segmentation fault (core dumped)  cargo run
```

After:

```
running with use_stacker = No, new_thread = false, make_large_local = false

thread 'main' has overflowed its stack
fatal runtime error: stack overflow
zsh: IOT instruction (core dumped)  cargo +stage0 run
```

Fixes rust-lang#128568.

[1] https://github.com/sunshowers/stack-exhaust-test/
@rustbot
Copy link
Collaborator

rustbot commented Sep 9, 2024

r? @Noratrieb

rustbot has assigned @Noratrieb.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added O-unix Operating system: Unix-like S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Sep 9, 2024
@Noratrieb
Copy link
Member

There are currently no target maintainers that we could ping about this change and ask for review.. would y'all at Oxide be interested in becoming them? :)
See https://doc.rust-lang.org/nightly/rustc/target-tier-policy.html

The change looks okay to me though, and me approving this without illumos expertise is okay as it's just tier 2.
@bors r+

@bors
Copy link
Contributor

bors commented Sep 9, 2024

📌 Commit 54672ac has been approved by Noratrieb

It is now in the queue for this repository.

@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 Sep 9, 2024
@sunshowers
Copy link
Contributor Author

There are currently no target maintainers that we could ping about this change and ask for review.. would y'all at Oxide be interested in becoming them? :)

I think so! Let me ask folks.

@sunshowers
Copy link
Contributor Author

@jclulow and @pfmooney would be appropriate folks to sign up for this (they already are the illumos maintainers for libc).

@jclulow
Copy link
Contributor

jclulow commented Sep 9, 2024

Yes, please add us! To be honest I thought we were already listed, sorry!

@Noratrieb
Copy link
Member

thanks! just make a PR adding a new target documentation page (which can be filled out as much as you want, ideally as much as possible, see the template in src/doc/rustc) and add your handles there

workingjubilee added a commit to workingjubilee/rustc that referenced this pull request Sep 10, 2024
…trieb

[illumos] enable SIGSEGV handler to detect stack overflows

Use the same code as Solaris. I couldn't find any tests regarding this, but I did test a stage0 build against my stack-exhaust-test binary [1]. Before:

```
running with use_stacker = No, new_thread = false, make_large_local = false
zsh: segmentation fault (core dumped)  cargo run
```

After:

```
running with use_stacker = No, new_thread = false, make_large_local = false

thread 'main' has overflowed its stack
fatal runtime error: stack overflow
zsh: IOT instruction (core dumped)  cargo +stage0 run
```

Fixes rust-lang#128568.

[1] https://github.com/sunshowers/stack-exhaust-test/
bors added a commit to rust-lang-ci/rust that referenced this pull request Sep 10, 2024
…kingjubilee

Rollup of 14 pull requests

Successful merges:

 - rust-lang#128316 (Stabilize most of `io_error_more`)
 - rust-lang#129473 (use  `download-ci-llvm=true` in the default compiler config)
 - rust-lang#129529 (Add test to build crates used by r-a on stable)
 - rust-lang#129778 (interpret: make typed copies lossy wrt provenance and padding)
 - rust-lang#129981 (Remove `serialized_bitcode` from `LtoModuleCodegen`.)
 - rust-lang#130025 (Also emit `missing_docs` lint with `--test` to fulfil expectations)
 - rust-lang#130040 (unify `llvm-bitcode-linker`, `wasm-component-ld` and llvm-tools logics)
 - rust-lang#130094 (Inform the solver if evaluation is concurrent)
 - rust-lang#130132 ([illumos] enable SIGSEGV handler to detect stack overflows)
 - rust-lang#130146 (bootstrap `naked_asm!` for `compiler-builtins`)
 - rust-lang#130149 (Helper function for formatting with `LifetimeSuggestionPosition`)
 - rust-lang#130152 (adapt a test for llvm 20)
 - rust-lang#130162 (bump download-ci-llvm-stamp)
 - rust-lang#130164 (move some const fn out of the const_ptr_as_ref feature)

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit to rust-lang-ci/rust that referenced this pull request Sep 10, 2024
…kingjubilee

Rollup of 11 pull requests

Successful merges:

 - rust-lang#128316 (Stabilize most of `io_error_more`)
 - rust-lang#129473 (use  `download-ci-llvm=true` in the default compiler config)
 - rust-lang#129529 (Add test to build crates used by r-a on stable)
 - rust-lang#129981 (Remove `serialized_bitcode` from `LtoModuleCodegen`.)
 - rust-lang#130094 (Inform the solver if evaluation is concurrent)
 - rust-lang#130132 ([illumos] enable SIGSEGV handler to detect stack overflows)
 - rust-lang#130146 (bootstrap `naked_asm!` for `compiler-builtins`)
 - rust-lang#130149 (Helper function for formatting with `LifetimeSuggestionPosition`)
 - rust-lang#130152 (adapt a test for llvm 20)
 - rust-lang#130162 (bump download-ci-llvm-stamp)
 - rust-lang#130164 (move some const fn out of the const_ptr_as_ref feature)

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit to rust-lang-ci/rust that referenced this pull request Sep 10, 2024
…kingjubilee

Rollup of 11 pull requests

Successful merges:

 - rust-lang#128316 (Stabilize most of `io_error_more`)
 - rust-lang#129473 (use  `download-ci-llvm=true` in the default compiler config)
 - rust-lang#129529 (Add test to build crates used by r-a on stable)
 - rust-lang#129981 (Remove `serialized_bitcode` from `LtoModuleCodegen`.)
 - rust-lang#130094 (Inform the solver if evaluation is concurrent)
 - rust-lang#130132 ([illumos] enable SIGSEGV handler to detect stack overflows)
 - rust-lang#130146 (bootstrap `naked_asm!` for `compiler-builtins`)
 - rust-lang#130149 (Helper function for formatting with `LifetimeSuggestionPosition`)
 - rust-lang#130152 (adapt a test for llvm 20)
 - rust-lang#130162 (bump download-ci-llvm-stamp)
 - rust-lang#130164 (move some const fn out of the const_ptr_as_ref feature)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 4680892 into rust-lang:master Sep 10, 2024
6 checks passed
@rustbot rustbot added this to the 1.83.0 milestone Sep 10, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Sep 10, 2024
Rollup merge of rust-lang#130132 - sunshowers:illumos-sigsegv, r=Noratrieb

[illumos] enable SIGSEGV handler to detect stack overflows

Use the same code as Solaris. I couldn't find any tests regarding this, but I did test a stage0 build against my stack-exhaust-test binary [1]. Before:

```
running with use_stacker = No, new_thread = false, make_large_local = false
zsh: segmentation fault (core dumped)  cargo run
```

After:

```
running with use_stacker = No, new_thread = false, make_large_local = false

thread 'main' has overflowed its stack
fatal runtime error: stack overflow
zsh: IOT instruction (core dumped)  cargo +stage0 run
```

Fixes rust-lang#128568.

[1] https://github.com/sunshowers/stack-exhaust-test/
@sunshowers sunshowers deleted the illumos-sigsegv branch September 10, 2024 22:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
O-unix Operating system: Unix-like S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[illumos] stack exhaustion doesn't print "thread has overflowed its stack" messages
5 participants