[compiler-rt] [compiler-rt][asan] Allow optional leading dot in function names in complete_stack_trace.c (PR #227969)
via llvm-commits
llvm-commits at lists.llvm.org
Wed Sep 30 23:13:51 PDT 2026
llvmorg-github-actions[bot] wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-compiler-rt-sanitizer
Author: Riyaz Ahmad (riyaz86a)
<details>
<summary>Changes</summary>
On AIX/XCOFF, the symbolizer reports function names with a leading dot ('.') because each function's executable code is stored in a separate `.<funcname>` csect (the text-section entry point symbol). For example, `read_2` is reported as `.read_2`.
The existing CHECK patterns required an exact match on the bare name, causing the test to fail on AIX:
```
expected: {{ *#<!-- -->1 0x.* in read_2 .*complete_stack_trace.c}}
actual: #<!-- -->1 0x... in .read_2 complete_stack_trace.c:23
```
Use `\.?` inside the FileCheck regex blocks to make the leading dot optional, matching both ELF (bare name) and XCOFF (dot-prefixed name) symbolizer output.
---
Full diff: https://github.com/llvm/llvm-project/pull/227969.diff
1 Files Affected:
- (modified) compiler-rt/test/asan/TestCases/complete_stack_trace.c (+12-12)
``````````diff
diff --git a/compiler-rt/test/asan/TestCases/complete_stack_trace.c b/compiler-rt/test/asan/TestCases/complete_stack_trace.c
index 778f39a4d65ae..91d7ed380b1a1 100644
--- a/compiler-rt/test/asan/TestCases/complete_stack_trace.c
+++ b/compiler-rt/test/asan/TestCases/complete_stack_trace.c
@@ -35,19 +35,19 @@ int main() {
// CHECK: ERROR: AddressSanitizer: heap-use-after-free on address
// CHECK: READ of size 1 at 0x{{.*}} thread T0
-// CHECK-NEXT: {{ *#0 0x.* in read_3 .*complete_stack_trace.c}}
-// CHECK-NEXT: {{ *#1 0x.* in read_2 .*complete_stack_trace.c}}
-// CHECK-NEXT: {{ *#2 0x.* in read_1 .*complete_stack_trace.c}}
-// CHECK-NEXT: {{ *#3 0x.* in main .*complete_stack_trace.c:}}[[@LINE-12]]
+// CHECK-NEXT: {{ *#0 0x.* in \.?read_3 .*complete_stack_trace.c}}
+// CHECK-NEXT: {{ *#1 0x.* in \.?read_2 .*complete_stack_trace.c}}
+// CHECK-NEXT: {{ *#2 0x.* in \.?read_1 .*complete_stack_trace.c}}
+// CHECK-NEXT: {{ *#3 0x.* in \.?main .*complete_stack_trace.c:}}[[@LINE-12]]
// CHECK: freed by thread T0 here:
-// CHECK: {{ *#[0-9]+ 0x.* in free_3 .*complete_stack_trace.c}}
-// CHECK-NEXT: {{ *#[0-9]+ 0x.* in free_2 .*complete_stack_trace.c}}
-// CHECK-NEXT: {{ *#[0-9]+ 0x.* in free_1 .*complete_stack_trace.c}}
-// CHECK-NEXT: {{ *#[0-9]+ 0x.* in main .*complete_stack_trace.c:}}[[@LINE-19]]
+// CHECK: {{ *#[0-9]+ 0x.* in \.?free_3 .*complete_stack_trace.c}}
+// CHECK-NEXT: {{ *#[0-9]+ 0x.* in \.?free_2 .*complete_stack_trace.c}}
+// CHECK-NEXT: {{ *#[0-9]+ 0x.* in \.?free_1 .*complete_stack_trace.c}}
+// CHECK-NEXT: {{ *#[0-9]+ 0x.* in \.?main .*complete_stack_trace.c:}}[[@LINE-19]]
// CHECK: previously allocated by thread T0 here:
-// CHECK: {{ *#[0-9]+ 0x.* in alloc_3 .*complete_stack_trace.c}}
-// CHECK-NEXT: {{ *#[0-9]+ 0x.* in alloc_2 .*complete_stack_trace.c}}
-// CHECK-NEXT: {{ *#[0-9]+ 0x.* in alloc_1 .*complete_stack_trace.c}}
-// CHECK-NEXT: {{ *#[0-9]+ 0x.* in main .*complete_stack_trace.c:}}[[@LINE-26]]
+// CHECK: {{ *#[0-9]+ 0x.* in \.?alloc_3 .*complete_stack_trace.c}}
+// CHECK-NEXT: {{ *#[0-9]+ 0x.* in \.?alloc_2 .*complete_stack_trace.c}}
+// CHECK-NEXT: {{ *#[0-9]+ 0x.* in \.?alloc_1 .*complete_stack_trace.c}}
+// CHECK-NEXT: {{ *#[0-9]+ 0x.* in \.?main .*complete_stack_trace.c:}}[[@LINE-26]]
``````````
</details>
https://github.com/llvm/llvm-project/pull/227969
More information about the llvm-commits
mailing list