uftrace icon indicating copy to clipboard operation
uftrace copied to clipboard

memory leaks in t157

Open honggyukim opened this issue 3 years ago • 2 comments

$ make ASAN=1
$ cd tests
$ ./runtest.py -vdp -O0 157
Start 1 tests with 1 worker
Test case                 pg
------------------------: O0
build command: gcc -o t-abc -fno-inline -fno-builtin -fno-ipa-cp -fno-omit-frame-pointer -D_FORTIFY_SOURCE=0  -pg -O0  s-abc.c
prerun command: /home/honggyu/work/uftrace/git/uftrace/uftrace script --no-pager --no-event --libmcount-path=/home/honggyu/work/uftrace/git/uftrace -S /home/honggyu/work/uftrace/git/uftrace/scripts/count.py --record t-abc
test command: /home/honggyu/work/uftrace/git/uftrace/uftrace script --no-pager --no-event --libmcount-path=/home/honggyu/work/uftrace/git/uftrace -F main -S /home/honggyu/work/uftrace/git/uftrace/scripts/count.py t-abc

=================================================================
==21151==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 292384 byte(s) in 133 object(s) allocated from:
    #0 0x7f427122eca8 in malloc (/usr/lib/x86_64-linux-gnu/libasan.so.5+0x10bca8)
    #1 0x7f426b120424  (<unknown module>)

Direct leak of 768 byte(s) in 1 object(s) allocated from:
    #0 0x7f427122f0de in realloc (/usr/lib/x86_64-linux-gnu/libasan.so.5+0x10c0de)
    #1 0x7f426b1f20be  (<unknown module>)

Direct leak of 716 byte(s) in 1 object(s) allocated from:
    #0 0x7f427122eca8 in malloc (/usr/lib/x86_64-linux-gnu/libasan.so.5+0x10bca8)
    #1 0x7f426b2185e6  (<unknown module>)

Direct leak of 640 byte(s) in 1 object(s) allocated from:
    #0 0x7f427122eca8 in malloc (/usr/lib/x86_64-linux-gnu/libasan.so.5+0x10bca8)
    #1 0x7f426b1208df  (<unknown module>)

Direct leak of 536 byte(s) in 1 object(s) allocated from:
    #0 0x7f427122eca8 in malloc (/usr/lib/x86_64-linux-gnu/libasan.so.5+0x10bca8)
    #1 0x7f426b120e47  (<unknown module>)

Direct leak of 140 byte(s) in 4 object(s) allocated from:
    #0 0x7f427122eca8 in malloc (/usr/lib/x86_64-linux-gnu/libasan.so.5+0x10bca8)
    #1 0x7f426b1f1fbc  (<unknown module>)

Direct leak of 32 byte(s) in 1 object(s) allocated from:
    #0 0x7f427122eca8 in malloc (/usr/lib/x86_64-linux-gnu/libasan.so.5+0x10bca8)
    #1 0x7f426b18f8f4  (<unknown module>)

Indirect leak of 107818 byte(s) in 112 object(s) allocated from:
    #0 0x7f427122eca8 in malloc (/usr/lib/x86_64-linux-gnu/libasan.so.5+0x10bca8)
    #1 0x7f426b120424  (<unknown module>)

SUMMARY: AddressSanitizer: 403034 byte(s) leaked in 254 allocation(s).
t157_script_python: -pg -O0 returns 1

157 script_python       : NZ

honggyukim avatar Apr 29 '22 03:04 honggyukim

I'm not sure about this one. It seems the python runtime leaks the memory and we might not have the control.

namhyung avatar Apr 29 '22 22:04 namhyung

I found the same memory leaks in many tests. It might be from the same reason.

honggyukim avatar Apr 30 '22 05:04 honggyukim