llvm / llvm/llvm-project

Callstack contains no function names after upgrading from clang19 to clang20

Open
#170,658 0 comments 0 reactions 0 assignees View on GitHub
compiler-rt:asan packaging platform:linux
Dominant language
LLVM
Stars
40.5k
Forks
18.7k
PR merge metrics
PR metrics pending

Description

I have the following c program:

```
#include

int main (int argv, char **argc) {
malloc(20);
return 0;
}

```

if I compile it with clang16 I get this:

```
paolo@localhost:$ clang --version
clang version 16.0.6 (Red Hat 16.0.6-1.el9)
Target: x86_64-redhat-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
paolo@localhost:$ ASAN_OPTIONS=detect_leaks=1 clang -g -Wno-error=return-type-c-linkage -fsanitize=address -fno-omit-frame-pointer -fsanitize-recover=address test.cpp -o test16
paolo@localhost:$ ./test16

=================================================================
==1192377==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 20 byte(s) in 1 object(s) allocated from:
#0 0x4b80c2 in __interceptor_malloc (/test16+0x4b80c2) (BuildId: 03cc265ed41808a3267918ee42ee3fa71ae4aef0)
#1 0x4f39bf in main test.cpp:4:2
#2 0x7fd21176ceaf in __libc_start_call_main (/lib64/libc.so.6+0x3feaf) (BuildId: f3e223f668f8fccd242dc204be6d233c553a3c9b)

SUMMARY: AddressSanitizer: 20 byte(s) leaked in 1 allocation(s).
paolo@localhost:$
```

with clang20 I get this:
```
bash-5.1# clang --version
clang version 20.1.8 (RESF 20.1.8-3.el9)
Target: x86_64-redhat-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
Configuration file: /etc/clang/x86_64-redhat-linux-gnu-clang.cfg
bash-5.1# ASAN_OPTIONS=detect_leaks=1 clang -g -Wno-error=return-type-c-linkage -fsanitize=address -fno-omit-frame-pointer -fsanitize-recover=address test.cpp -o test20
bash-5.1# ./test20

=================================================================
==20406==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 20 byte(s) in 1 object(s) allocated from:
#0 0x0000004cf4f8 (/__w/bc/bc/bc/test20+0x4cf4f8) (BuildId: 18050817cfd11b133459e06abb6fc0940765a27a)
#1 0x00000051425f (/__w/bc/bc/bc/test20+0x51425f) (BuildId: 18050817cfd11b133459e06abb6fc0940765a27a)
#2 0x7fad318f960f (/lib64/libc.so.6+0x2a60f) (BuildId: e650335ac8463e9e58c04e07c6f36c5f826ed953)

SUMMARY: AddressSanitizer: 20 byte(s) leaked in 1 allocation(s).
bash-5.1#
```

As you can see, the function, filename and linenumber of the leak are not visible any longer.

I checked the docu and I couldn't find any other flag that I would have to set.

For both tests I run Rocky 9 linux.

Many thanks for your help.

Contributor guide

Open the contributing guide

Research direction

Reproduce the report with test.cpp and the shown clang16 and clang20 AddressSanitizer/LeakSanitizer commands on Rocky 9. Compare the generated leak stack traces and investigate the compiler or sanitizer symbolization path; done means function names, filenames, and line numbers are restored for the clang20 output.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, linux
Domain
compilers, operating-systems, testing-qa
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.