My program crashes with a segmentation fault when ran normally. So I run it with GDB, but it won't crash when I do that. Why might this occur?
I know that Valgrind's FAQ mentions this (not crashing under Valgrind), but I couldn't really find anything about this related to GDB in Google.
Well I tracked it down to a pthread_detach call. I was doing pthread_detach(&thethread). I just took away the reference and changed it to pthread_detach(thethread) and it worked fine. I'm not positive, but maybe it was a double free by detaching the reference then destroying it again when it went out of scope?