This is an archive of the discontinued LLVM Phabricator instance.

[lsan] Add _os_trace into LSan's suppression list
ClosedPublic

Authored by kubamracek on Jul 8 2017, 4:13 PM.

Diff Detail

Repository
rL LLVM

Event Timeline

kubamracek created this revision.Jul 8 2017, 4:13 PM
fjricci accepted this revision.Jul 9 2017, 6:34 AM
This revision is now accepted and ready to land.Jul 9 2017, 6:34 AM
This revision was automatically updated to reflect the committed changes.
alekseyshl added inline comments.Jul 10 2017, 11:44 AM
compiler-rt/trunk/lib/lsan/lsan_common.cc
81

Minor, but I'd love to know a bit more of the context (is it a bug in some versions or design decision, is it going to be fixed or we're stuck with it forever etc.) and add #if SANITIZER_MAC around it?

kubamracek added inline comments.Jul 10 2017, 11:53 AM
compiler-rt/trunk/lib/lsan/lsan_common.cc
81

Oh, I'm sorry for not explaning more, I only to talked to @fjricci (who's the primary person for LSan on Darwin) in a private email about this.

I'm seeing multiple test failures in ASan tests, all of which are due to this LSan false positive. It only affects 10.12 systems, because it's specific to the new "unified logging" mechanism on 10.12, but the leak is only reported in specific versions of the OS. This is not a "real" solution, and I believe @fjricci is going to investigate if there's a better way of handling this. But since I'm having multiple test failures (not on public bots, though, they are all on 10.11), I wanted to land a "fix" even if means using the suppression list.

Here's some details about the problem:

Hi, these seem to be because again, some pointer(s) to a heap block is stored
in an unusal mmap'd piece of memory. This time, it's the "voucher" and
"firehose" features of xnu/libdispatch that support the new unified logging
mechanism on 10.12+. I think they interoperate with the kernel in a way that
the kernel maps a piece of memory and hands it over to libdispatch, which then
uses it to store some data, including a pointer to this heap block.

I will add a #if SANITIZER_MAC.

kubamracek added inline comments.Jul 10 2017, 11:56 AM
compiler-rt/trunk/lib/lsan/lsan_common.cc
81

Added the #if in r307567.

Yes, I'm going to look into handling this via memory region scanning, but it's possible (even likely) that the performance hit will be prohibitive.

alekseyshl edited edge metadata.Jul 10 2017, 12:47 PM

Thank you!