Skip to content

[OpenMP] Some libarcher tests fail on Ubuntu 22.04 when llvm-symbolizer is not found #170138

@luporl

Description

@luporl

Failed tests:

libarcher :: races/critical-unrelated.c
libarcher :: races/lock-nested-unrelated.c
libarcher :: races/lock-unrelated.c
libarcher :: races/parallel-simple.c
libarcher :: races/task-dependency.c
libarcher :: races/task-taskgroup-unrelated.c
libarcher :: races/task-taskwait-nested.c
libarcher :: races/task-two.c
libarcher :: races/taskwait-depend.c
libarcher :: task/task_late_fulfill.c

The failures in the tests above are the same. They use tsan and expect the addresses to have been converted to lines in its report.
But the CI machine doesn't have llvm-symbolizer available in PATH, so addr2line is used instead, but the Ubuntu 22.04 version doesn't support the DWARF used in the test programs:
addr2line: DWARF error: invalid or unhandled FORM value: 0x23

******************** TEST 'libarcher :: races/critical-unrelated.c' FAILED ********************
Exit Code: 1

Command Output (stdout):
--
# RUN: at line 13
/mnt/build/tools/clang/stage2-instrumented-bins/tools/clang/stage2-bins/./bin/clang -fopenmp  -gdwarf-4 -O1 -fsanitize=thread  -I /home/runner/work/llvm-project/llvm-project/openmp/tools/archer/tests -I /mnt/build/tools/clang/stage2-instrumented-bins/tools/clang/stage2-bins/runtimes/runtimes-bins/openmp/runtime/src -L /mnt/build/tools/clang/stage2-instrumented-bins/tools/clang/stage2-bins/runtimes/runtimes-bins/openmp/runtime/src -Wl,-rpath,/mnt/build/tools/clang/stage2-instrumented-bins/tools/clang/stage2-bins/runtimes/runtimes-bins/openmp/runtime/src   /home/runner/work/llvm-project/llvm-project/openmp/tools/archer/tests/races/critical-unrelated.c -o /mnt/build/tools/clang/stage2-instrumented-bins/tools/clang/stage2-bins/runtimes/runtimes-bins/openmp/tools/archer/tests/races/Output/critical-unrelated.c.tmp -latomic && env TSAN_OPTIONS='ignore_noninstrumented_modules=0:ignore_noninstrumented_modules=1' /home/runner/work/llvm-project/llvm-project/openmp/tools/archer/tests/deflake.bash /mnt/build/tools/clang/stage2-instrumented-bins/tools/clang/stage2-bins/runtimes/runtimes-bins/openmp/tools/archer/tests/races/Output/critical-unrelated.c.tmp 2>&1 | tee /mnt/build/tools/clang/stage2-instrumented-bins/tools/clang/stage2-bins/runtimes/runtimes-bins/openmp/tools/archer/tests/races/Output/critical-unrelated.c.tmp.log | /mnt/build/tools/clang/stage2-instrumented-bins/tools/clang/stage2-bins/./bin/FileCheck /home/runner/work/llvm-project/llvm-project/openmp/tools/archer/tests/races/critical-unrelated.c
# executed command: /mnt/build/tools/clang/stage2-instrumented-bins/tools/clang/stage2-bins/./bin/clang -fopenmp -gdwarf-4 -O1 -fsanitize=thread -I /home/runner/work/llvm-project/llvm-project/openmp/tools/archer/tests -I /mnt/build/tools/clang/stage2-instrumented-bins/tools/clang/stage2-bins/runtimes/runtimes-bins/openmp/runtime/src -L /mnt/build/tools/clang/stage2-instrumented-bins/tools/clang/stage2-bins/runtimes/runtimes-bins/openmp/runtime/src -Wl,-rpath,/mnt/build/tools/clang/stage2-instrumented-bins/tools/clang/stage2-bins/runtimes/runtimes-bins/openmp/runtime/src /home/runner/work/llvm-project/llvm-project/openmp/tools/archer/tests/races/critical-unrelated.c -o /mnt/build/tools/clang/stage2-instrumented-bins/tools/clang/stage2-bins/runtimes/runtimes-bins/openmp/tools/archer/tests/races/Output/critical-unrelated.c.tmp -latomic
# executed command: env TSAN_OPTIONS=ignore_noninstrumented_modules=0:ignore_noninstrumented_modules=1 /home/runner/work/llvm-project/llvm-project/openmp/tools/archer/tests/deflake.bash /mnt/build/tools/clang/stage2-instrumented-bins/tools/clang/stage2-bins/runtimes/runtimes-bins/openmp/tools/archer/tests/races/Output/critical-unrelated.c.tmp
# executed command: tee /mnt/build/tools/clang/stage2-instrumented-bins/tools/clang/stage2-bins/runtimes/runtimes-bins/openmp/tools/archer/tests/races/Output/critical-unrelated.c.tmp.log
# executed command: /mnt/build/tools/clang/stage2-instrumented-bins/tools/clang/stage2-bins/./bin/FileCheck /home/runner/work/llvm-project/llvm-project/openmp/tools/archer/tests/races/critical-unrelated.c
# .---command stderr------------
# | /home/runner/work/llvm-project/llvm-project/openmp/tools/archer/tests/races/critical-unrelated.c:37:16: error: CHECK-NEXT: expected string not found in input
# | // CHECK-NEXT: #0 {{.*}}critical-unrelated.c:29
# |                ^
# | <stdin>:4:17: note: scanning from here
# |  Write of size 4 at 0x7fff51c01cac by thread T4:
# |                 ^
# | <stdin>:5:17: note: possible intended match here
# |  #0 main.omp_outlined critical-unrelated.c:? (critical-unrelated.c.tmp+0xe9405)
# |                 ^
# | 
# | Input file: <stdin>
# | Check file: /home/runner/work/llvm-project/llvm-project/openmp/tools/archer/tests/races/critical-unrelated.c
# | 
# | -dump-input=help explains the following input dump.
# | 
# | Input was:
# | <<<<<<
# |            1: /usr/bin/addr2line: DWARF error: invalid or unhandled FORM value: 0x23 
# |            2: ================== 
# |            3: WARNING: ThreadSanitizer: data race (pid=1018671) 
# |            4:  Write of size 4 at 0x7fff51c01cac by thread T4: 
# | next:37'0                     X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ error: no match found
# |            5:  #0 main.omp_outlined critical-unrelated.c:? (critical-unrelated.c.tmp+0xe9405) 
# | next:37'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# | next:37'1                     ?                                                                possible intended match
# |            6:  #1 __kmp_invoke_microtask ??:? (libomp.so+0xec5d8) 
# | next:37'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            7:  #2 main ??:? (critical-unrelated.c.tmp+0x30393) 
# | next:37'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            8:  
# | next:37'0     ~
# |            9:  Previous write of size 4 at 0x7fff51c01cac by main thread: 
# | next:37'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |           10:  #0 main.omp_outlined critical-unrelated.c:? (critical-unrelated.c.tmp+0xe9405) 
# | next:37'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            .
# |            .
# |            .
# | >>>>>>
# `-----------------------------
# error: command failed with exit status: 1

The failure doesn't happen on Ubuntu 24.04, that has a more recent version of addr2line.
But as Ubuntu 22.04 is still used for releases, upgrading to 24.04 doesn't seem an option.

When llvm-symbolizer is available in PATH the issue also doesn't occur. Requiring another LLVM version to be installed and available in PATH doesn't seem reasonable, but maybe libarcher tests could adjust PATH instead, to use the just built version of llvm-symbolizer.

Another option could be changing the tests to use an older DWARF version, compatible with older addr2line.

More details at #160581 and https://github.com/llvm/llvm-project/actions/runs/19738643117/job/56556800778?pr=160581.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions