-
Notifications
You must be signed in to change notification settings - Fork 37
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
ASAN fixes #1375
ASAN fixes #1375
Conversation
rsmmr
commented
Feb 11, 2023
- Skip clang-specific ASAN flags with other compilers.
- Fix ASAN false positive with GCC.
GCC reported false positives during stack switching for strings that were created for debug logging. This moves the affected string into a pre-allocated global constant. Closes #1310.
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.
This seems very subtle and a very specific workaround (we e.g., do not remove all allocations on these debug functions, only a few), so I'd really be curious if @awelzel can confirm the fix. Let's hope we do not break this again.
On merge this should be backported to release/1.5
and release/1.6
.
It does, thanks. The syslog and finger tests work without ASAN complaining. Digression: I could now also use that Zeek build for analyzer development. However, I just observed that when using an ASAN/Debug Zeek install, compile times for a small analyzer go from ~50seconds (Release, no ASAN build) to 1min 40 seconds. So, probably need to keep a release build for that around. Neither 1min 40sec nor 50sec is pleasant, but I take the faster one. |
My best guess is that we're hitting undefined behavior here, where the compiler just orders stuff differently. If that's the case, I'm not sure there's really a way to use those ASAN API functions for reporting stack switching robustly. |
And to be clear, I do think this is a false positive, I don't see anything we were doing wrong. |
Also backported to |