2009/8/14 Tom Hughes <[email protected]>
> On 14/08/09 14:43, John Reiser wrote:
>
>> 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
>>>
>>
>>
>> --------------------------------------------------------------------------^^^^-------^^^^
>>
>> [versus]
>>
>> 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
>>>
>>
>>
>> ----------------------------------------------------------------------------^^-------^^
>>
>>
>> Except for the geteuid(), stat64() and fstat64(), there seems to be no
>>> difference.
>>>
>>
>> The second call to pread64 has a third argument of 52 instead of 4096.
>>
>
> Which should be fine of course - it just means we're only asking for the
> first 52 bytes of the file instead of the first 4096 bytes. As far as I know
> there is no requirement for the size or offset given to pread to be page
> aligned or anything like that so both should work.
>
> It might of course explain why the test program is not showing the problem.
>
> I still reckon this is a kernel bug, although it may well be the change in
> the count that triggers it.
>
>
Hate to break it to you, but 52 is not the answer (just for laughs, tried
with 42 as well)
as expected, all work fine in the test program.
Maybe it has to do with any of the mmap calls ? What follows is the complete
strace of the test program:
execve("./a.out", ["./a.out"], [/* 21 vars */]) = 0
mmap(NULL, 20, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) =
0x30005000
stat("/etc/ld.so.cache", {st_mode=S_IFREG|0755, st_size=3734, ...}) = 0
open("/etc/ld.so.cache", O_RDONLY) = 3
mmap(NULL, 3734, PROT_READ, MAP_SHARED, 3, 0) = 0x30006000
close(3) = 0
open("/usr/local/lib/libgcc_s.so.1", O_RDONLY) = -1 ENOENT (No such file or
directory)
open("/lib/libgcc_s.so.1", O_RDONLY) = 3
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) =
0x30007000
read(3, "\177ELF\1\2\1\0\0\0\0\0\0\0\0\0\0\3\0\24\0\0\0\1\0\0\030"..., 4096)
= 4096
mmap(NULL, 114688, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x30015000
mmap(0x30015000, 47516, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED, 3, 0) =
0x30015000
mmap(0x30030000, 2936, PROT_READ|PROT_WRITE|PROT_EXEC,
MAP_PRIVATE|MAP_FIXED, 3, 0xb000) = 0x30030000
close(3) = 0
munmap(0x30007000, 4096) = 0
open("/usr/local/lib/libc.so.0", O_RDONLY) = -1 ENOENT (No such file or
directory)
open("/lib/libc.so.0", O_RDONLY) = 3
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) =
0x30007000
read(3, "\177ELF\1\2\1\0\0\0\0\0\0\0\0\0\0\3\0\24\0\0\0\1\0\0\373"..., 4096)
= 4096
mmap(NULL, 360448, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x30031000
mmap(0x30031000, 326620, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED, 3, 0) =
0x30031000
mmap(0x30081000, 4596, PROT_READ|PROT_WRITE|PROT_EXEC,
MAP_PRIVATE|MAP_FIXED, 3, 0x50000) = 0x30081000
mmap(0x30083000, 21640, PROT_READ|PROT_WRITE|PROT_EXEC,
MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x30083000
close(3) = 0
munmap(0x30007000, 4096) = 0
munmap(0x30006000, 3734) = 0
ioctl(0, TCGETS, {B38400 opost isig icanon echo ...}) = 0
ioctl(1, TCGETS, {B38400 opost isig icanon echo ...}) = 0
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 "..., 52,
0) = 52
close(3) = 0
exit(6) = ?
------------------------------------------------------------------------------
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