-
Notifications
You must be signed in to change notification settings - Fork 405
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
Hard to shutdown, shows stack trace #4
Comments
This issue is now published on WorksHub. If you would like to work on this issue you can |
I came across this while debuging some weird test failures in the 0.6 update. When I hit a https://github.com/wasmerio/wasmer/blob/master/lib/runtime-core/src/fault.rs Notably This is called in two places in wasmer code, notably in the This probably interacts with the tendermint-install signal handlers in not so great ways... |
@MDM-General started working on this issue via WorksHub. |
A user started working on this issue via WorksHub. |
Seems the SIGINT is not passed to cosmos TrapSignal function due to Wasmer signal handler. This can disturb Tendermint & Cosmos side clean shutdown. We must solve this problem before being used in production. |
Maybe related with this golang/go#21905 (comment) |
Related issue: wasmerio/wasmer#842 |
Thank you @hanjukim That is a good description and exactly what I had thought was happening (but they did investigate more in depth, with different backends having different signal schemes). It does give a good place to start investigating |
From approach above, I have successfully called terra signal handler from wasmer-runtime-core. I will push my branch soon for reference. 🚀 |
Is this a PR on wasmer? That would be great. I was thinking to somehow cache the signal handlers in go before calling rust, then reset them when returning from rust, but that is a bit more ugly than just improving wasmer. |
wasmerio/wasmer@master...hanjukim:interrupt-signal-propagation Should I push this PR to wasmer? I am not sure that they will accept this sometime soon. I have added propagation codes for SIGINT only. |
It will have to get into Wasmer sometime. It looks like a nice start, but would definitely need some more tests before wasmer accepts it. Let me know if this works for you well in production, I get the general idea. Some comments: wasmerio/wasmer@master...hanjukim:interrupt-signal-propagation#diff-8f3014265045b59f7b99dc8c469aedb0R515 used to panic if unsuccessful (with
would probably be the closest to current behavior |
Also. where did the logic in Finally, does singlepass register the signal handler one time on first initialization / execution, or every time we execute? If the later, and we run a few contracts, the original (go) handlers will never be the last handler. I am guessing this is a one-time global thing ( |
Great start with the code. These are just some comments to make it a bit more robust and likely to end up in wasmer. |
I extracted it from wasmerio/wasmer@master...fluencelabs:clif_jni_hardering |
signal handler is registered one time on first initialization / execution. |
I uploaded a PR to wasmer project: wasmerio/wasmer#1496 |
This has been fixed with wasmer 1.0.0, used by cosmwasm-vm 0.13. Fix is on master as of #358 and will be on the v0.14.0 release. Took a year, but this looks a lot nicer now. |
Summary of Bug
If you run
wasmd
, it works fine, but fails to shut down onCtrl+C
. If I hitCtrl+C
a second time, it will shut down with a big stack trace.Version
0.5.2
Steps to Reproduce
See above. I assume this is an issue with shutting down the rust lib and tendermint signal handling.
For Admin Use
The text was updated successfully, but these errors were encountered: