[issue27831] Python 3.4.5 leaks memory when attempting to load non-existent file

2021-12-03 Thread Ammar Askar


Ammar Askar  added the comment:

Looks like this got fixed somewhere along between 3.5 and 3.6


---
3.5
---

./python: can't open file 'id:000109': [Errno 2] No such file or directory

=
==28078==ERROR: LeakSanitizer: detected memory leak



---
3.6
---

./python id:000109 
./python: can't open file 'id:000109': [Errno 2] No such file or directory


Closing as 3.5 is no longer a supported version.

--
nosy: +ammar2
resolution:  -> out of date
stage:  -> resolved
status: open -> closed
type:  -> behavior

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27831] Python 3.4.5 leaks memory when attempting to load non-existent file

2016-08-23 Thread koobs

Changes by koobs :


--
nosy: +koobs
versions: +Python 3.5, Python 3.6

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27831] Python 3.4.5 leaks memory when attempting to load non-existent file

2016-08-23 Thread geeknik

geeknik added the comment:

Sure, 3.5 and/or 3.6 has memory leaks during compilation:
https://bugs.python.org/issue27780

And I just compiled 3.5.2 and running that version of python against a 
non-existent file returns this from LeakSanitizer:

ASAN_SYMBOLIZER_PATH=/usr/lib/llvm-3.5/bin/llvm-symbolizer 
ASAN_OPTIONS=symbolizer=1 ./python garbage
./python: can't open file 'garbage': [Errno 2] No such file or directory

=
==5338==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 657546 byte(s) in 584 object(s) allocated from:
#0 0x4bd4ab in malloc (/root/python-3.5.2/python+0x4bd4ab)
#1 0x4db577 in PyMem_Malloc /root/python-3.5.2/Objects/obmalloc.c:325:12

Direct leak of 43896 byte(s) in 63 object(s) allocated from:
#0 0x4bd4ab in malloc (/root/python-3.5.2/python+0x4bd4ab)
#1 0x4de339 in PyMem_RawMalloc /root/python-3.5.2/Objects/obmalloc.c:293:12
#2 0x4de339 in _PyObject_Alloc /root/python-3.5.2/Objects/obmalloc.c:1376

Direct leak of 42520 byte(s) in 31 object(s) allocated from:
#0 0x4bd4ab in malloc (/root/python-3.5.2/python+0x4bd4ab)
#1 0x4db577 in PyMem_Malloc /root/python-3.5.2/Objects/obmalloc.c:325:12
#2 0x7e39df in _PyEval_EvalCodeWithName 
/root/python-3.5.2/Python/ceval.c:4018:14

Direct leak of 28160 byte(s) in 7 object(s) allocated from:
#0 0x4bd4ab in malloc (/root/python-3.5.2/python+0x4bd4ab)
#1 0x4db577 in PyMem_Malloc /root/python-3.5.2/Objects/obmalloc.c:325:12
#2 0x6535ab in set_add_entry /root/python-3.5.2/Objects/setobject.c:313:12

Direct leak of 3584 byte(s) in 15 object(s) allocated from:
#0 0x4bd79e in realloc (/root/python-3.5.2/python+0x4bd79e)
#1 0x4db6aa in PyMem_Realloc /root/python-3.5.2/Objects/obmalloc.c:343:12

Direct leak of 3584 byte(s) in 16 object(s) allocated from:
#0 0x4bd4ab in malloc (/root/python-3.5.2/python+0x4bd4ab)
#1 0x4db577 in PyMem_Malloc /root/python-3.5.2/Objects/obmalloc.c:325:12
#2 0x682a09 in type_call /root/python-3.5.2/Objects/typeobject.c:890:11

