|
From: Erik S. L. <Eri...@id...> - 2004-02-13 17:02:22
|
Sorry, it seems my first email was sent before I had confirmed the subscription to this mailing list. My original question is: Valgrind segfaults when I try to run my program with it. My program uses SDL, SDL_image, opengl and glu (mesa). The linker and valgrind output is as follows: ------------------------------------------------------ [eriksul@myhost leved]$ make g++ -I/usr/include/SDL -D_REENTRANT -lGL -lGLU -lSDL_image -L/usr/lib -Wl,-rpath,/usr/lib -lSDL -lpthread main.o leved.o eventhandler.o elip.o font.o state.o textstate.o editstate.o texfilestate.o savestate.o loadstate.o level.o tool.o toolselect.o toolmove.o toolpolygon.o tooltexpolygon.o toolzoom.o screen.o triangulate.o -o leved [eriksul@myhost leved]$ valgrind ./leved ==9450== Memcheck, a.k.a. Valgrind, a memory error detector for x86-linux. ==9450== Copyright (C) 2002-2003, and GNU GPL'd, by Julian Seward. ==9450== Using valgrind-2.0.0, a program supervision framework for x86-linux. ==9450== Copyright (C) 2000-2003, and GNU GPL'd, by Julian Seward. ==9450== Estimated CPU clock rate is 1103 MHz ==9450== For more details, rerun with: -v ==9450== ==9450== Conditional jump or move depends on uninitialised value(s) ==9450== at 0x80502DE: Level::initialize() (level.cpp:38) ==9450== by 0x805017D: Level::Level() (level.cpp:28) ==9450== by 0x80496F8: Leved::Leved() (leved.cpp:9) ==9450== by 0x8049475: main (main.cpp:12) ==9450== valgrind's libpthread.so: KLUDGED call to: sem_destroy ==9450== ==9450== Use of uninitialised value of size 4 ==9450== at 0x403E546C: sigfpe_handler (in /usr/lib/libGL.so.1.4.050100) ==9450== by 0x40187CDF: (within /usr/lib/valgrind/valgrind.so) ==9450== by 0x403E4E17: _mesa_init_all_x86_transform_asm (in /usr/lib/libGL.so.1.4.050100) ==9450== by 0x40356053: _math_init_transformation (in /usr/lib/libGL.so.1.4.050100) ==9450== ==9450== Invalid read of size 2 ==9450== at 0x403E546C: sigfpe_handler (in /usr/lib/libGL.so.1.4.050100) ==9450== by 0x40187CDF: (within /usr/lib/valgrind/valgrind.so) ==9450== by 0x403E4E17: _mesa_init_all_x86_transform_asm (in /usr/lib/libGL.so.1.4.050100) ==9450== by 0x40356053: _math_init_transformation (in /usr/lib/libGL.so.1.4.050100) ==9450== Address 0x6E is not stack'd, malloc'd or free'd Segmentation fault -------------------------------------------------------------- > In message > <203...@we...> > Erik Sundnes LXvlie <Eri...@id...> wrote: > >> Actually my program (because of SDL) seems to be linking statically to >> libpthread, and that would be a problem, right? >> How do I link dynamically to libpthread? > > Well given that dynamic linking is the default a better question would > be what are you currently doing to force static linking. Whatever it is > you need to stop doing it ;-) > > Most likely you have something like -static in your link line that you > need to remove. > > Tom > > -- > Tom Hughes (th...@cy...) > Software Engineer, Cyberscience Corporation > http://www.cyberscience.com/ > > > ------------------------------------------------------- > SF.Net is sponsored by: Speed Start Your Linux Apps Now. > Build and deploy apps & Web services for Linux with > a free DVD software kit from IBM. Click Now! > http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click > _______________________________________________ > Valgrind-users mailing list > Val...@li... > https://lists.sourceforge.net/lists/listinfo/valgrind-users |