-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Backtrace is <unknown> for dynamic library loaded through dlopen using absolute file path for rust >= 1.37.0 on OSX #67599
Comments
I get the correct backtrace when I run the repro repo (ha) for both relative and absolute paths on Linux, using rustc 1.40.0:
Perhaps an OSX issue. Give me a moment - I'll see if Windows is affected. |
Backtrace is fine on Windows 10, too.
I do also appear to get a segfault after the backtrace dump, though I'm not sure that's unexpected:
|
Thanks for checking. As an aside, I noticed that the issue hasn't been labelled while most other new issues are, I'm not sure if that means it's slipped through some cracks. |
Hmm, not 100% sure -- there's quite a few open issues without labels right now, but there's also been quite a number of issues in the past that were resolved without being labelled. I feel like not having labels is more just an indication that @jonas-schievink, who seems to be the one to label most new issues, didn't happen to see it when it first was submitted. In any case, you can use rustbot to add labels yourself, like this: |
Error: Label regression-from-stable-to-stable can only be set by Rust team members Please let |
Oof, alright. Fair enough. @rustbot modify labels to +O-macos, +A-runtime |
Bisecting shows it starting with d1040fe. |
This is really a |
A bisection pointing to d1040fe likely indicates that the implementation in the From what it looks like I think this is an instance of rust-lang/backtrace-rs#318. That bug affected both the libbacktrace implementation as well as gimli, and gimli has since been fixed. If you add in a dependency on the For the standard library there's not really a great solution right now, unfortunately. There's an issue about using gimli in libstd, but that will take some time. |
This was |
As a note of reference, this has also recently started to appear on Linux on nightly.
Only seems to happen when I set |
Thanks, I can't reproduce this any more with Rust 1.53.0 on Mac OS 10.14.6. Absolute and relative paths produce the complete backtrace. I also tested the repro project on Arch Linux with Rust 1.53.0, and can't reproduce the issue there. |
From Rust v1.37.0 onwards on Mac OS 10.14.6, a panic triggered in a dynamically loaded library does not produce a full stacktrace if the library was loaded by passing an absolute path to
dlopen
.I haven't been able to test other platformsWindows and Linux do not have the issue, see #67599 (comment) and #67599 (comment).The project at https://github.com/t-mw/libreloading-test-rs loads a library using its absolute path by default. The loading is done by
libloading
which usesdlopen
internally.With Rust 1.40 and
RUST_BACKTRACE=full cargo run
the following output is produced (Rust 1.37 produces similar output):The expected output can be seen by compiling the same code with Rust 1.36. However, this is still missing some details about line numbers, for example for
reloadable::RELOAD_API::{{closure}}
:Ideally, the output would be the same as when a relative path name is passed to
dlopen
(by uncommenting https://github.com/t-mw/libreloading-test-rs/blob/master/src/main.rs#L11), which produces a complete backtrace in Rust 1.36 to 1.40. Rust 1.40 produces the following output in that case:The text was updated successfully, but these errors were encountered: