google / google/sanitizers

ASan doesn't print stats after an LSan report

Open
#334 4 comments 0 reactions 1 assignee Assigned to @vitalybuka View on GitHub
Priority-Medium ProjectAddressSanitizer Status-Accepted Type-Defect
Dominant language
C
Stars
12.5k
Forks
1.1k
PR merge metrics
No merged PRs in 30d

Description

Originally reported on Google Code with ID 334

```
$ cat t.c
#include
#include
int main() {
#ifndef NO_MALLOC
char *p = malloc(64);
printf("p: %p\n", p);
#endif
return 0;
}

$ clang t.c -fsanitize=address -o t -DNO_MALLOC
$ ASAN_OPTIONS=print_stats=1:atexit=1 ./t
AddressSanitizer exit stats:
Stats: 0M malloced (0M for red zones) by 0 calls
...
$ clang t.c -fsanitize=address -o t
$ ASAN_OPTIONS=print_stats=1:atexit=1 ./t
p: 0x60600000efc0

=================================================================
==19371==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 64 byte(s) in 1 object(s) allocated from:
#0 0x4a365b in __interceptor_malloc (/usr/local/google/ssd/chrome-git/src/t+0x4a365b)
#1 0x4c0e89 in main (/usr/local/google/ssd/chrome-git/src/t+0x4c0e89)
#2 0x7f2e3213178c in __libc_start_main /build/buildd/eglibc-2.15/csu/libc-start.c:226

SUMMARY: AddressSanitizer: 64 byte(s) leaked in 1 allocation(s).

(no stats printed)
```

Reported by `ramosian.glider` on 2014-08-19 14:44:15

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.