https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91203
Martin Liška <marxin at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |NEW Assignee|marxin at gcc dot gnu.org |unassigned at gcc dot gnu.org --- Comment #2 from Martin Liška <marxin at gcc dot gnu.org> --- (In reply to Diane Meirowitz from comment #0) > I can capture ASan error messages with a function set in > > __asan_set_error_report_callback > > Unfortunately this does nothing for any messages coming from LeakSanitizer, > even though it is included in -fsanitize=address. This is a serious problem > because the large code that I'm working on redirects stderr to /dev/null, so > it took a while to even realize that there must be some leaks in this code. > Yes we can set LSAN_OPTIONS to log_path=..., but what we really want to do > is to be able to capture the leak errors just like we are capturing the > buffer overflow messages and redirect them to internal handlers. > > First of all, this must be documented. > > Second it would be really awesome to have LeakSanitizer call the callback > function set in __asan_set_error_report_callback. If this doesn't make sense > for LSan, please provide __lsan_set_error_report_callback instead. You are right, LSAN does not provide such a callback. Please create an upstream feature request here: https://github.com/google/sanitizers/issues > > I can attach a code sample, but it's pretty easy to create one.