Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Yes, that is on my TODO list. Happy to do that before submission, but wanted to make sure this approach is fine before doing so.
The approach looks fine. Should we also put a <html></html> pair around the output, or do you want to treat it as a snippet?
Generally I don't think this would be used a standalone input, so maybe a snippet is better and the consumer can add whatever they want around. For my use-case this gets piped into pandoc to be converted to Markdown.
compiler-rt/test/hwasan/TestCases/hwasan_symbolize.cpp | ||
---|---|---|
2 ↗ | (On Diff #427193) | trying to think if this will run correctly on android, when the test binary runs on the device, but FileCheck runs on the host. Also, I think we push llvm-symbolizer to the device for online symbolization, you may need to disable it through HWASAN_OPTIONS. |
compiler-rt/test/hwasan/TestCases/hwasan_symbolize.cpp | ||
---|---|---|
2 ↗ | (On Diff #427193) | It does. What happens is that %t becomes the wrapper script (and the real binary becomes %t.real) that runs on the device. The whole pipeline specified here happens on the host. I ran this on Android. |
compiler-rt/test/hwasan/TestCases/hwasan_symbolize.cpp | ||
---|---|---|
2 ↗ | (On Diff #427193) | Good point on the HWASAN_OPTIONS. That makes it more resilient. |
Hi, the test you added, hwasan_symbolize.cpp seems to be causing a failure on the sanitizer buildbot (https://lab.llvm.org/buildbot/#/builders/37/builds/13022):
FAIL: HWAddressSanitizer-x86_64 :: TestCases/hwasan_symbolize.cpp (71 of 86) ******************** TEST 'HWAddressSanitizer-x86_64 :: TestCases/hwasan_symbolize.cpp' FAILED ******************** Script: -- : 'RUN: at line 1'; /b/sanitizer-x86_64-linux/build/clang_build/./bin/clang -m64 -gline-tables-only -fsanitize=hwaddress -fuse-ld=lld -fsanitize-hwaddress-experimental-aliasing -mllvm -hwasan-generate-tags-with-calls=1 -mllvm -hwasan-globals -mllvm -hwasan-use-short-granules -mllvm -hwasan-instrument-landing-pads=0 -mllvm -hwasan-instrument-personality-functions -Wl,--build-id -g /b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/hwasan/TestCases/hwasan_symbolize.cpp -o /b/sanitizer-x86_64-linux/build/clang_build/projects/compiler-rt/test/hwasan/X86_64/TestCases/Output/hwasan_symbolize.cpp.tmp : 'RUN: at line 2'; echo '[{"prefix": "'"$(realpath $(dirname /b/sanitizer-x86_64-linux/build/clang_build/projects/compiler-rt/test/hwasan/X86_64/TestCases/Output/hwasan_symbolize.cpp.tmp)/../../../../../../)"'/", "link": "http://test.invalid/{file}:{line}"}]' > /b/sanitizer-x86_64-linux/build/clang_build/projects/compiler-rt/test/hwasan/X86_64/TestCases/Output/hwasan_symbolize.cpp.tmp.linkify : 'RUN: at line 3'; env HWASAN_OPTIONS=disable_allocator_tagging=1:random_tags=0:fail_without_syscall_abi=0:symbolize=0 not /b/sanitizer-x86_64-linux/build/clang_build/projects/compiler-rt/test/hwasan/X86_64/TestCases/Output/hwasan_symbolize.cpp.tmp 2>&1 | hwasan_symbolize --html --symbols $(dirname /b/sanitizer-x86_64-linux/build/clang_build/projects/compiler-rt/test/hwasan/X86_64/TestCases/Output/hwasan_symbolize.cpp.tmp) --index | FileCheck /b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/hwasan/TestCases/hwasan_symbolize.cpp : 'RUN: at line 4'; env HWASAN_OPTIONS=disable_allocator_tagging=1:random_tags=0:fail_without_syscall_abi=0:symbolize=0 not /b/sanitizer-x86_64-linux/build/clang_build/projects/compiler-rt/test/hwasan/X86_64/TestCases/Output/hwasan_symbolize.cpp.tmp 2>&1 | hwasan_symbolize --html --linkify /b/sanitizer-x86_64-linux/build/clang_build/projects/compiler-rt/test/hwasan/X86_64/TestCases/Output/hwasan_symbolize.cpp.tmp.linkify --symbols $(dirname /b/sanitizer-x86_64-linux/build/clang_build/projects/compiler-rt/test/hwasan/X86_64/TestCases/Output/hwasan_symbolize.cpp.tmp) --index | FileCheck --check-prefixes=CHECK,LINKIFY /b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/hwasan/TestCases/hwasan_symbolize.cpp : 'RUN: at line 5'; env HWASAN_OPTIONS=disable_allocator_tagging=1:random_tags=0:fail_without_syscall_abi=0:symbolize=0 not /b/sanitizer-x86_64-linux/build/clang_build/projects/compiler-rt/test/hwasan/X86_64/TestCases/Output/hwasan_symbolize.cpp.tmp 2>&1 | hwasan_symbolize --symbols $(dirname /b/sanitizer-x86_64-linux/build/clang_build/projects/compiler-rt/test/hwasan/X86_64/TestCases/Output/hwasan_symbolize.cpp.tmp) --index | FileCheck /b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/hwasan/TestCases/hwasan_symbolize.cpp -- Exit Code: 2 Command Output (stderr): -- Traceback (most recent call last): File "/b/sanitizer-x86_64-linux/build/clang_build/./bin/hwasan_symbolize", line 19, in <module> import html ImportError: No module named html FileCheck error: '<stdin>' is empty. FileCheck command line: FileCheck /b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/hwasan/TestCases/hwasan_symbolize.cpp --
And also our internal linux buildbot is reporting a failure after this commit:
/home/siadmin/jenkins/w/opensource/opensource_build/working_dir/compiler-rt/test/hwasan/TestCases/hwasan_symbolize.cpp:17:14: error: LINKIFY: expected string not found in input // LINKIFY: <a href="http://test.invalid/compiler-rt/test/hwasan/TestCases/hwasan_symbolize.cpp:[[@LINE-1]]"> ^ <stdin>:1:1: note: scanning from here ==27214==ERROR: HWAddressSanitizer: tag-mismatch on address 0x680400000064 at pc 0x55d1c8f6e76b<br/> ^ <stdin>:1:1: note: with "@LINE-1" equal to "16" ==27214==ERROR: HWAddressSanitizer: tag-mismatch on address 0x680400000064 at pc 0x55d1c8f6e76b<br/> ^ <stdin>:6:68: note: possible intended match here #1 main in /home/siadmin/jenkins/w/opensource/opensource_build/working_dir/compiler-rt/test/hwasan/TestCases/hwasan_symbolize.cpp:16:10<br/> ^ Input file: <stdin> Check file: /home/siadmin/jenkins/w/opensource/opensource_build/working_dir/compiler-rt/test/hwasan/TestCases/hwasan_symbolize.cpp -dump-input=help explains the following input dump. Input was: <<<<<< 1: ==27214==ERROR: HWAddressSanitizer: tag-mismatch on address 0x680400000064 at pc 0x55d1c8f6e76b<br/> check:17'0 X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ error: no match found check:17'1 with "@LINE-1" equal to "16" 2: READ of size 1 at 0x680400000064 tags: 03/00 (ptr/mem) in thread T0<br/> check:17'0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 3: #0 SigTrap<0> in [hwasan_rtl]:0<br/> check:17'0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 4: -> CheckAddress<(__hwasan::ErrorAction)0, (__hwasan::AccessType)0, 0> in [hwasan_rtl]:0<br/> check:17'0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 5: -> __hwasan_load1 in /home/siadmin/jenkins/w/opensource/opensource_build/working_dir/compiler-rt/lib/hwasan/hwasan.cpp:445:0<br/> check:17'0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 6: #1 main in /home/siadmin/jenkins/w/opensource/opensource_build/working_dir/compiler-rt/test/hwasan/TestCases/hwasan_symbolize.cpp:16:10<br/> check:17'0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ check:17'2 ? possible intended match 7: #2 0x7fbc32907bf6 (/lib/x86_64-linux-gnu/libc.so.6+0x21bf6) (BuildId: ce450eb01a5e5acc7ce7b8c2633b02cc1093339e)<br/> check:17'0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 8: #3 _start in ??:0:0<br/> check:17'0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 9: <br/> check:17'0 ~~~~~~ 10: [0x680400000060,0x680400000080) is a small unallocated heap chunk; size: 32 offset: 4<br/> check:17'0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 11: <br/> check:17'0 ~~~~~~ . . . >>>>>>
Can you please take a look and revert if it will take some time to fix?
And also our internal linux buildbot is reporting a failure after this commit:
*snip*
I'm seeing this same failure when I run ninja check-hwasan in my local, fairly vanilla, cmake build.
I'm also seeing it on http://45.33.8.238/linux/75461/step_10.txt . Given the other report of breakage, I'll revert this for now until things are sorted out.
compiler-rt/test/hwasan/TestCases/hwasan_symbolize.cpp | ||
---|---|---|
5 ↗ | (On Diff #427491) | Do you know why this works? Normally (in clang and lld and llvm), you have to call llvm_config.add_tool_substitutions() for the binaries that you want lit to find in the build dir. compiler-rt doesn't seem to do this, and hwasan_symbolize seems to be found fine so it works somehow, but I don't know how. Could you explain it to me? |
Here's another bot this failed on, also doing a fairly vanilla cmake build: https://logs.chromium.org/logs/chromium/buildbucket/cr-buildbucket/8814940711487302321/+/u/package_clang/stdout?format=raw
Which version of Python are you running? html is apparently around since 3.2.
EDIT: oh, I misunderstood. "this error" being the FileCheck, not the import. Correct?
I'm running python 3.9.10.
As far as I can tell, there are 2 distinct errors:
- the import html error on https://lab.llvm.org/buildbot/#/builders/37/builds/13022
- FileCheck error seen on @dyung's internal bot, on my machine, and on my bot
compiler-rt/test/hwasan/TestCases/hwasan_symbolize.cpp | ||
---|---|---|
5 ↗ | (On Diff #427491) | When I run env in the test, build/bin is the first entry in path, so it makes sense that this works. |
compiler-rt/test/hwasan/TestCases/hwasan_symbolize.cpp | ||
---|---|---|
5 ↗ | (On Diff #427491) | That seems to be due to this in our lit cfg # Tweak PATH to include llvm tools dir. if (not config.llvm_tools_dir) or (not os.path.exists(config.llvm_tools_dir)): lit_config.fatal("Invalid llvm_tools_dir config attribute: %r" % config.llvm_tools_dir) path = os.path.pathsep.join((config.llvm_tools_dir, config.environment['PATH'])) config.environment['PATH'] = path |