Direct leak of 448 byte(s) in 2 object(s) allocated from:
#0 0x4bd4ab in malloc (/root/python-3.5.2/python+0x4bd4ab)
#1 0x4db577 in PyMem_Malloc /root/python-3.5.2/Objects/obmalloc.c:325:12
#2 0x88e289 in _Py_InitializeEx_Private 
/root/python-3.5.2/Python/pylifecycle.c:377:14
#3 0x4e553f in Py_Main /root/python-3.5.2/Modules/main.c:669:5
#4 0x4dae5e in main /root/python-3.5.2/./Programs/python.c:65:11

Direct leak of 264 byte(s) in 2 object(s) allocated from:
#0 0x4bd4ab in malloc (/root/python-3.5.2/python+0x4bd4ab)
#1 0x4db577 in PyMem_Malloc /root/python-3.5.2/Objects/obmalloc.c:325:12
#2 0x4e553f in Py_Main /root/python-3.5.2/Modules/main.c:669:5
#3 0x4dae5e in main /root/python-3.5.2/./Programs/python.c:65:11

Direct leak of 96 byte(s) in 3 object(s) allocated from:
#0 0x4bd4ab in malloc (/root/python-3.5.2/python+0x4bd4ab)
#1 0x4db387 in PyMem_RawMalloc /root/python-3.5.2/Objects/obmalloc.c:293:12

Direct leak of 8 byte(s) in 1 object(s) allocated from:
#0 0x4bd4ab in malloc (/root/python-3.5.2/python+0x4bd4ab)
#1 0x4db577 in PyMem_Malloc /root/python-3.5.2/Objects/obmalloc.c:325:12
#2 0x4e5942 in Py_Main /root/python-3.5.2/Modules/main.c:693:5
#3 0x4dae5e in main /root/python-3.5.2/./Programs/python.c:65:11

Indirect leak of 124748 byte(s) in 133 object(s) allocated from:
#0 0x4bd4ab in malloc (/root/python-3.5.2/python+0x4bd4ab)
#1 0x4de339 in PyMem_RawMalloc /root/python-3.5.2/Objects/obmalloc.c:293:12
#2 0x4de339 in _PyObject_Alloc /root/python-3.5.2/Objects/obmalloc.c:1376

Indirect leak of 6016 byte(s) in 47 object(s) allocated from:
#0 0x4bd4ab in malloc (/root/python-3.5.2/python+0x4bd4ab)
#1 0x4db577 in PyMem_Malloc /root/python-3.5.2/Objects/obmalloc.c:325:12
#2 0x682a09 in type_call /root/python-3.5.2/Objects/typeobject.c:890:11

Indirect leak of 2912 byte(s) in 7 object(s) allocated from:
#0 0x4bd4ab in malloc (/root/python-3.5.2/python+0x4bd4ab)
#1 0x4db577 in PyMem_Malloc /root/python-3.5.2/Objects/obmalloc.c:325:12

Indirect leak of 640 byte(s) in 5 object(s) allocated from:
#0 0x4bd4ab in malloc (/root/python-3.5.2/python+0x4bd4ab)
#1 0x4db577 in PyMem_Malloc /root/python-3.5.2/Objects/obmalloc.c:325:12
#2 0x68dea1 in tp_new_wrapper 
/root/python-3.5.2/Objects/typeobject.c:5595:11

SUMMARY: AddressSanitizer: 914422 byte(s) leaked in 916 allocation(s).

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27831] Python 3.4.5 leaks memory when attempting to load non-existent file

2016-08-23 Thread R. David Murray

R. David Murray added the comment:

I'm not saying there isn't a leak, rather I'm trying to understand what you are 
reporting, without any understanding of ASN.  So I'm going to leave this to 
others to evaluate.

Also, do you see the same thing in 3.5 or 3.6?  We aren't patching 3.4 anymore 
(except for security issues).

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27831] Python 3.4.5 leaks memory when attempting to load non-existent file

2016-08-23 Thread geeknik

geeknik added the comment:

Interesting that only Python exhibits this "leaky" behavior that generates a 
LeakSanitizer error. I don't see similar behavior in Perl, Ruby or PHP. Running 
a non-ASAN build under Valgrind reports that a leak is still occurring: 

