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

Backtrace line numbers #308

lynaghk opened this issue May 8, 2018 · 0 comments

Backtrace line numbers #308

lynaghk opened this issue May 8, 2018 · 0 comments


Copy link

lynaghk commented May 8, 2018

First, let me say thanks for Neon --- it's a great project and it allowed me to really dive in and make my first Rust project, Finda.

I'm trying to compile my project so that I have a release build that logs line numbers and backtraces on panic.
I can do this fine with a standard Rust binary, but I can't figure it out with Neon.

Here's a minimal reproducible example repository.
I've included the build details below.


On OS X 10.9.5, Rust can compile a release binary that includes line numbers in the backtrace:

cd native/a_panic
cargo run --release


2018-05-08 15:22:34 ERROR [log_panics] thread 'main' panicked at 'oh no!': src/
stack backtrace:
   0:        0x1000fba9e - backtrace::backtrace::trace::h6954c675fdb81650
                        at /Users/dev/.cargo/registry/src/
   1:        0x1000fa01c - backtrace::capture::Backtrace::new::h44f202edd8c21d9b
                        at /Users/dev/.cargo/registry/src/

However, the same code compiled with Neon has no line numbers in the backtrace:

yarn install
node -e 'require("./")'


2018-05-08 15:27:42 ERROR [log_panics] thread 'unnamed' panicked at 'oh no!': a_panic/src/
stack backtrace:
   0:        0x106de4e6e - backtrace::backtrace::trace::ha74a84b436b4090e
   1:        0x106de299c - backtrace::capture::Backtrace::new::h180d14cb08d60248
   2:        0x106de1eed - log_panics::init::_$u7b$$u7b$closure$u7d$$u7d$::h990ff31ff59f1e7d
   3:        0x106e12870 - std::panicking::rust_panic_with_hook::hfb431ab23831437f
   4:        0x106dd8821 - std::panicking::begin_panic::h6ef215fe9e0c41fe
   5:        0x106dd878d - a_panic::panic_please::h8d3d02c8208552ed
   6:        0x106dc9cb5 - backtrace_test::hello::hb394c4370bb7ceec
   7:        0x106dc9e5b - std::panicking::try::do_call::h5c5f1cbb0951adfa (.llvm.5600580859378085660)
   8:        0x106e2d38e - __rust_maybe_catch_panic

The output is the same, even when using the --debug flag:

yarn run -- neon build --debug
node -e 'require("./")'

or when adding

debug = true

to Cargo.toml.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet

No branches or pull requests

2 participants