https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91203

            Bug ID: 91203
           Summary: __asan_set_error_report_callback has no effect on leak
                    messages
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: sanitizer
          Assignee: unassigned at gcc dot gnu.org
          Reporter: diane2332 at gmail dot com
                CC: dodji at gcc dot gnu.org, dvyukov at gcc dot gnu.org,
                    jakub at gcc dot gnu.org, kcc at gcc dot gnu.org, marxin at 
gcc dot gnu.org
  Target Milestone: ---

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.

I can attach a code sample, but it's pretty easy to create one.

Reply via email to