LEAK SUMMARY:
==15496==definitely lost: 0 bytes in 0 blocks
==15496==indirectly lost: 0 bytes in 0 blocks
==15496==  possibly lost: 19,784 bytes in 34 blocks
==15496==still reachable: 879,399 bytes in 862 blocks
==15496== suppressed: 0 bytes in 0 blocks
==15496==
==15496== ERROR SUMMARY: 98 errors from 40 contexts (suppressed: 0 from 0)

>From the Valgrind manual:
"possibly lost" means your program is leaking memory, unless you're doing 
unusual things with pointers that could cause them to point into the middle of 
an allocated block;

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27831] Python 3.4.5 leaks memory when attempting to load non-existent file

2016-08-23 Thread R. David Murray

R. David Murray added the comment:

How are you defining "leak"?  It isn't a leak if Python allocates memory that 
it doesn't free when doing a new operation.  If you do that operation 
repeatedly and memory use continues to increase, that would be a leak.

--
nosy: +r.david.murray

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27831] Python 3.4.5 leaks memory when attempting to load non-existent file

2016-08-22 Thread geeknik

New submission from geeknik:

While fuzzing Python 3.4.5 with AFL, ASAN and libdislocator, I fat fingered the 
keyboard ASAN pops up a LeakSanitizer error. Apparently trying to open a 
non-existent file causes Python 3.4.5 to leak >880KB of memory.

./python: can't open file 'id:000109': [Errno 2] No such file or directory

=
==16921==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 620904 byte(s) in 469 object(s) allocated from:
#0 0x4bc2db in malloc (/root/python-3.4.5/python+0x4bc2db)
#1 0x4da307 in PyMem_Malloc /root/python-3.4.5/Objects/obmalloc.c:299:12

Direct leak of 41800 byte(s) in 29 object(s) allocated from:
#0 0x4bc2db in malloc (/root/python-3.4.5/python+0x4bc2db)
#1 0x4da307 in PyMem_Malloc /root/python-3.4.5/Objects/obmalloc.c:299:12
#2 0x769b2f in PyEval_EvalCodeEx /root/python-3.4.5/Python/ceval.c:3588:14

Direct leak of 28160 byte(s) in 7 object(s) allocated from:
#0 0x4bc2db in malloc (/root/python-3.4.5/python+0x4bc2db)
#1 0x4da307 in PyMem_Malloc /root/python-3.4.5/Objects/obmalloc.c:299:12
#2 0x60459c in set_add_key /root/python-3.4.5/Objects/setobject.c:373:12

Direct leak of 26095 byte(s) in 33 object(s) allocated from:
#0 0x4bc2db in malloc (/root/python-3.4.5/python+0x4bc2db)
#1 0x4dc54d in PyMem_RawMalloc /root/python-3.4.5/Objects/obmalloc.c:276:12
#2 0x4dc54d in _PyObject_Malloc /root/python-3.4.5/Objects/obmalloc.c:1314

Direct leak of 18176 byte(s) in 31 object(s) allocated from:
#0 0x4bc2db in malloc (/root/python-3.4.5/python+0x4bc2db)
#1 0x4dc54d in PyMem_RawMalloc /root/python-3.4.5/Objects/obmalloc.c:276:12
#2 0x4dc54d in _PyObject_Malloc /root/python-3.4.5/Objects/obmalloc.c:1314
#3 0x8a80e9 in _PyObject_GC_NewVar 
/root/python-3.4.5/Modules/gcmodule.c:1765:26

Direct leak of 3584 byte(s) in 16 object(s) allocated from:
#0 0x4bc2db in malloc (/root/python-3.4.5/python+0x4bc2db)
#1 0x4da307 in PyMem_Malloc /root/python-3.4.5/Objects/obmalloc.c:299:12
#2 0x636d59 in type_call /root/python-3.4.5/Objects/typeobject.c:883:11

