Closed
Bug 1426466
Opened 8 years ago
Closed 8 years ago
When linked with LLD, Firefox crashes on startup with "Assertion failure: !aOther.IsNull()" at TimeStamp.h:571
Categories
(Firefox Build System :: General, defect)
Firefox Build System
General
Tracking
(firefox59 affected)
RESOLVED
WORKSFORME
| Tracking | Status | |
|---|---|---|
| firefox59 | --- | affected |
People
(Reporter: botond, Unassigned)
References
(Blocks 1 open bug)
Details
STR:
1. Build a debug version of Firefox with:
ac_add_options --enable-linker=lld
ac_add_options --disable-elf-hack
2. Run the resulting build.
Actual results:
Firefox crashes on startup with the following assertion failure:
Program received signal SIGSEGV, Segmentation fault.
0x00000000002362dd in mozilla::TimeStamp::operator> (this=0x7fffffffbaf0, aOther=...) at /home/botond/dev/mozilla/central/objdir-desktop-clang/dist/include/mozilla/TimeStamp.h:571
571 MOZ_ASSERT(!aOther.IsNull(), "Cannot compute with aOther null value");
(gdb) i s
#0 0x00000000002362dd in mozilla::TimeStamp::operator>(mozilla::TimeStamp const&) const (this=0x7fffffffbaf0, aOther=...)
at /home/botond/dev/mozilla/central/objdir-desktop-clang/dist/include/mozilla/TimeStamp.h:571
#1 0x0000000000235f74 in mozilla::TimeStamp::ProcessCreation(bool*) (aIsInconsistent=0x0) at /home/botond/dev/mozilla/central/mozglue/misc/TimeStamp.cpp:73
#2 0x00007fffe98df760 in CorePS::CorePS() (this=0x7ffff6b48a00) at /home/botond/dev/mozilla/central/tools/profiler/core/platform.cpp:213
#3 0x00007fffe98d7ec9 in CorePS::Create(mozilla::BaseAutoLock<PSMutex> const&) (aLock=...) at /home/botond/dev/mozilla/central/tools/profiler/core/platform.cpp:235
#4 0x00007fffe98c12fa in profiler_init(void*) (aStackTop=0x7fffffffbf28) at /home/botond/dev/mozilla/central/tools/profiler/core/platform.cpp:2298
#5 0x00007fffe9de0c19 in mozilla::AutoProfilerInit::AutoProfilerInit(mozilla::detail::GuardObjectNotifier&&) (this=0x7fffffffbf28, _notifier=<unknown type in /home/botond/dev/mozilla/central/objdir-desktop-clang/dist/bin/libxul.so, CU 0x11e5eaf7, DIE 0x11e8ffea>) at /home/botond/dev/mozilla/central/objdir-desktop-clang/dist/include/GeckoProfiler.h:524
#6 0x00007fffe9ddcfd1 in XREMain::XRE_main(int, char**, mozilla::BootstrapConfig const&) (this=0x7fffffffbf78, argc=4, argv=0x7fffffffd308, aConfig=...)
at /home/botond/dev/mozilla/central/toolkit/xre/nsAppRunner.cpp:4758
#7 0x00007fffe9dde1ec in XRE_main(int, char**, mozilla::BootstrapConfig const&) (argc=4, argv=0x7fffffffd308, aConfig=...)
at /home/botond/dev/mozilla/central/toolkit/xre/nsAppRunner.cpp:4963
#8 0x00007fffe9df3fb7 in mozilla::BootstrapImpl::XRE_main(int, char**, mozilla::BootstrapConfig const&) (this=0x7ffff6b506a0, argc=4, argv=0x7fffffffd308, aConfig=...)
at /home/botond/dev/mozilla/central/toolkit/xre/Bootstrap.cpp:49
#9 0x000000000021672f in do_main(int, char**, char**) (argc=4, argv=0x7fffffffd308, envp=0x7fffffffd330) at /home/botond/dev/mozilla/central/browser/app/nsBrowserApp.cpp:231
#10 0x00000000002162fe in main(int, char**, char**) (argc=4, argv=0x7fffffffd308, envp=0x7fffffffd330) at /home/botond/dev/mozilla/central/browser/app/nsBrowserApp.cpp:304
This suggests sInitOnce.mFirstTimeStamp has not been initialized by the time TimeStamp::ProcessCreation() is called.
sInitOnce.mFirstTimeStamp is initialized by the constructor of sInitOnce, which is a global object, which should have been called by the time we get into main().
Updated•8 years ago
|
Blocks: linker-lld
| Reporter | ||
Comment 2•8 years ago
|
||
5.0.1 (and likewise for clang).
Updated•8 years ago
|
Product: Core → Firefox Build System
Comment 3•8 years ago
|
||
botond, is this still a problem? Bug 1473436 made lld the default on Linux...
Flags: needinfo?(botond)
| Reporter | ||
Comment 4•8 years ago
|
||
Hmm, I just tried pulling m-c and building (without --enable-linker=lld in my .mozconfig), and the build system used ld.gold to link libxul. I do have LLD installed.
| Reporter | ||
Comment 5•8 years ago
|
||
I'd debug the python code that chooses the linker by dropping an |import pdb; pdb.set_trace()| in it, but that doesn't seem to work any more:
ImportError: Importing modules is forbidden
How do you debug the build system these days?
| Reporter | ||
Comment 6•8 years ago
|
||
I tried |@imports('pdb')| above the function, but that just caused it to hang.
Comment 7•8 years ago
|
||
check config.log in your objdir.
| Reporter | ||
Comment 8•8 years ago
|
||
Thanks. The problem was that I was building with GCC. I guess GCC doesn't support LLD. (Yet?)
Comment 9•8 years ago
|
||
it does if you have a ld.lld binary in your PATH.
| Reporter | ||
Comment 10•8 years ago
|
||
I do have an ld.lld binary in my PATH. The config.log said something like "option -fuse-ld=lld not recognized, did you mean -fuse-ld=bfd", so maybe my GCC version (6.2) is too old to support it.
| Reporter | ||
Comment 11•8 years ago
|
||
Anyways, having successfuly built with clang + LLD, I no longer experience the mentioned startup crash. Closing as WORKSFORME.
Status: NEW → RESOLVED
Closed: 8 years ago
Flags: needinfo?(botond)
Resolution: --- → WORKSFORME
Comment 12•7 years ago
|
||
I started hitting this today after installing lld and running ./mach bootstrap.
I am on Ubuntu 17.10, clang --version is:
clang version 4.0.1-6 (tags/RELEASE_401/final)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
I tried installing clang-5.0 and lld-5.0, setting `export CC=clang-5.0 / CXX = clang++-5.0` in mozconfig and clobber building but it failed to compile with errors such as:
...
6:15.58 /usr/lib/llvm-5.0/lib/clang/5.0.0/include/avx512bwintrin.h:509:10: error: invalid conversion between vector type '__m512i' (vector of 8 'long long' values) and integer type 'int' of different size
6:15.58 return (__m512i)__builtin_ia32_packssdw512((__v16si)__A, (__v16si)__B);
...
I've reverted my mozconfig and uninstalled lld for now.
Comment 13•7 years ago
|
||
I guess I didn't actually uninstall lld since now I get:
/usr/lib/llvm-4.0/bin/ld.lld: error: /home/birtles/src2/dom/media/gmp-plugin-openh264/gmp-fake-openh264.cpp:425: undefined symbol 'operator new(unsigned long)'
I added:
ac_add_options --enable-linker=gold
to my mozconfig and now I can finally get a working build again.
You need to log in
before you can comment on or make changes to this bug.
Description
•