[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: memory debugging and C++ (program keeps crashing)



On Mon, Sep 30, 2002 at 09:37:14AM +0530, Ganesan R wrote:
> Recompile it for stable. Seriously. This is by far the best malloc
> debugger I've used in Linux. After using Purify on Solaris, I have
> been searching for a tool that's as easy to use and has equivalent
> capabilities. With valgrind, I am satisfied that I have found one :-). 

So far I am not entirely impressed.

For instance, just running ls -l reports a number of errors.
(maybe all system libraries should be checked and debugged? Most
of these look like libc6 problems, eg freeing mutex still it use).

However, it just doesn't like my program:

--- cut ---
==1431== valgrind-1.0.0, a memory error detector for x86 GNU/Linux.
==1431== Copyright (C) 2000-2002, and GNU GPL'd, by Julian Seward.
==1431== Estimated CPU clock rate is 846 MHz
==1431== For more details, rerun with: -v
==1431== 
==1431== pthread_mutex_unlock: mutex is not locked
==1431==    at 0x4048660F: __pthread_mutex_unlock (vg_libpthread.c:831)
==1431==    by 0x40312F55: (within /usr/lib/libgnomemm-1.2.so.9.0.3)
==1431==    by 0x400431B2: (within /usr/lib/valgrind/valgrind.so)
==1431==    by 0x40043055: (within /usr/lib/valgrind/valgrind.so)
==1431== 
==1431== pthread_mutex_destroy: mutex is still in use
==1431==    at 0x40485858: pthread_error (vg_libpthread.c:233)
==1431==    by 0x40486671: __pthread_mutex_destroy (vg_libpthread.c:848)
==1431==    by 0x40A8B940: (within /lib/libc-2.2.5.so)
==1431==    by 0x40A898F7: (within /lib/libc-2.2.5.so)
==1431== 
==1431== Syscall param write(buf) contains uninitialised or unaddressable byte(s)
==1431==    at 0x40AE33E4: (within /lib/libc-2.2.5.so)
==1431==    by 0x4064398B: (within /usr/X11R6/lib/libICE.so.6.3)
==1431==    by 0x40644653: (within /usr/X11R6/lib/libICE.so.6.3)
==1431==    by 0x4063C1FC: (within /usr/X11R6/lib/libICE.so.6.3)
==1431==    Address 0x41ECACCB is 3 bytes inside a block of size 1024 alloc'd
==1431==    at 0x4004328B: malloc (vg_clientfuncs.c:100)
==1431==    by 0x40639410: (within /usr/X11R6/lib/libICE.so.6.3)
==1431==    by 0x4062F301: (within /usr/X11R6/lib/libSM.so.6.0)
==1431==    by 0x404D3C77: (within /usr/lib/libgnomeui.so.32.14.1)
vg_get_memory_from_mmap failed on request of 1852080128

valgrind: the `impossible' happened:
   vg_get_memory_from_mmap: out of memory!  Fatal!  Bye!

Basic block ctr is approximately 8600000

sched status:

Thread 1: status = Runnable, associated_mx = 0x0, associated_cv = 0x0
==1431==    at 0x4004328B: malloc (vg_clientfuncs.c:100)
==1431==    by 0x409A45F9: (within /usr/lib/libglib-1.2.so.0.0.10)
==1431==    by 0x4026EA83: (within /usr/lib/libORBit.so.0.5.16)
==1431==    by 0x4026EA53: (within /usr/lib/libORBit.so.0.5.16)

Please report this bug to me at: jseward@acm.org
--- cut ---

Just in case anyone asks, my ulimits are:

--- cut ---
cpu time (seconds)         unlimited
file size (blocks)         unlimited
data seg size (kbytes)     unlimited
stack size (kbytes)        8192
core file size (blocks)    0
unlimited
processes                  2047
file descriptors           1024
locked-in-memory size (kb) unlimited
memory size (kb)           unlimited
unlimited
--- cut ---

and memory free is:

--- cut ---
             total       used       free     shared    buffers     cached
Mem:        255892     219252      36640          0      47440      67228
-/+ buffers/cache:     104584     151308
Swap:       491360     177248     314112
--- cut ---
-- 
Brian May <bam@debian.org>



Reply to: