Adjust compiler-rt to prefer bundled llvm-symbolizer
Categories
(Firefox Build System :: Toolchains, enhancement)
Tracking
(firefox108 fixed)
Tracking | Status | |
---|---|---|
firefox108 | --- | fixed |
People
(Reporter: decoder, Assigned: decoder)
References
Details
Attachments
(2 files)
Currently, our compiler-rt patch modifies the llvm-symbolizer logic to use the bundled binary next to the firefox binary if no llvm-symbolizer can be found on PATH. This causes issues with outdated system llvm-symbolizer versions. Instead, we should first try to locate the llvm-symbolizer we ship and use that, then fall back to PATH.
Assignee | ||
Comment 1•2 years ago
|
||
Assignee | ||
Comment 2•2 years ago
|
||
The attached patch changes the lookup order as desired (and I tested this with a try build and the JS shell).
However, while testing that, I noticed that the llvm-symbolizer packaged (in this case with the JS shell) is not static:
$ ./js -e 'crash()'
AddressSanitizer:DEADLYSIGNAL
=================================================================
==1905188==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x559aeddc8b8c bp 0x7fffd39319b0 sp 0x7fffd39317c0 T0)
==1905188==The signal is caused by a WRITE memory access.
==1905188==Hint: address points to the zero page.
llvm-symbolizer: error while loading shared libraries: libLLVM-15.so: cannot open shared object file: No such file or directory
==1905188==WARNING: external symbolizer didn't start up correctly!
I don't think this is expected and would break ASan Nightly in particular? I remember this wasn't always the case.
Comment 3•2 years ago
|
||
This is the llvm-symbolizer that was built on the clang-15 landing: https://firefox-ci-tc.services.mozilla.com/api/queue/v1/task/KK9GdinxQHmjCxMHS0QJTA/runs/0/artifacts/public/build/llvm-symbolizer.tar.zst
$ ldd llvm-symbolizer/bin/llvm-symbolizer
linux-vdso.so.1 (0x00007ffdc59f0000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f38aad54000)
librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f38aad4a000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f38aad44000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f38aac00000)
libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f38aabe3000)
libstdc++.so.6 => /lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f38aaa16000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f38aa9fa000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f38aa825000)
/lib64/ld-linux-x86-64.so.2 (0x00007f38ab2a9000)
no dependency on libLLVM-15.so...
Comment 4•2 years ago
|
||
Comment 6•2 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/70a4325293f5
https://hg.mozilla.org/mozilla-central/rev/e14f128a212e
Comment 7•2 years ago
|
||
Backed out for causing spidermonkey exceptions on windows.
Failure log: https://firefox-ci-tc.services.mozilla.com/tasks/ZU1NOQ-RQyCYpZTcPcPtbg/runs/0/logs/public/logs/live.log#L262068
Backout link: https://hg.mozilla.org/integration/autoland/rev/f5d03cf76d746839856dc64a9df334a2c1c6b6c8
Comment 9•2 years ago
|
||
Backout merged to central: https://hg.mozilla.org/mozilla-central/rev/f5d03cf76d746839856dc64a9df334a2c1c6b6c8
Comment 10•2 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/ca1efbc996c3
https://hg.mozilla.org/mozilla-central/rev/e82e568425e5
Updated•2 years ago
|
Description
•