Author vstinner
Recipients ajaksu2, akuchling, belopolsky, benjamin.peterson, brett.cannon, georg.brandl, kristjan.jonsson, loewis, meador.inge, skrah, vstinner
Date 2012-03-25.23:20:32
SpamBayes Score 1.10427e-10
Marked as misclassified No
Message-id <1332717633.83.0.651865680615.issue3367@psf.upfronthosting.co.za>
In-reply-to
Content
I'm unable to reproduce this error:
----------
$ valgrind --db-attach=yes --suppressions=Misc/valgrind-python.supp ./python 
Python 3.3.0a1+ (default:0554183066b5, Mar 20 2012, 10:47:41) 
...
==20258== Invalid read of size 8
==20258==    at 0x4C9F6F: sys_update_path (sysmodule.c:1742)
==20258==    by 0x4CA268: PySys_SetArgvEx (sysmodule.c:1830)
...
----------

My try:
----------
$ ./configure --with-pydebug --with-valgrind && make
(...)
$ valgrind --suppressions=Misc/valgrind-python.supp ./python 
==10692== Memcheck, a memory error detector
==10692== Copyright (C) 2002-2010, and GNU GPL'd, by Julian Seward et al.
==10692== Using Valgrind-3.6.1 and LibVEX; rerun with -h for copyright info
==10692== Command: ./python
==10692== 
Python 3.3.0a1+ (default:f8d01c8baf6a+, Mar 26 2012, 01:12:33) 
[GCC 4.6.2 20111027 (Red Hat 4.6.2-1)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> 1+1
2
>>> 
==10692== 
==10692== HEAP SUMMARY:
==10692==     in use at exit: 2,896,586 bytes in 14,491 blocks
==10692==   total heap usage: 86,344 allocs, 71,853 frees, 12,370,023 bytes allocated
==10692== 
==10692== LEAK SUMMARY:
==10692==    definitely lost: 0 bytes in 0 blocks
==10692==    indirectly lost: 0 bytes in 0 blocks
==10692==      possibly lost: 2,779,467 bytes in 14,287 blocks
==10692==    still reachable: 117,119 bytes in 204 blocks
==10692==         suppressed: 0 bytes in 0 blocks
==10692== Rerun with --leak-check=full to see details of leaked memory
==10692== 
==10692== For counts of detected and suppressed errors, rerun with: -v
==10692== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 2 from 2)
----------

sysmodule.patch	looks to be useless: n is not used if argc <= 0.

At the revision 0554183066b5, sysmodule.c:1742 is the following line:
    if (argc > 0) {
but sysmodule.c:1830 is:
    if (av == NULL)
whereas it should be:
        sys_update_path(argc, argv);

Stephan: can you redo the Valgrind test on copy the exact line where the invalid read occurs (in sysmodule.c).
History
Date User Action Args
2012-03-25 23:20:34vstinnersetrecipients: + vstinner, loewis, akuchling, brett.cannon, georg.brandl, belopolsky, kristjan.jonsson, ajaksu2, benjamin.peterson, skrah, meador.inge
2012-03-25 23:20:33vstinnersetmessageid: <1332717633.83.0.651865680615.issue3367@psf.upfronthosting.co.za>
2012-03-25 23:20:33vstinnerlinkissue3367 messages
2012-03-25 23:20:32vstinnercreate