Uh oh!
There was an error while loading. Please reload this page.
Prefer signal handlers provided by a sanitizer runtime to those in std. - #69540
Prefer signal handlers provided by a sanitizer runtime to those in std.#69540tmiasko wants to merge 2 commits into
Conversation
rust-highfive
commented
Feb 28, 2020
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @sfackler (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
jsgf
commented
Feb 28, 2020
I think this only works if libstd is compiled with a santizer which doesn't happen by default. I think this check needs to be done at runtime - it should only install the the handler if there isn't one already (or chain to it in the non overflow case). |
Yes, those changes require recompilation of standard library, but it is Additionally, using sanitizer with uninstrumented standard library either |
sfackler
commented
Feb 29, 2020
In what context will these actually be picked up then? Does cargo-fuzz recompile the standard library with sanitizers for example? |
tmiasko
commented
Feb 29, 2020
When using cargo-fuzz does supports the |
Asan is not ideal with uninstrumented libstd but still completely usable and useful. That's particularly true for catching faults which requires no instrumentation to be useful. I don't think relying on build-std to get major parts of santizer functionality is necessary or desirable. Agree about msan and tsan but I think they're a separate case. |
tmiasko
commented
Mar 2, 2020
Thanks for clarification. If this approach doesn't solve the issue in your context I would suggest proposing the runtime variant independently |
cuviper
commented
Mar 4, 2020
See #69685 for a runtime check. |
Sanitizer runtimes install signal handlers for SIGBUS and SIGSEGV which
generate informative error reports. Use them in preference to those installed
by std.
The first commit introduces the use of
cfg_ifto select between differentsignal handlers implementations, no functional changes are intended there.
The second commit uses empty implementation when sanitizers are enabled.
Helps with #69524.