Closed Bug 1798865 Opened 2 years ago Closed 2 years ago

Adjust compiler-rt to prefer bundled llvm-symbolizer

Categories

(Firefox Build System :: Toolchains, enhancement)

All
Linux
enhancement

Tracking

(firefox108 fixed)

RESOLVED FIXED
108 Branch
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.

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.

Flags: needinfo?(mh+mozilla)

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...

Flags: needinfo?(mh+mozilla)
Pushed by mh@glandium.org: https://hg.mozilla.org/integration/autoland/rev/70a4325293f5 Adjust llvm-symbolizer lookup order. r=glandium,andi https://hg.mozilla.org/integration/autoland/rev/e14f128a212e Use the right llvm-symbolizer on spidermonkey builds. r=decoder
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 108 Branch
Pushed by mh@glandium.org: https://hg.mozilla.org/integration/autoland/rev/ca1efbc996c3 Adjust llvm-symbolizer lookup order. r=glandium,andi https://hg.mozilla.org/integration/autoland/rev/e82e568425e5 Use the right llvm-symbolizer on spidermonkey builds. r=decoder
Status: REOPENED → RESOLVED
Closed: 2 years ago2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 108 Branch
Flags: needinfo?(mh+mozilla)
Regressions: 1869128
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: