|
From: Mike M. <mi...@su...> - 2006-06-04 03:28:51
|
I have a weird situation. I'll try to describe it as completely as possible: I have a program that does not crash, and when run through valgrind, 0 errors are reported. Someone else patched it to get it to recompile on FreeBSD by moving a single include (sys/types.h) from the bottom to the top of the includes list. Now the program segfaults on my AMD64 computer (but not on any other computers, as far as I can tell, including x86, ppc). Now, I debug it in gdb and I find the line where it's crashing. It's a call to ptsname that's returning garbage instead of a valid pointer to a string (or NULL, the failure case). Can't figure out why ptsname is returning garbage unless there's a weird memory corruption or the system library is buggy on amd64. However, when I run the program through valgrind (using the memcheck tool), it does NOT crash and valgrind reports 0 errors. One last bit, if I call ptsname_r instead of ptsname, there is no segfault. Have you ever seen anything like this? Thanks! Mike |