Direct leak of 1472 byte(s) in 15 object(s) allocated from:
#0 0x4bc5ce in realloc (/root/python-3.4.5/python+0x4bc5ce)
#1 0x4da38a in PyMem_Realloc /root/python-3.4.5/Objects/obmalloc.c:308:12

Direct leak of 448 byte(s) in 2 object(s) allocated from:
#0 0x4bc2db in malloc (/root/python-3.4.5/python+0x4bc2db)
#1 0x4da307 in PyMem_Malloc /root/python-3.4.5/Objects/obmalloc.c:299:12
#2 0x836b0e in _Py_InitializeEx_Private 
/root/python-3.4.5/Python/pythonrun.c:418:14
#3 0x4e2e82 in Py_Main /root/python-3.4.5/Modules/main.c:654:5
#4 0x4d9c8e in main /root/python-3.4.5/./Modules/python.c:69:11

Direct leak of 264 byte(s) in 2 object(s) allocated from:
#0 0x4bc2db in malloc (/root/python-3.4.5/python+0x4bc2db)
#1 0x4da307 in PyMem_Malloc /root/python-3.4.5/Objects/obmalloc.c:299:12
#2 0x4e2e82 in Py_Main /root/python-3.4.5/Modules/main.c:654:5
#3 0x4d9c8e in main /root/python-3.4.5/./Modules/python.c:69:11

Direct leak of 224 byte(s) in 1 object(s) allocated from:
#0 0x4bc2db in malloc (/root/python-3.4.5/python+0x4bc2db)
#1 0x4da307 in PyMem_Malloc /root/python-3.4.5/Objects/obmalloc.c:299:12
#2 0x546820 in _PyExc_Init /root/python-3.4.5/Objects/exceptions.c:2509:5
#3 0x836b09 in _Py_InitializeEx_Private 
/root/python-3.4.5/Python/pythonrun.c:416:5
#4 0x4e2e82 in Py_Main /root/python-3.4.5/Modules/main.c:654:5
#5 0x4d9c8e in main /root/python-3.4.5/./Modules/python.c:69:11

Direct leak of 224 byte(s) in 1 object(s) allocated from:
#0 0x4bc2db in malloc (/root/python-3.4.5/python+0x4bc2db)
#1 0x4da307 in PyMem_Malloc /root/python-3.4.5/Objects/obmalloc.c:299:12
#2 0x5468ad in _PyExc_Init /root/python-3.4.5/Objects/exceptions.c:2510:5
#3 0x836b09 in _Py_InitializeEx_Private 
/root/python-3.4.5/Python/pythonrun.c:416:5
#4 0x4e2e82 in Py_Main /root/python-3.4.5/Modules/main.c:654:5
#5 0x4d9c8e in main /root/python-3.4.5/./Modules/python.c:69:11

Direct leak of 224 byte(s) in 1 object(s) allocated from:
#0 0x4bc2db in malloc (/root/python-3.4.5/python+0x4bc2db)
#1 0x4da307 in PyMem_Malloc /root/python-3.4.5/Objects/obmalloc.c:299:12
#2 0x5e7712 in PyModule_Create2 
/root/python-3.4.5/Objects/moduleobject.c:105:9
#3 0x4e2e82 in Py_Main /root/python-3.4.5/Modules/main.c:654:5
#4 0x4d9c8e in main /root/python-3.4.5/./Modules/python.c:69:11

Direct leak of 224 byte(s) in 1 object(s) allocated from:
#0 0x4bc2db in malloc (/root/python-3.4.5/python+0x4bc2db)
#1 0x4da307 in PyMem_Malloc /root/python-3.4.5/Objects/obmalloc.c:299:12
#2 0x545fdf in _PyExc_Init /root/python-3.4.5/Objects/exceptions.c:2494:5
#3 0x836b09 in _Py_InitializeEx_Private 
/root/python-3.4.5/Python/pythonrun.c:416:5
#4 0x4e2e82 in Py_Main /root/python-3.4.5/Modules/main.c:654:5
#5 0x4d9c8e in main