[New-bugs-announce] [issue43303] ASAN : Memory leak in compilation

Ramin Farajpour Cami report at bugs.python.org
Tue Feb 23 00:57:00 EST 2021


New submission from Ramin Farajpour Cami <ramin.blackhat at gmail.com>:

Hi,


Asan has detected a memory leak :

$ wget https://github.com/python/cpython/archive/v3.9.2.tar.gz
$ tar xvf v3.9.2.tar.gz
$ ./configure --disable-shared CFLAGS="-fsanitize=address -ggdb" CXXFLAGS="-fsanitize=address -ggdb" LDFLAGS="-fsanitize=address"
$ make -j4
$ ~/cpython-3.9.2# ./python -E -S -m sysconfig --generate-posix-vars

=================================================================
==330505==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 300082 byte(s) in 137 object(s) allocated from:
    #0 0x7f647a692bc8 in malloc (/lib/x86_64-linux-gnu/libasan.so.5+0x10dbc8)
    #1 0x55a58e972015 in PyMem_RawMalloc Objects/obmalloc.c:572
    #2 0x55a58e972015 in _PyObject_Malloc Objects/obmalloc.c:1645
    #3 0x55a58e972015 in _PyObject_Malloc Objects/obmalloc.c:1638

Direct leak of 2066 byte(s) in 2 object(s) allocated from:
    #0 0x7f647a692ffe in __interceptor_realloc (/lib/x86_64-linux-gnu/libasan.so.5+0x10dffe)
    #1 0x55a58e9c9e7d in resize_compact Objects/unicodeobject.c:1079

Direct leak of 672 byte(s) in 1 object(s) allocated from:
    #0 0x7f647a692ffe in __interceptor_realloc (/lib/x86_64-linux-gnu/libasan.so.5+0x10dffe)
    #1 0x55a58eb6c620 in _PyObject_GC_Resize Modules/gcmodule.c:2297

Indirect leak of 110001 byte(s) in 115 object(s) allocated from:
    #0 0x7f647a692bc8 in malloc (/lib/x86_64-linux-gnu/libasan.so.5+0x10dbc8)
    #1 0x55a58e972015 in PyMem_RawMalloc Objects/obmalloc.c:572
    #2 0x55a58e972015 in _PyObject_Malloc Objects/obmalloc.c:1645
    #3 0x55a58e972015 in _PyObject_Malloc Objects/obmalloc.c:1638

Indirect leak of 536 byte(s) in 1 object(s) allocated from:
    #0 0x7f647a692bc8 in malloc (/lib/x86_64-linux-gnu/libasan.so.5+0x10dbc8)
    #1 0x55a58e972382 in _PyObject_Malloc Objects/obmalloc.c:572
    #2 0x55a58e972382 in pymalloc_realloc Objects/obmalloc.c:1988
    #3 0x55a58e972382 in _PyObject_Realloc Objects/obmalloc.c:2007

SUMMARY: AddressSanitizer: 413357 byte(s) leaked in 256 allocation(s).


Thanks,
Ramin

----------
components: Build
messages: 387551
nosy: Ramin Farajpour Cami
priority: normal
severity: normal
status: open
title: ASAN : Memory leak in compilation
type: resource usage
versions: Python 3.10, Python 3.8, Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue43303>
_______________________________________


More information about the New-bugs-announce mailing list