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

Segmentation fault when running RUST_BACKTRACE=1 on stripped binary #44379

Closed
johnthagen opened this issue Sep 6, 2017 · 2 comments
Closed

Comments

@johnthagen
Copy link
Contributor

fn main() {
    panic!();
}
$ cargo run --release
    Finished release [optimized] target(s) in 0.0 secs
     Running `target/release/rust-test`
thread 'main' panicked at 'explicit panic', src/main.rs:2:4
note: Run with `RUST_BACKTRACE=1` for a backtrace.
$ strip target/release/rust-test
$ RUST_BACKTRACE=1 ./target/release/rust-test 
thread 'main' panicked at 'explicit panic', src/main.rs:2:4
Segmentation fault: 11

Should this be happening? I'm not surprised stripping would affect the backtrace, but a segmentation fault feels like a bug.

Tested on:

active toolchain
----------------

stable-x86_64-apple-darwin (default)
rustc 1.20.0 (f3d6973f4 2017-08-27)
alexcrichton added a commit to alexcrichton/rust that referenced this issue Sep 7, 2017
Apparently `dladdr` can succeed but still give you NULL pointers!

Closes rust-lang#44379
@alexcrichton
Copy link
Member

Thanks for the report and definitely a bug! Should be fixed in #44379

@johnthagen
Copy link
Contributor Author

For others tracking, should be fixed in #44384 😄

GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this issue Sep 8, 2017
std: Fix a segfault on OSX with backtraces

Apparently `dladdr` can succeed but still give you NULL pointers!

Closes rust-lang#44379
frewsxcv added a commit to frewsxcv/rust that referenced this issue Sep 9, 2017
std: Fix a segfault on OSX with backtraces

Apparently `dladdr` can succeed but still give you NULL pointers!

Closes rust-lang#44379
frewsxcv added a commit to frewsxcv/rust that referenced this issue Sep 9, 2017
std: Fix a segfault on OSX with backtraces

Apparently `dladdr` can succeed but still give you NULL pointers!

Closes rust-lang#44379
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this issue Sep 10, 2017
std: Fix a segfault on OSX with backtraces

Apparently `dladdr` can succeed but still give you NULL pointers!

Closes rust-lang#44379
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants