-
Notifications
You must be signed in to change notification settings - Fork 29
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 upon panic #693
Abort upon panic #693
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess this makes sense unless we want to catch panics somewhere.
Cargo.toml
Outdated
@@ -90,9 +90,13 @@ static_assertions = "1.1" | |||
thiserror = "1.0" | |||
tokio = "1.0" | |||
|
|||
[profile.dev] | |||
panic = "abort" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a comment here explaining why this is being added. I'm sure in a couple of months we'll forget.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add the comment and feel free to merge.
89559ff
to
b2f1d2a
Compare
How does this interact with proptest shrinking? If a proptest fails, it tries to reproduce the failure with smaller inputs to find a small input that still produces the issue. I guess if panicking fails, it will block shrinking from happening. We also lose backtraces if I am not mistaken. Can you check? Could this be done with a tokio settings, or maybe wrapper over |
Abort processes upon panic is safer than the default "unwind" stack strategy. For example, it prevents tokio from catching panics from spawned tasks.
Proptest works fine because it's used from the
Works fine (I tested the release build):
Tokio runtime does not have such setting yet: tokio-rs/tokio#4516 |
b2f1d2a
to
0af1fe0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for researching the interaction with proptest
Right now tokio runtime catches panics from spawned tasks and just prints something like this (I added the
panic!
statement for test):And the node will continue working after that (same for release and debug builds).
Aborting the process should be a safer choice. If the process is aborted, the core dump should be enough to debug the problem.
This change will affect all binaries in the workspace (node, wallet, dns server).