2009/8/12 Nicholas Nethercote
> On Wed, Aug 12, 2009 at 11:22 PM, Bram De Wachter wrote:
> >
> > It all seems to boil down to VG_(pread) (or more specifically VG_(lseek))
> > not working correctly on my system. Here is the relevant portion of
> strace:
>
> Here is the code for VG_(pread). The comment at the top seems very
> relevant:
>
> I don't know why the linux/aix5 version uses VG_(lseek) then
> __NR_read, it seems like it should just use __NR_pread64 directly,
> similar to the Darwin versions. Can you try changing it to do that
> and report back whether it fixes the problem?
>
> Nick
>
Tried it first thing this morning. Without success. Still same garbish at
the second (now pread64) syscall.
But even if it worked, this would still not fix any future calls to lseek()
?
Anyway, something else is not right. Maybe this can help :
int main() {
int fd = open("/usr/bin/scp", O_RDONLY);
char buf[4096];
pread(fd, buf, 4096, 0);
pread(fd, buf, 4096, 0);
close(fd);
}
produced strace:
open("/usr/bin/scp", O_RDONLY) = 3
pread64(3, "\177ELF\1\2\1\0\0\0\0\0\0\0\0\0\0\2\0\24\0\0\0\1\20\0 "...,
4096, 0) = 4096
pread64(3, "\177ELF\1\2\1\0\0\0\0\0\0\0\0\0\0\2\0\24\0\0\0\1\20\0 "...,
4096, 0) = 4096
close(3) = 0
This what valgrind outputs (with the requested change) :
open("/usr/bin/scp", O_RDONLY) = 3
stat64("/usr/bin/scp", {st_mode=S_IFREG|0755, st_size=40140, ...}) = 0
geteuid() = 0
fstat64(3, {st_mode=S_IFREG|0755, st_size=40140, ...}) = 0
pread64(3, "\177ELF\1\2\1\0\0\0\0\0\0\0\0\0\0\2\0\24\0\0\0\1\20\0 "...,
4096, 0) = 4096
pread64(3, "\335\335\335\335\335\335\335\335\335\335\335\335\335\335"...,
52, 0) = 52
write(2, "valgrind: /usr/bin/scp: bad ELF "..., 45) = 45
close(3) = 0
Except for the geteuid(), stat64() and fstat64(), there seems to be no
difference.
Thanks for any light.
Bram.
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
Valgrind-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/valgrind-users