[compiler-rt] [llvm] [asan] Catch `initialization-order-fiasco` in modules without globals (PR #104621)

LLVM Continuous Integration via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 16 21:11:45 PDT 2024


llvm-ci wrote:

LLVM Buildbot has detected a new failure on builder `llvm-clang-x86_64-sie-win` running on `sie-win-worker` while building `compiler-rt,llvm` at step 7 "test-build-unified-tree-check-all".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/46/builds/3418

Here is the relevant piece of the build log for the reference:
```
Step 7 (test-build-unified-tree-check-all) failure: test (failure)
******************** TEST 'Clang :: CodeGen/sanitize-ignorelist-mainfile.c' FAILED ********************
Exit Code: 1

Command Output (stdout):
--
# RUN: at line 2
rm -rf Z:\b\llvm-clang-x86_64-sie-win\build\tools\clang\test\CodeGen\Output\sanitize-ignorelist-mainfile.c.tmp && split-file Z:\b\llvm-clang-x86_64-sie-win\llvm-project\clang\test\CodeGen\sanitize-ignorelist-mainfile.c Z:\b\llvm-clang-x86_64-sie-win\build\tools\clang\test\CodeGen\Output\sanitize-ignorelist-mainfile.c.tmp && cd Z:\b\llvm-clang-x86_64-sie-win\build\tools\clang\test\CodeGen\Output\sanitize-ignorelist-mainfile.c.tmp
# executed command: rm -rf 'Z:\b\llvm-clang-x86_64-sie-win\build\tools\clang\test\CodeGen\Output\sanitize-ignorelist-mainfile.c.tmp'
# executed command: split-file 'Z:\b\llvm-clang-x86_64-sie-win\llvm-project\clang\test\CodeGen\sanitize-ignorelist-mainfile.c' 'Z:\b\llvm-clang-x86_64-sie-win\build\tools\clang\test\CodeGen\Output\sanitize-ignorelist-mainfile.c.tmp'
# executed command: cd 'Z:\b\llvm-clang-x86_64-sie-win\build\tools\clang\test\CodeGen\Output\sanitize-ignorelist-mainfile.c.tmp'
# RUN: at line 3
z:\b\llvm-clang-x86_64-sie-win\build\bin\clang.exe -cc1 -internal-isystem Z:\b\llvm-clang-x86_64-sie-win\build\lib\clang\20\include -nostdsysteminc -emit-llvm -triple x86_64 -fsanitize=address,alignment a.c -o - | z:\b\llvm-clang-x86_64-sie-win\build\bin\filecheck.exe Z:\b\llvm-clang-x86_64-sie-win\llvm-project\clang\test\CodeGen\sanitize-ignorelist-mainfile.c --check-prefixes=CHECK,DEFAULT
# executed command: 'z:\b\llvm-clang-x86_64-sie-win\build\bin\clang.exe' -cc1 -internal-isystem 'Z:\b\llvm-clang-x86_64-sie-win\build\lib\clang\20\include' -nostdsysteminc -emit-llvm -triple x86_64 -fsanitize=address,alignment a.c -o -
# executed command: 'z:\b\llvm-clang-x86_64-sie-win\build\bin\filecheck.exe' 'Z:\b\llvm-clang-x86_64-sie-win\llvm-project\clang\test\CodeGen\sanitize-ignorelist-mainfile.c' --check-prefixes=CHECK,DEFAULT
# RUN: at line 4
z:\b\llvm-clang-x86_64-sie-win\build\bin\clang.exe -cc1 -internal-isystem Z:\b\llvm-clang-x86_64-sie-win\build\lib\clang\20\include -nostdsysteminc -emit-llvm -triple x86_64 -fsanitize=address,alignment -fsanitize-ignorelist=a.list a.c -o - | z:\b\llvm-clang-x86_64-sie-win\build\bin\filecheck.exe Z:\b\llvm-clang-x86_64-sie-win\llvm-project\clang\test\CodeGen\sanitize-ignorelist-mainfile.c --check-prefixes=CHECK,IGNORE
# executed command: 'z:\b\llvm-clang-x86_64-sie-win\build\bin\clang.exe' -cc1 -internal-isystem 'Z:\b\llvm-clang-x86_64-sie-win\build\lib\clang\20\include' -nostdsysteminc -emit-llvm -triple x86_64 -fsanitize=address,alignment -fsanitize-ignorelist=a.list a.c -o -
# executed command: 'z:\b\llvm-clang-x86_64-sie-win\build\bin\filecheck.exe' 'Z:\b\llvm-clang-x86_64-sie-win\llvm-project\clang\test\CodeGen\sanitize-ignorelist-mainfile.c' --check-prefixes=CHECK,IGNORE
# .---command stderr------------
# | Z:\b\llvm-clang-x86_64-sie-win\llvm-project\clang\test\CodeGen\sanitize-ignorelist-mainfile.c:35:16: error: IGNORE-NOT: excluded string found in input
# | // IGNORE-NOT: @___asan_gen_
# |                ^
# | <stdin>:9:1: note: found here
# |  at ___asan_gen_ = private constant [4 x i8] c"a.c\00", align 1
# | ^~~~~~~~~~~~~
# | 
# | Input file: <stdin>
# | Check file: Z:\b\llvm-clang-x86_64-sie-win\llvm-project\clang\test\CodeGen\sanitize-ignorelist-mainfile.c
# | 
# | -dump-input=help explains the following input dump.
# | 
# | Input was:
# | <<<<<<
# |             1: ; ModuleID = 'a.c' 
# |             2: source_filename = "a.c" 
# |             3: target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128" 
# |             4: target triple = "x86_64" 
# |             5:  
# |             6:  at global_h = global i32 0, no_sanitize_address, align 4 
# |             7:  at global_c = global i32 0, no_sanitize_address, align 4 
# |             8:  at llvm.used = appending global [1 x ptr] [ptr @asan.module_ctor], section "llvm.metadata" 
# |             9:  at ___asan_gen_ = private constant [4 x i8] c"a.c\00", align 1 
# | not:35         !~~~~~~~~~~~~                                                 error: no match expected
# |            10:  at llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 1, ptr @asan.module_ctor, ptr null }] 
# |            11:  
# |            12: ; Function Attrs: noinline nounwind optnone 
# |            13: define dso_local i32 @foo(ptr noundef %x) #0 { 
# |            14: entry: 
# |            15:  %x.addr = alloca ptr, align 8 
# |            16:  store ptr %x, ptr %x.addr, align 8 
...

```

https://github.com/llvm/llvm-project/pull/104621


More information about the llvm-commits mailing list