-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Remove abort when catching a signal. Combined with signal handler cha… #813
Conversation
…ining from the JVM, this should be prevent the JVM from shutting down exception_handler gets called.
Mhm. Why does the JVM produce SIGBUS or SIGSEGV? |
See this. I have a test case that involves reloading Yara rules on the fly and scanning some byte arrays. After upgrading to Yara 3.5.0 and newer, I had to do some hacking to get things to work. Part of the puzzle was removing the assertion here, the other part was using |
@wjsl Do you think that it would make sense for |
It could. What would it look like? Before I noticed the test case, I hacked up a little program that simulates how many threads I'm using that can be found here. Using Even from a non-Java environment, what I think the issue is that a signal handler is really set for just the process, but the signal handler assumes the signal is delivered to the thread that caused the signal in the first place. I'm starting to think that removing the |
I had the same problem with go-yara recently. A nil-pointer dereference caused a So I'm starting to wonder if it would be better to let the application install the signal handler if needed, or at least make |
@plusvic I agree that having the default signal handler may be problematic. And I think we all agree that the I wonder if chaining the signal handler (as laid out in https://github.com/hillu/yara/tree/chained-signal-handler) might be a better general answer. |
I would do both, setting |
Thanks for the merge! I didn't realize there was a whole other discussion under another PR. Apologies for the radio silence. |
Combined with signal handler chaining from the JVM, this should be prevent the JVM from shutting down exception_handler gets called.
…ining from the JVM, this should be prevent the JVM from shutting down when exception_handler gets called.