From: Ranko Z. <ra...@sp...> - 2003-04-07 01:40:14
|
Hi All, First of all I would like to thank Julian for making this tool available. It is great! I'm addressing you because I'm experiencing something that for last two days drove me completely bannanas. I was checking one of my multithreaded app. against the Valgrind, found few mistakes and cleaned some of them up - but some of them I simply cannot understand how do they happen. And I was hoping that some of you might have expirienced the same - and found the solution. Basically, when I'm writing to a file via either write or pwrite I can see in gdb that I'm passing the correct pointers, but when libc performs a syscall, the buffer pointer gets somehow shifted for one byte inside the allocated buffer and crossing the allocated space thus having Valgrind complain about it. The behavior is not consistent because at some places pwrite works like a charm and at certain places it does this funny stuff. The error Valgrind gives is "Address 0x412C72B9 is 1 bytes inside a block of size 32 alloc'd" and the address offset is exactly 1 bytes from what I have passed to the pwrite according to gdb (0x412C72B8). I also see that Valgrind passes the same correct pointer to the library (at vg_libpthread.c:2142). The same error is being reported by both 1.0.4 and 1.9.4. What could be the cause of this behavior? Btw, application seems to be working fine without the Valgrind because the resulting files are correct in the format and the content (they are not missing the first byte or something), but then again, I'm afraid that I might be corrupting something someplace that could fire back afterwards. I've also tried to reproduce the problem in a smaller program, but unfortunately with no luck there. Thanks in advance, Ranko -- Ranko Zivojnovic, NOC Manager ra...@sp... Network Operations Center Spidernet Services Ltd., Tel: +357 22 844844 Nicosia, Cyprus FAX: +357 22 669470 |