"make package" fails in ASan build using GCC 4.8.2

RESOLVED FIXED in Firefox 31

Status

defect
RESOLVED FIXED
5 years ago
Last year

People

(Reporter: gk, Assigned: gk)

Tracking

29 Branch
mozilla32
x86_64
Linux
Dependency tree / graph

Firefox Tracking Flags

(firefox31 fixed, firefox32 fixed)

Details

Attachments

(1 attachment)

Building Fx 29 with ASan enabled and GCC 4.8.2 I got (in the packaging step):

"Error: /path/to/build/obj-x86_64-unknown-linux-gnu/browser/installer/package-manifest:549: Missing files(s): bin/llvm-symbolizer"

Seems this got introduced by bug 917242.
OS: Windows 7 → Linux
Hardware: x86 → x86_64
you can probably just add to the #ifdef MOZ_ASAN a check we're using clang.  I'm not sure off hand if we already have a define for that, but if not adding one shouldn't be that hard.
(In reply to Trevor Saunders (:tbsaunde) from comment #1)
> you can probably just add to the #ifdef MOZ_ASAN a check we're using clang. 
> I'm not sure off hand if we already have a define for that, but if not
> adding one shouldn't be that hard.

That is one solution, yes. But maybe the smarter one is to have an option whether to add a symbolizer in the packaging step at all given that at least GCC 4.8.x has no own symbolizer yet and one probably can use clang's instead: http://tsdgeos.blogspot.de/2014/03/asan-and-gcc-how-to-get-line-numbers-in.html
Leaving the fact aside that we should fix this, why are you building with GCC anyway? As far as I know, the Clang support for ASan is much better and there's no reason not to use Clang, since we support it (and we even create release builds with it).
(In reply to Christian Holler (:decoder) from comment #3)
> Leaving the fact aside that we should fix this, why are you building with
> GCC anyway?

Because the browser we ship (Tor Browser) is just one part of a bundle containing a bunch of other software that is currently built with GCC. So it felt quite natural to not introduce an additional compiler in the build process but just upgrade the GCC version used. Especially as these ASan builds are currently only test builds for us.
Especially for testing I can highly recommend Clang. ASan isn't the only thing available there, you also get TSan, UBSan, LSan and some other checkers that GCC lacks. Not all of these are usable on Firefox, since our codebase has quite a few races and undefined behavior, but smaller programs can be tested quite well.
(In reply to Georg Koppen from comment #2)
> (In reply to Trevor Saunders (:tbsaunde) from comment #1)
> > you can probably just add to the #ifdef MOZ_ASAN a check we're using clang. 
> > I'm not sure off hand if we already have a define for that, but if not
> > adding one shouldn't be that hard.
> 
> That is one solution, yes. But maybe the smarter one is to have an option
> whether to add a symbolizer in the packaging step at all given that at least
> GCC 4.8.x has no own symbolizer yet and one probably can use clang's
> instead:
> http://tsdgeos.blogspot.de/2014/03/asan-and-gcc-how-to-get-line-numbers-in.
> html

judging by https://gcc.gnu.org/ml/gcc-patches/2013-12/msg00558.html I'd guess after gcc 4.8 your not going to need a symbolizer, so it hardly seems worth bothering.

(In reply to Christian Holler (:decoder) from comment #3)
> Leaving the fact aside that we should fix this, why are you building with
> GCC anyway? As far as I know, the Clang support for ASan is much better and

its certainly not going to get better if nobody uses it ;) but its kind of off topic.
Trying to follow the idea in comment 1: Including the llvm-symbolizer only if CLANG_CXX is defined. I tested this with my GCC setup and it worked.
Attachment #8428597 - Flags: review?(mh+mozilla)
Attachment #8428597 - Flags: review?(mh+mozilla) → review+
Assignee: nobody → gk
Status: NEW → ASSIGNED
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/98644e8a0e12
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla32
Comment on attachment 8428597 [details] [diff] [review]
Adding a CLANG_CXX check.

[Approval Request Comment]
Bug caused by (feature/regressing bug #): 917242
User impact if declined: Downstream builds based on ESR can't be hardened with GCC >= 4.8.x and get deployed
Testing completed (on m-c, etc.): nothing besides landing the patch on mozilla-inbound and m-c
Risk to taking this patch (and alternatives if risky): none
String or IDL/UUID changes made by this patch: none
Attachment #8428597 - Flags: approval-mozilla-aurora?
Comment on attachment 8428597 [details] [diff] [review]
Adding a CLANG_CXX check.

Aurora approval granted.
Attachment #8428597 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
Depends on: 1020590
Product: Core → Firefox Build System
You need to log in before you can comment on or make changes to this bug.