|
From: Yeshurun, M. <mei...@in...> - 2006-06-04 04:56:41
|
Before the experts answer you, it sounds to me like maybe you're passing around some un-initialized value which happens to have the right value (or just a "better" value) when running under Valgrind. Thanks, Meir -----Original Message----- From: val...@li... [mailto:val...@li...] On Behalf Of Mike Mueller Sent: Sunday, June 04, 2006 6:29 AM To: val...@li... Cc: Bob Rossi Subject: [Valgrind-users] Segfault not caught by valgrind 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 _______________________________________________ Valgrind-users mailing list Val...@li... https://lists.sourceforge.net/lists/listinfo/valgrind-users |