From: Valient G. <vg...@po...> - 2003-07-13 07:20:53
|
I was trying to track down a problem using Valgrind 1.9.6 on a program, but the program behaved much differently when running under valgrind. The problem is that a call to lstat() on a non-existant file should retur -1 and sets errno. This is exactly how it behaves normally, but when running under valgrind it returns -1 but errno is 0! Attached is a small test program which calls lstat on a bogus filename. Results: native, no pthreads: as expected (ret -1, errno = 2) valgrind, no pthreads: as expected "" native, pthreads: as expected "" valgrind, pthreads: lstat returns -1 but errno = 0! no pthread build: g++ -o test-lstat test-lstat.cpp pthread build: g++ -o test-lstat test-lstat.cpp -lpthread SuSE 8.2 system, gcc 3.3 (20030226 prerelease) glibc 2.3.2 Is this a known problem related to operation with pthreads? regards, Valient |