Closed Bug 1063011 Opened 10 years ago Closed 9 years ago

Handle new LSan failures introduced by Clang r214699

Categories

(Firefox Build System :: General, defect)

All
Linux
defect
Not set
major

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 1214463

People

(Reporter: decoder, Assigned: mccr8)

References

(Blocks 1 open bug)

Details

Attachments

(2 files)

In bug 1052439, we're planning to upgrade Clang to r214699 for ASan. An initial try run has shown at least one LSan failure during the build phase that hasn't been there before. There might be more in the build and tests later. We need to fix all of these before we can switch to the newer version.

The attached patch can be used to build with the new Clang instead of the old when pushing to try.
Blocks: LSan
The first try run I made (with LSan enabled) was here:

https://tbpl.mozilla.org/?tree=Try&rev=6e15a769f5e8
It looks like we're running some ICU executable during the build process to create some data file, and that is leaking.  What I don't understand is why LSan is running at all.  You have to make it run with  ASAN_OPTIONS="detect_leaks=1".  We add that by default for various test harness stuff, but I can't imagine how that would happen during the build step.  The fix here will just be to disable LSan during building.
Oh, that would explain it.  Thanks for the link.

I guess I'll have to figure out how to add the environment variable to the build system to disable it by default.  Though in a pinch backing out the trunk/lib/sanitizer_common/sanitizer_flags.cc changes should do it...
Component: Other → Build Config
Product: Release Engineering → Core
QA Contact: pmoore
Version: other → Trunk
Christian, what did you do to work around this issue?  I'm hitting it locally now on a new version of Clang. :)
Flags: needinfo?(choller)
I've "fixed" the issue in my try push as shown in the attached patch. Not sure if this is how we should fix it, but it disables LSan during the whole ICU build. After that, I didn't hit more LSan failures, but due to another bug I also didn't get a complete build yet.
Flags: needinfo?(choller)
FTR this is what we do in Chromium:

https://code.google.com/p/chromium/codesearch#chromium/src/build/sanitizers/sanitizer_options.cc&q=sanitizer%20options&sq=package:chromium&type=cs&l=5

This module that gets linked into every executable (including toolchain) and sets Chromium-specific defaults for sanitizer options, including detect_leaks=0. Then we override that with ASAN_OPTIONS when appropriate.
Depends on: 1152872
Can we land this ?

I don't want to compile my clang because it's a pain, and current version of clang in distros are hitting this.
Flags: needinfo?(choller)
We can either land the patch as attached or instead go for what Sergey posted (which would be a little more work).

Feel free to land the patch once a build system peer reviewed it.
Flags: needinfo?(choller)
Bug 1214463 is basically the same thing, and is farther along than this bug.
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → DUPLICATE
Product: Core → Firefox Build System
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: