-
-
Notifications
You must be signed in to change notification settings - Fork 815
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
Abort on panic #1570
base: master
Are you sure you want to change the base?
Abort on panic #1570
Conversation
This should help both runtime performance and side of the executable. And I can't think of a reason why we would need unwinding on panic in release builds.
From documentation of the tikv-jemallocator project: > The project is also published as jemallocator for historical reasons. The two crates are the same except names. > For new projects, it's recommended to use tikv-xxx versions instead.
Wouldn't this make bug reports harder to debug, or can we still get stacktraces? |
panic=abort still gives a backtrace, you just can't catch_unwind() |
Ok, in this case I'm fine with the change. Thank you |
hmmm, actually it does look like the stack trace is less useful if panic=abort. It shows you where the panic happened, but not. I added a panic to output.rs and ran with panic=abort and with panic=unwind. RUST_BACKTRACE=1:with panic=abort:
with panic=unwind:
Also note that it looks like with "unwind" it flushes stdout before exiting, but with abort it doesn't. I'm not sure how much we care about that. RUST_BACKTRACE=fullwith panic=abort:
with panic=unwind:
Notice that with panic=abort, it does include the location of the actual panic, but not frames higher in the stack. So the question is, is it worth the cost in performance to have better stack traces from panics in release builds. I'm inclined to think that we see panics rarely enough, that it may be worth using abort in release builds, and if someone encounters a panic have them run with a debug build with panic=unwind to get a better stacktrace. |
This should help both runtime performance and side of the executable.
And I can't think of a reason why we would need unwinding on panic in
release builds.