LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 10-19-2012, 09:47 AM   #1
guanx
Senior Member
 
Registered: Dec 2008
Posts: 1,177

Rep: Reputation: 235Reputation: 235Reputation: 235
Memory errors in Python?


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)
Attached Files
File Type: log valgrind_python.log (31.4 KB, 16 views)
 
Old 10-19-2012, 03:12 PM   #2
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: Fedora
Posts: 4,140

Rep: Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263
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
 
Old 10-19-2012, 08:29 PM   #3
angryfirelord
Member
 
Registered: Dec 2005
Distribution: Fedora, CentOS
Posts: 515

Rep: Reputation: 66
According to this post, it may not be a problem: http://stackoverflow.com/questions/1...n-memory-leaks
 
1 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Errors with fwfstab (Python) AGazzaz Linux - Software 8 09-24-2009 04:43 AM
python errors coffeedemon Linux - Newbie 2 05-07-2006 03:18 PM
Python Errors - Ipodder snowman156 Slackware 3 12-09-2004 09:47 PM
Bittorrent: python errors davoman Linux - Software 2 04-16-2004 02:45 PM
python errors xconspirisist Linux - Software 1 02-16-2004 06:00 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 02:45 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration