SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I just tried to run Python from Slackware 14 with valgrind and saw a huge amount of errors. Is this a fault in Python or in valgrind?
Code:
$ valgrind python -c ""
==13793== Memcheck, a memory error detector
==13793== Copyright (C) 2002-2012, and GNU GPL'd, by Julian Seward et al.
==13793== Using Valgrind-3.8.1 and LibVEX; rerun with -h for copyright info
==13793== Command: python -c
==13793==
==13793== Invalid read of size 4
==13793== at 0x40AD1B1: PyObject_Free (in /usr/lib/libpython2.7.so.1.0)
==13793== by 0x62696C2E: ???
==13793== Address 0x44dd010 is 168 bytes inside a block of size 352 free'd
==13793== at 0x4029C14: free (vg_replace_malloc.c:446)
==13793== by 0x42E03AB: fclose@@GLIBC_2.1 (in /lib/libc-2.15.so)
==13793== by 0x412BAF7: ??? (in /usr/lib/libpython2.7.so.1.0)
==13793== by 0x62696C2E: ???
==13793==
==13793== Conditional jump or move depends on uninitialised value(s)
==13793== at 0x40AD1BA: PyObject_Free (in /usr/lib/libpython2.7.so.1.0)
==13793== by 0x415116D: PyObject_GC_Del (in /usr/lib/libpython2.7.so.1.0)
==13793== by 0x4077161: ??? (in /usr/lib/libpython2.7.so.1.0)
==13793== by 0x40C21EE: ??? (in /usr/lib/libpython2.7.so.1.0)
==13793== by 0x407726B: ??? (in /usr/lib/libpython2.7.so.1.0)
==13793== by 0x62696C2E: ???
==13793==
...
... and so on ...
... and so on ...
...
==13793==
==13793==
==13793== HEAP SUMMARY:
==13793== in use at exit: 1,009,659 bytes in 229 blocks
==13793== total heap usage: 9,076 allocs, 8,847 frees, 6,084,251 bytes allocated
==13793==
==13793== LEAK SUMMARY:
==13793== definitely lost: 0 bytes in 0 blocks
==13793== indirectly lost: 0 bytes in 0 blocks
==13793== possibly lost: 5,684 bytes in 16 blocks
==13793== still reachable: 1,003,975 bytes in 213 blocks
==13793== suppressed: 0 bytes in 0 blocks
==13793== Rerun with --leak-check=full to see details of leaked memory
==13793==
==13793== For counts of detected and suppressed errors, rerun with: -v
==13793== Use --track-origins=yes to see where uninitialised values come from
==13793== ERROR SUMMARY: 722 errors from 35 contexts (suppressed: 0 from 0)
Using the valgrind and python in RHEL 6.3 gives no errors:
Code:
# valgrind python -c ""
==28740== Memcheck, a memory error detector
==28740== Copyright (C) 2002-2010, and GNU GPL'd, by Julian Seward et al.
==28740== Using Valgrind-3.6.0 and LibVEX; rerun with -h for copyright info
==28740== Command: python -c
==28740==
==28740==
==28740== HEAP SUMMARY:
==28740== in use at exit: 764,828 bytes in 4,444 blocks
==28740== total heap usage: 16,926 allocs, 12,482 frees, 3,000,042 bytes allocated
==28740==
==28740== LEAK SUMMARY:
==28740== definitely lost: 0 bytes in 0 blocks
==28740== indirectly lost: 0 bytes in 0 blocks
==28740== possibly lost: 6,152 bytes in 13 blocks
==28740== still reachable: 758,676 bytes in 4,431 blocks
==28740== suppressed: 0 bytes in 0 blocks
==28740== Rerun with --leak-check=full to see details of leaked memory
==28740==
==28740== For counts of detected and suppressed errors, rerun with: -v
==28740== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 6 from 6)
# python -V
Python 2.6.6
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.