[SDL] Unexplained segfault

Ryan C. Gordon icculus at icculus.org
Sat Jun 23 20:19:13 PDT 2007


> Going back to your first paragraph, nothing would surprise me with this
> code.  If it makes a difference, I can putenv("SDL_MOUSE_RELATIVE=1");
> as the first line of main() and everything works okay.  Sorry for being
> naive, been a long time since I did much C++.

Doing so is only masking the problem, though...if it overwrote the 
environment table, it's still going to overwrite _something_ until you 
figure out what.

> Is valgrind the best option at this point?

I would think so, but it didn't seem to find anything the first 
time...which might mean you're overwriting static memory, not some 
dynamically allocated buffer. Look for global arrays.

The good news is that it seems to crash pretty quickly, so you're 
probably causing problems somewhere in the startup code.

--ryan.




More information about the SDL mailing list