Closed
Bug 1216354
Opened 9 years ago
Closed 9 years ago
Disable LSan leak checking by default in mozglue
Categories
(Firefox Build System :: General, defect)
Firefox Build System
General
Tracking
(firefox44 fixed)
RESOLVED
FIXED
mozilla44
Tracking | Status | |
---|---|---|
firefox44 | --- | fixed |
People
(Reporter: mccr8, Assigned: mccr8)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
(deleted),
patch
|
glandium
:
review+
|
Details | Diff | Splinter Review |
No description provided.
Assignee | ||
Updated•9 years ago
|
Summary: Explicitly disable leak checking in CPP unit tests → Explicitly disable LSan leak checking in CPP unit tests
Comment 1•9 years ago
|
||
Is there a good reason not to hold tests to the same standard as code? Seems like it'll make it easier for people to get into bad habits. Or is this just temporary, to get it stood up at all?
Assignee | ||
Comment 2•9 years ago
|
||
We do not currently run LSan for CPPunit tests (see bug 1026663). It just goes from being off by default in whatever we're using now for ASan to on by default in clang 3.7.
Assignee | ||
Comment 3•9 years ago
|
||
Actually, I think it makes more sense to just globally build in disabling leak checking. Individual tests can opt in by setting the environment variable. This will maintain the status quo with our current version of Clang. This is also apparently what Chromium does per bug 1063011 comment 7.
Summary: Explicitly disable LSan leak checking in CPP unit tests → Disable LSan leak checking by default in mozglue
Assignee | ||
Updated•9 years ago
|
Component: General → Build Config
Product: Testing → Core
Assignee | ||
Comment 4•9 years ago
|
||
Practically speaking, anybody who is trying to enable LSan for a new test will have to set an environment variable anyways to specify a whitelist file, so adding in detect_leaks=1 to ASAN_OPTIONS should not be a large burden.
Assignee | ||
Comment 5•9 years ago
|
||
This ensures that with Clang 3.7 we have the same default behavior for ASan in anything we build that links in mozglue: no leak checking is performed. I checked that we are still doing leak checking in Mochitests.
try run: https://treeherder.mozilla.org/#/jobs?repo=try&revision=5a92b2576959
Attachment #8677007 -
Flags: review?(mh+mozilla)
Comment 6•9 years ago
|
||
Comment on attachment 8677007 [details] [diff] [review]
Disable LSan leak checking by default in mozglue.
Review of attachment 8677007 [details] [diff] [review]:
-----------------------------------------------------------------
::: mozglue/build/AsanOptions.cpp
@@ +21,5 @@
> // while the other doesn't, ASan will report false positives.
> //
> extern "C" MOZ_ASAN_BLACKLIST
> const char* __asan_default_options() {
> + return "allow_user_segv_handler=1:alloc_dealloc_mismatch=0:detect_leaks=0";
What do these options apply to? the executable or library it's statically linked to only?
Assignee | ||
Comment 7•9 years ago
|
||
(In reply to Mike Hommey [:glandium] from comment #6)
> What do these options apply to? the executable or library it's statically
> linked to only?
I think the way it works is that ASan itself tries to call into that method, so it should just be whatever it gets linked to.
I don't think it answers your question, but for the curious, the code that deals with this in ASan is here:
http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/asan_flags.cc?view=markup
Comment 8•9 years ago
|
||
Let me formulate the question differently: how does this change not disable leak detection globally, since everything uses mozglue?
Assignee | ||
Comment 9•9 years ago
|
||
(In reply to Mike Hommey [:glandium] from comment #8)
> Let me formulate the question differently: how does this change not disable
> leak detection globally, since everything uses mozglue?
Oh I see. If the environment variable ASAN_OPTIONS is set, as it is any place where we do leak checking today, then the values set via the env var override those set by this function.
Comment 10•9 years ago
|
||
So we rely on ASAN_OPTIONS being set to a different value for leak detection to be enabled?
Assignee | ||
Comment 11•9 years ago
|
||
(In reply to Mike Hommey [:glandium] from comment #10)
> So we rely on ASAN_OPTIONS being set to a different value for leak detection
> to be enabled?
Yes. This makes the behavior the same in 3.7 as it is in whatever version we're using right now in automation (which defaults to having leak detection disabled).
In practice, almost anything complex we'd run leakchecking on would need a suppression file, which requires setting LSAN_OPTIONS, so setting an additional environment variable doesn't seem like a large burden.
Comment 12•9 years ago
|
||
Comment on attachment 8677007 [details] [diff] [review]
Disable LSan leak checking by default in mozglue.
Review of attachment 8677007 [details] [diff] [review]:
-----------------------------------------------------------------
Could you add a small comment in the code summarizing comments 9 to 11 ?
Attachment #8677007 -
Flags: review?(mh+mozilla) → review+
Comment 13•9 years ago
|
||
Assignee | ||
Comment 14•9 years ago
|
||
(In reply to Mike Hommey [:glandium] from comment #12)
> Could you add a small comment in the code summarizing comments 9 to 11 ?
Good idea. I've done that.
Status: NEW → RESOLVED
Closed: 9 years ago
status-firefox44:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla44
Updated•7 years ago
|
Product: Core → Firefox Build System
You need to log in
before you can comment on or make changes to this bug.
Description
•