-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Handle targets that implement signal handlers #675
Comments
Ughhh...
so, for those signals the simplest is to set all these flags to 2 As for SIGALRM... Hmmm. asan has nothing to do with SIGALRM. |
we can also add a code to libFuzzer to report a timeout if a single input took more than X seconds |
here is a proposal:
@vitalybuka WDYT? |
Why not in libFuzzer? It looks very libFuzzer specific. |
sanitizers have the interception machinery, which is too hairy to have it re-implemented in libFuzzer |
Re handle_signal=2, which llvm revision introduced it? For our current builds with ASAN_OPTIONS=help=1, I'm not seeing "2" in the documentation:
Will it break if we set handle_signal=2 before we pick up the llvm change? |
It was introduced in r303941 |
before r303941 you can set allow_user_segv_handler=0 |
See also https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=1916#c7 I wonder if we can bump the llvm revision manually. |
It looks chromium llvm just got a bump to r305281: https://chromium.googlesource.com/chromium/src/+/3a26e05c70e63815c7c18284e5e006b9d0ac75af I'm guessing this is why the bug got marked as fixed just today? (because we don't have handle_signal=2) ? Let's explore pinning our own revision if this keeps coming up.. clang bumps in Chrome are usually done after a bunch of tests, so it would be nice if we could just piggy back off that. |
One alternative: bump the revisions manually, but only to the revisions tested by Chrome (unless there is a urgency like this one) |
Actually I don't see this as revision issues. |
argh, unfortunately we cannot just set handle_signal=2 everywhere, since we still need to run older builds for regression and fixed testing, and setting handle_signal=2 isn't backwards compatible and will break those things..... is there anything that can be done on the sanitizers side to make this feature more backwards compatible? For now we may need to roll back the clang revision, or wait for libFuzzer to be less aggressive about installing signal handlers. |
Discussed offline with @vitalybuka We need sanitizer options to be backwards compatible across builds. with handle_signal=2 unfortunately if we pass it to an older build we get a hard failure:
Adding new flags should be fine, because if we pass it to an older build we don't get a hard failure. @vitalybuka said he will make a compatibility fix soon Tracking this issue chromium side in https://bugs.chromium.org/p/chromium/issues/detail?id=731130#c10. If we don't get a revert there I'll manually pin our revision to the previous one. |
Summary: After r303941 it was not possible to setup ASAN_OPTIONS to have the same behavior for pre r303941 and post r303941 builds. Pre r303941 Asan does not accept handle_sigbus=2. Post r303941 Asan does not accept allow_user_segv_handler. This fix ignores allow_user_segv_handler=1, but for allow_user_segv_handler=0 it will upgrade flags like handle_sigbus=1 to handle_sigbus=2. So user can set ASAN_OPTIONS=allow_user_segv_handler=0 and have same behavior on old and new clang builds (except range from r303941 to this revision). In future users which need to prevent third party handlers should switch to handle_sigbus=2 and remove allow_user_segv_handler as soon as suport of older builds is not needed. Related bugs: google/oss-fuzz#675 https://bugs.chromium.org/p/chromium/issues/detail?id=731130 Reviewers: eugenis Subscribers: llvm-commits, kubamracek Differential Revision: https://reviews.llvm.org/D34227 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@305433 91177308-0d34-0410-b5e6-96231b3b80d8
What is the plan here ? |
Is the solution for this not for libFuzzer to do either of these things (that require POSIX signal.h and time.h) instead of using SIGALRM or other common signals:
|
Targets that install their own SIGALRM/SIGSEGV/SIGABRT etc handlers may prevent libFuzzer/sanitizers from reporting timeouts/crashes in a way that ClusterFuzz understands.
#671 is an example -- libreoffice targets fail quickly on a timeout, but because there's a SIGALRM handlers that exit silently our logs show that the target just exits after some time without any indication why.
We should explore if there is a good way to prevent this situation.
The text was updated successfully, but these errors were encountered: