|
From: Erik S. L. <Eri...@id...> - 2004-02-13 14:07:56
|
Hi, I'm having some trouble using valgrind. Likely I'm doing something wrong, but I couldn't find any info on this problem on the valgrind homepage. My program uses SDL, SDL_image, opengl and glu (mesa). I know it leaks memory, so it would be great if somebody could help me figure out what I'm doing wrong here. The output from valgrind is pasted below. [eriksul@myhost leved]$ valgrind ./leved ==8422== Memcheck, a.k.a. Valgrind, a memory error detector for x86-linux. ==8422== Copyright (C) 2002-2003, and GNU GPL'd, by Julian Seward. ==8422== Using valgrind-2.0.0, a program supervision framework for x86-linux. ==8422== Copyright (C) 2000-2003, and GNU GPL'd, by Julian Seward. ==8422== Estimated CPU clock rate is 1106 MHz ==8422== For more details, rerun with: -v ==8422== ==8422== valgrind's libpthread.so: KLUDGED call to: sem_destroy ==8422== Use of uninitialised value of size 4 ==8422== at 0x403E546C: sigfpe_handler (in /usr/lib/libGL.so.1.4.050100) ==8422== by 0x40187CDF: (within /usr/lib/valgrind/valgrind.so) ==8422== by 0x403E4E17: _mesa_init_all_x86_transform_asm (in /usr/lib/libGL.so.1.4.050100) ==8422== by 0x40356053: _math_init_transformation (in /usr/lib/libGL.so.1.4.050100) ==8422== ==8422== Invalid read of size 2 ==8422== at 0x403E546C: sigfpe_handler (in /usr/lib/libGL.so.1.4.050100) ==8422== by 0x40187CDF: (within /usr/lib/valgrind/valgrind.so) ==8422== by 0x403E4E17: _mesa_init_all_x86_transform_asm (in /usr/lib/libGL.so.1.4.050100) ==8422== by 0x40356053: _math_init_transformation (in /usr/lib/libGL.so.1.4.050100) ==8422== Address 0x6E is not stack'd, malloc'd or free'd Segmentation fault |
|
From: Nicholas N. <nj...@ca...> - 2004-02-13 19:12:28
|
On Fri, 13 Feb 2004, Erik Sundnes L=F8vlie wrote: > =3D=3D8422=3D=3D Invalid read of size 2 > =3D=3D8422=3D=3D at 0x403E546C: sigfpe_handler (in /usr/lib/libGL.so.1= =2E4.050100) > =3D=3D8422=3D=3D by 0x40187CDF: (within /usr/lib/valgrind/valgrind.so) > =3D=3D8422=3D=3D by 0x403E4E17: _mesa_init_all_x86_transform_asm (in /= usr/lib/libGL.so.1.4.050100) > =3D=3D8422=3D=3D by 0x40356053: _math_init_transformation (in /usr/lib= /libGL.so.1.4.050100) > =3D=3D8422=3D=3D Address 0x6E is not stack'd, malloc'd or free'd > Segmentation fault If you read the message, it tells you exactly what's the problem: your program is doing an invalid read, of size 2, of address 0x6e; that definitely looks wrong. As for whether that's caused by the static linking of pthreads, I don't know. It's not uncommon for people to have bugs in their programs that aren't normally seen, but are triggered when run under Valgrind (eg. due to slightly different memory layout). N |
|
From: David E. <tw...@us...> - 2004-02-13 21:04:37
|
On Fri, 2004-02-13 at 15:05, Erik Sundnes L=F8vlie wrote:
> Hi, I'm having some trouble using valgrind. Likely I'm doing something
> wrong, but I couldn't find any info on this problem on the valgrind
> homepage.
> My program uses SDL, SDL_image, opengl and glu (mesa).
> I know it leaks memory, so it would be great if somebody could help me
> figure out what I'm doing wrong here.
The first thing you should do is to increase the length of the backtrace
with for example --num-callers=3D20 as parameter to valgrind.
> The output from valgrind is pasted below.
>=20
>=20
> [eriksul@myhost leved]$ valgrind ./leved
> =3D=3D8422=3D=3D Memcheck, a.k.a. Valgrind, a memory error detector for=
x86-linux.
> =3D=3D8422=3D=3D Copyright (C) 2002-2003, and GNU GPL'd, by Julian Sewa=
rd.
> =3D=3D8422=3D=3D Using valgrind-2.0.0, a program supervision framework =
for x86-linux.
> =3D=3D8422=3D=3D Copyright (C) 2000-2003, and GNU GPL'd, by Julian Sewa=
rd.
> =3D=3D8422=3D=3D Estimated CPU clock rate is 1106 MHz
> =3D=3D8422=3D=3D For more details, rerun with: -v
> =3D=3D8422=3D=3D
> =3D=3D8422=3D=3D valgrind's libpthread.so: KLUDGED call to: sem_destroy
> =3D=3D8422=3D=3D Use of uninitialised value of size 4
> =3D=3D8422=3D=3D at 0x403E546C: sigfpe_handler (in /usr/lib/libGL.so=
.1.4.050100)
> =3D=3D8422=3D=3D by 0x40187CDF: (within /usr/lib/valgrind/valgrind.s=
o)
> =3D=3D8422=3D=3D by 0x403E4E17: _mesa_init_all_x86_transform_asm (in
> /usr/lib/libGL.so.1.4.050100)
> =3D=3D8422=3D=3D by 0x40356053: _math_init_transformation (in
> /usr/lib/libGL.so.1.4.050100)
> =3D=3D8422=3D=3D
> =3D=3D8422=3D=3D Invalid read of size 2
> =3D=3D8422=3D=3D at 0x403E546C: sigfpe_handler (in /usr/lib/libGL.so=
.1.4.050100)
> =3D=3D8422=3D=3D by 0x40187CDF: (within /usr/lib/valgrind/valgrind.s=
o)
> =3D=3D8422=3D=3D by 0x403E4E17: _mesa_init_all_x86_transform_asm (in
> /usr/lib/libGL.so.1.4.050100)
> =3D=3D8422=3D=3D by 0x40356053: _math_init_transformation (in
> /usr/lib/libGL.so.1.4.050100)
> =3D=3D8422=3D=3D Address 0x6E is not stack'd, malloc'd or free'd
> Segmentation fault
--=20
Regards,
-\- David Eriksson -/-
SynCE - http://synce.sourceforge.net
CalcEm - http://calcem.sourceforge.net
Desquirr - http://desquirr.sourceforge.net
SetiWrapper - http://setiwrapper.sourceforge.net
|
|
From: Jeremy F. <je...@go...> - 2004-02-14 18:42:58
|
On Fri, 2004-02-13 at 06:05, Erik Sundnes LXvlie wrote: > Hi, I'm having some trouble using valgrind. Likely I'm doing something > wrong, but I couldn't find any info on this problem on the valgrind > homepage. > My program uses SDL, SDL_image, opengl and glu (mesa). > I know it leaks memory, so it would be great if somebody could help me > figure out what I'm doing wrong here. > The output from valgrind is pasted below. I just reported this - it is bug http://bugs.kde.org/show_bug.cgi?id=74298 A fix for Valgrind 2.0 is unlikely, but it should be easy enough to fix for 2.1. J |