ASan build cannot find ASAN symbolizer when running test
Categories
(Testing :: Mozbase, defect)
Tracking
(firefox107 fixed)
Tracking | Status | |
---|---|---|
firefox107 | --- | fixed |
People
(Reporter: allstars.chh, Assigned: gbrown)
Details
Attachments
(2 files)
Build ASAN on Linux64 according to https://firefox-source-docs.mozilla.org/tools/sanitizer/asan.html
And export ASAN_SYMBOLIZER_PATH='path to llvm-symbolizer'
as mentioned in the doc.
To use it, just set the environment variable ASAN_SYMBOLIZER_PATH to reflect the location of your llvm-symbolizer binary, before running the process.
(My llvm-symbolizer is located in $HOME/.mozbuild/clang/bin/llvm-symbolizer)
Run now ./mach mochitest, or ./mach wpt
There will be an error message:
ERROR TEST-UNEXPECTED-FAIL | runtests.py | Failed to find ASan symbolizer at 'my_obj_dir'/dist/bin/llvm-symbolizer
('my_obj_dir' is the absolute path of the object directory)
The error message is from
https://searchfox.org/mozilla-central/rev/0948667bc62415d48abff27e1405fb4ab4d65d75/testing/mozbase/mozrunner/mozrunner/utils.py#162-169
And the code also looks strange, as it doesn't get the symbolzier path from the env variable 'ASAN_SYMBOLIZER_PATH', instead it uses $objdir/dist/bin/llvm-symbolizer directly.
Assignee | ||
Updated•2 years ago
|
Assignee | ||
Comment 1•2 years ago
|
||
Assignee | ||
Comment 2•2 years ago
|
||
:allstars.chh - Does this work for you? It should use ASAN_SYMBOLIZER_PATH, if set.
Reporter | ||
Comment 3•2 years ago
|
||
Yes, it fixes the problem, thanks.
BTW, you could find similar problems in other testing scripts, like gtest, cppunit, and xpcshell
see https://searchfox.org/mozilla-central/search?q=ASAN_SYMBOLIZER_PATH&path=testing%2F&case=false®exp=false
might be worthwhile to fix them at once.
I have a question regarding to the llvm-symbolizer, how come I don't have <objdir>/dist/bin/llvm-symbolizer. in my obj dir?
Do I need some special setup to have it installed in objdir?
And if I switch ASAN_SYMBOLIZER_PATH to asan_symbolize.py, the test won't run at all,
(the script is from https://github.com/llvm-mirror/compiler-rt/blob/master/lib/asan/scripts/asan_symbolize.py)
see https://pastebin.com/c6uEu3S0
Is this a known problem?
Thanks
Pushed by gbrown@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/1bde82f6bf43 Respect ASAN_SYMBOLIZER_PATH when running asan tests; r=jmaher
Assignee | ||
Comment 5•2 years ago
|
||
(In reply to Yoshi Cheng-Hao Huang [:allstars.chh][:allstarschh] from comment #3)
Yes, it fixes the problem, thanks.
Great!
BTW, you could find similar problems in other testing scripts, like gtest, cppunit, and xpcshell
see https://searchfox.org/mozilla-central/search?q=ASAN_SYMBOLIZER_PATH&path=testing%2F&case=false®exp=false
might be worthwhile to fix them at once.
I'll have a look and put together another patch.
I have a question regarding to the llvm-symbolizer, how come I don't have <objdir>/dist/bin/llvm-symbolizer. in my obj dir?
Do I need some special setup to have it installed in objdir?
I don't know. I used the mozconfig from https://firefox-source-docs.mozilla.org/tools/sanitizer/asan.html and it just worked.
And if I switch ASAN_SYMBOLIZER_PATH to asan_symbolize.py, the test won't run at all,
(the script is from https://github.com/llvm-mirror/compiler-rt/blob/master/lib/asan/scripts/asan_symbolize.py)see https://pastebin.com/c6uEu3S0
Is this a known problem?
Sorry, I don't know. I'm not very familiar with asan.
Assignee | ||
Updated•2 years ago
|
Assignee | ||
Comment 6•2 years ago
|
||
Assignee | ||
Updated•2 years ago
|
Pushed by gbrown@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/e0e02468d526 Respect ASAN_SYMBOLIZER_PATH when running asan cppunit/xpcshell/gtests; r=jmaher
Comment 8•2 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/1bde82f6bf43
https://hg.mozilla.org/mozilla-central/rev/e0e02468d526
Description
•