Re: [TuxKart-devel] Valgrind: hunting possible leaks
Status: Alpha
Brought to you by:
sjbaker
From: Matze B. <ma...@br...> - 2004-09-04 12:45:25
|
valgrind has problems with some hacks the nvidia and ati opengl drivers are doing. An "export __GL_FORCE_GENERIC_CPU=1" helps for nvidia cards, for ati you can only try to link tuxkart with mesa instead of ati opengl. On Fri, 3 Sep 2004, Pascal Giard wrote: > With valgrind 2.2, i used the following: > > valgrind --tool=memcheck --leak-check=yes ./tuxkart 2> /tmp/leaks.log > > the first thing i notice is that the following apears very frequently (27 > times just by making my way thru until i reach the track selection screen) > along the way: > > ==1520== Syscall param ioctl(generic) contains uninitialised or unaddressable > byte(s) > ==1520== at 0x4334AA54: ioctl (in /lib/tls/libc-2.3.2.so) > ==1520== by 0x4497DA91: (within /usr/lib/tls/libGL.so.1.0.5336) > ==1520== Address 0x52BFE3B0 is on thread 1's stack > > > Some other interesting parts: > ----------------------------- > > ==1520== Use of uninitialised value of size 2 > ==1520== at 0x4EED76EA: slSample::changeRate(int) (in > /usr/lib/libplibsl.so.1.8.3) > ==1520== by 0x4EED7366: slSample::autoMatch(slDSP const*) (in > /usr/lib/libplibsl.so.1.8.3) > ==1520== by 0x8070AD9: SoundSystem::SoundSystem() (sl.h:240) > ==1520== by 0x8070F71: initTuxKart(int, int, int) (start_tuxkart.cxx:87) > > ==1520== Conditional jump or move depends on uninitialised value(s) > ==1520== at 0x1B904A38: strcmp (mac_replace_strmem.c:251) > ==1520== by 0x80702D1: SoundSystem::change_track(char const*) (sound.cxx:57) > ==1520== by 0x8070B18: SoundSystem::SoundSystem() (sound.cxx:113) > ==1520== by 0x8070F71: initTuxKart(int, int, int) (start_tuxkart.cxx:87) These are bugs in plib where uninitialized variables are accessed, I've seen them too but didn't find the time yet to investigate as they don't seem to harm in most cases... > > > Another one that appears frequently: > ------------------------------------ > > ==1520== Use of uninitialised value of size 4 > ==1520== at 0x4EEF6E0F: sgBox::extend(float const*) (in > /usr/lib/libplibsg.so.1.8.3) > ==1520== by 0x4F021436: ssgVtxTable::recalcBSphere() (in > /usr/lib/libplibssg.so.1.8.3) > ==1520== by 0x4F02030C: ssgVtxTable::ssgVtxTable(unsigned, ssgVertexArray*, > ssgNormalArray*, ssgTexCoordArray*, ssgColourArray*) (in > /usr/lib/libplibssg.so.1.8.3) > ==1520== by 0x80798F5: ParticleSystem::ParticleSystem(int, int, float, int, > float, float) (ssg.h:159) > > I'll stop here for now... > > To say the least, i don't really understand how i should react to those > informations... > Almost all entries mention my /usr/lib/tls/libGL.so.1.0.5336, but if it gets > called the wrong way, it's just plain normal. > > I'll try kcachegrind to see if i can get to understand more. cachegrind is for testing the performance of an App when you consider cpu caches so that you can optimize your code to better fit inside the data and command-caches of the cpu. That's only usefull if you need to tweak the last 5% performance of your app, we're not at that point in tuxkart yet. Greetings, Matze |