luzer: fix a signal handler#94
Merged
Merged
Conversation
06d1e22 to
340c5c7
Compare
Buristan
reviewed
Jul 3, 2026
Buristan
left a comment
Collaborator
There was a problem hiding this comment.
Hi, Sergey!
Thanks for the patch!
Please consider my questions below.
Do we need to add a test for the commit? The case may be too specific, so feel free to ignore.
340c5c7 to
3a5e9e9
Compare
Owner
Author
Yes, making a test will be nontrivial, so without a test. |
The original issue described in the issue [1] is gone after the commit bd91d59 ("cmake: generate ASan+libFuzzer and UBSan+libFuzzer"). The signal handler sometimes crashed, possibly because when using the -jobs=-1 option and a SIGINT was received, the luzer handler called `exit(0)`, which triggered destructors and killed the global `Fuzzer` object while the worker thread was still calling `Fuzzer::InterruptExitCode()`. The patch removes SIGINT handler because libFuzzer already has its own SIGINT handler (handle_int=1 by default), which correctly stops fuzzing via `_Exit()`. Also, the initialization of struct `sigaction` was added. Without zeroing, `sa_flags` contained garbage, which is undefined behavior. 1. #40 Fixes #40
3a5e9e9 to
3b01f95
Compare
Buristan
approved these changes
Jul 3, 2026
Buristan
left a comment
Collaborator
There was a problem hiding this comment.
Sergey,
Thanks for the fixes!
LGTM!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The signal handler sometimes crashed, possibly because when using the -jobs=-1 option and a SIGINT was received, the luzer handler called
exit(0), which triggered destructors and killed the globalFuzzerobject while the worker thread was still calling Fuzzer::InterruptExitCode().The patch removes SIGINT handler because libFuzzer already has its own SIGINT handler (handle_int=1 by default), which correctly stops fuzzing via _Exit().
Also, the initialization of struct
sigactionwas added. Without zeroing,sa_flagscontained garbage, which is undefined behavior.Fixes #40