help-gplusplus
[Top][All Lists]
Advanced

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

Re: memory allocation bug in g++-4.1.2 and glibc


From: alikin
Subject: Re: memory allocation bug in g++-4.1.2 and glibc
Date: 21 Apr 2007 03:28:55 -0700
User-agent: G2/1.0

Hi Paul,

> > but valgrind returns lots of errors such as:
> > Use of uninitialised value of size 4
> > Conditional jump or move depends on uninitialised value(s)
>
> These mean you are using (printingf) some uninitialized data.
> The are not heap corruption bugs, but they often are not very
> healthy either.

So does that imply that the heap corruption might be in the first bit
of code which generates the data? Valgrind doesn't return any errors
on the first part (although it says:
"0 errors in 0 context( supressing 15 context out of 1)"

> Finally, there might be a "glibc-debug" package, which might give
> you better stack traces.
I installed libc6-dbg and here is the stack trace:

#0  0x402bc847 in raise () from /lib/libc.so.6
#1  0x402be0b8 in abort () from /lib/libc.so.6
#2  0x402f2c1b in __libc_message () from /lib/libc.so.6
#3  0x402fb317 in _int_malloc () from /lib/libc.so.6
#4  0x402fcb3e in malloc () from /lib/libc.so.6
#5  0x4022d908 in operator new () from /usr/lib/libstdc++.so.6
#6  0x4022da3d in operator new[] () from /usr/lib/libstdc++.so.6

Does that mean anything?!

Also with the latest version of glibc (2.5-2) I get this error at run
time:
*** glibc detected *** ./ibr_render: malloc(): memory corruption:
0x0876dd08 ***
======= Backtrace: =========
/lib/libc.so.6[0x402fb317]
/lib/libc.so.6(malloc+0x7e)[0x402fcb3e]
/usr/lib/libstdc++.so.6(_Znwj+0x28)[0x4022d908]
/usr/lib/libstdc++.so.6(_Znaj+0x1d)[0x4022da3d]
./ibr_render[0x805f26b]
./ibr_render[0x805107f]
./ibr_render[0x805171e]
/lib/libc.so.6(__libc_start_main+0xd8)[0x402a8878]
./ibr_render(__gxx_personality_v0+0xa1)[0x804c031]
======= Memory map: ========
08048000-08186000 r-xp 00000000 00:16 5237493    /homes/38/ali/
projects/ibrTool/ibr_render
08186000-08187000 rw-p 0013d000 00:16 5237493    /homes/38/ali/
projects/ibrTool/ibr_render
08187000-09a18000 rw-p 08187000 00:00 0          [heap]
40000000-4001c000 r-xp 00000000 08:01 1319330    /lib/ld-2.5.so
4001c000-4001e000 rw-p 0001b000 08:01 1319330    /lib/ld-2.5.so
4001e000-4001f000 r-xp 4001e000 00:00 0          [vdso]
4001f000-40022000 rw-p 4001f000 00:00 0
40037000-40049000 r-xp 00000000 08:01 1321000    /lib/
libpthread-2.5.so
40049000-4004b000 rw-p 00011000 08:01 1321000    /lib/
libpthread-2.5.so
4004b000-4004d000 rw-p 4004b000 00:00 0
4004d000-40135000 r-xp 00000000 08:01 1450639    /usr/lib/libX11.so.
6.2.0
40135000-40139000 rw-p 000e8000 08:01 1450639    /usr/lib/libX11.so.
6.2.0
40139000-4013a000 rw-p 40139000 00:00 0
4013a000-4015c000 r-xp 00000000 08:01 1457937    /usr/lib/libpng12.so.
0.15.0
4015c000-4015d000 rw-p 00021000 08:01 1457937    /usr/lib/libpng12.so.
0.15.0
4015d000-4017c000 r-xp 00000000 08:01 1457763    /usr/lib/libjpeg.so.
62.0.0
4017c000-4017d000 rw-p 0001e000 08:01 1457763    /usr/lib/libjpeg.so.
62.0.0
4017d000-40257000 r-xp 00000000 08:01 1451682    /usr/lib/libstdc++.so.
6.0.8
40257000-4025a000 r--p 000d9000 08:01 1451682    /usr/lib/libstdc++.so.
6.0.8
4025a000-4025c000 rw-p 000dc000 08:01 1451682    /usr/lib/libstdc++.so.
6.0.8
4025c000-40262000 rw-p 4025c000 00:00 0
40262000-40286000 r-xp 00000000 08:01 1319543    /lib/libm-2.5.so
40286000-40288000 rw-p 00023000 08:01 1319543    /lib/libm-2.5.so
40288000-40292000 r-xp 00000000 08:01 1319357    /lib/libgcc_s.so.1
40292000-40293000 rw-p 00009000 08:01 1319357    /lib/libgcc_s.so.1
40293000-403ce000 r-xp 00000000 08:01 1319343    /lib/libc-2.5.so
403ce000-403cf000 r--p 0013b000 08:01 1319343    /lib/libc-2.5.so
403cf000-403d1000 rw-p 0013c000 08:01 1319343    /lib/libc-2.5.so
403d1000-403d5000 rw-p 403d1000 00:00 0
403d5000-403d7000 r-xp 00000000 08:01 1450634    /usr/lib/libXau.so.
6.0.0
403d7000-403d8000 rw-p 00001000 08:01 1450634    /usr/lib/libXau.so.
6.0.0
403d8000-403dc000 r-xp 00000000 08:01 1451666    /usr/lib/libXdmcp.so.
6.0.0
403dc000-403dd000 rw-p 00003000 08:01 1451666    /usr/lib/libXdmcp.so.
6.0.0
403dd000-403df000 r-xp 00000000 08:01 1319473    /lib/libdl-2.5.so
403df000-403e1000 rw-p 00001000 08:01 1319473    /lib/libdl-2.5.so
403e1000-403ee000 r-xp 00000000 08:01 1889697    /usr/bin/matlabR2006a/
bin/glnx86/libz.so.1.1.4
403ee000-403f0000 rw-p 0000d000 08:01 1889697    /usr/bin/matlabR2006a/
bin/glnx86/libz.so.1.1.4
403f0000-40560000 rw-p 403f0000 00:00 0
40600000-40621000 rw-p 40600000 00:00 0
40621000-40700000 ---p 40621000 00:00 0
bfda7000-bfdbc000 rw-p bfda7000 00:00 0          [stack]


which doesn't mean anything to me, but I find the 0's in heap line
suspicious.

Cheers.
Alikin



reply via email to

[Prev in Thread] Current Thread [Next in Thread]