NFS client write out corrupted file?

Sai-Lai Lo (S.Lo@orl.co.uk)
Mon, 14 Dec 1998 17:58:36 GMT


I wonder if anyone can reproduce the bug I encountered and better nail down
where the bug is.

I have a x86 2.1.130 kernel acting as a client to a Solaris 2.5.1 NFS
server. The NFS read and write size are set to 8K. I've also tried 4K write
size but it makes no difference. I've also gone back to 2.1.129 and
2.1.131ac11, same result.

The symptom is when I compile a large source tree (C++ source but I don't
think it matters), one or more of the object files contain junk. Local
compilation works fine which makes me suspect the NFS client
code. Compiling on another machine with 2.0.36 kernel and the same NFS
server is fine as well.

I'm able to narrow down the failure to the stage where gas generates the
object file. Compare the object file between the local file system and the
NFS file system test case, it looks like only a small portion of the file
is different.

Here is one example:

$ as o2be_sequence.s
$ nm a.out
BFD: a.out: invalid string offset 452984832 >= 1257 for section `.shstrtab'
BFD: a.out: invalid string offset 553648128 >= 1257 for section `.shstrtab'
.........

Compare the object file a.out with the one that is correctly compiled, it
looks like only a small region (offset 0004d20--0004fff) is different.

Using 'strace as o2be_sequence.s', it looks like the region is where gas
writes the symbol table (see the trace below).

Looking at the strace output, it seems to me gas is doing quite a bit of
random seek. I wonder if this interacts badly with the async write-back
code in the nfs client (which has been changed quite a bit lately?). Also
is there anything magical about the boundary 0x4fff? It is a 4K boundary.

I'm afraid the information may not be that useful in tracking down the bug.
If someone can corroborate with my observation, at least it is a start.

Regards,

Sai-Lai Lo

---------
% strace as o2be_sequence.s
execve("/usr/bin/as", ["as", "o2be_sequence.s"], [/* 57 vars */]) = 0
brk(0) = 0x8077714
open("/etc/ld.so.preload", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/lib/libbfd-2.9.1.0.15.so.0", O_RDONLY) = 3
...................
.................. file reading part removed.
..................
fstat(3, {st_mode=0, st_size=0, ...}) = 0
mmap(0, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40044000
lseek(3, 24144, SEEK_SET) = 24144
write(3, "\0o2be_sequence.cc\0gcc2_compile"..., 4096) = 4096
write(3, "_C9o2be_name\0_fqtcname__C9o2be_"..., 1024) = 1024
lseek(3, 52, SEEK_SET) = 52
write(3, "U\211\345WVS\213]\10\203}\f\0\17"..., 4096) = 4096
write(3, "R\350\374\377\377\377\203\304\f\203"..., 4096) = 4096
write(3, "\211\330\203}\f\0u\0021\300P\350"..., 4096) = 4096
write(3, "U\211\3451\300\213U\10\213M\f\201"..., 592) = 592
lseek(3, 12960, SEEK_SET) = 12960
write(3, "sequence\0\0\0\0\0\0\0\0\0\0\0\0"..., 3126) = 3126
lseek(3, 16088, SEEK_SET) = 16088
write(3, "\203D$\4\360\351\374\377\377\377"..., 10) = 10
lseek(3, 16100, SEEK_SET) = 16100
write(3, "\203D$\4\354\351\374\377\377\377"..., 10) = 10
lseek(3, 16112, SEEK_SET) = 16112
write(3, "\203D$\0048\351\374\377\377\377", 10) = 10
lseek(3, 16124, SEEK_SET) = 16124
write(3, "\203D$\4\4\351\374\377\377\377", 10) = 10
lseek(3, 16136, SEEK_SET) = 16136
write(3, "\370\377\377\377\0\0\0\0\0\0\0\0"..., 22) = 22
lseek(3, 16160, SEEK_SET) = 16160
write(3, "\364\377\377\377\0\0\0\0\0\0\0\0"..., 54) = 54
lseek(3, 16216, SEEK_SET) = 16216
write(3, "U\211\345\366E\f\1t\t\213E\10P\350"..., 22) = 22
lseek(3, 16240, SEEK_SET) = 16240
write(3, "U\211\345\213U\10\213\2\213M\f\213"..., 65) = 65
lseek(3, 16308, SEEK_SET) = 16308
write(3, "U\211\345S\273\0\0\0\0\203=\0\0\0"..., 50) = 50
lseek(3, 16360, SEEK_SET) = 16360
write(3, "X\0\0\0\211\0\0\0h\5\0\0a\0\0\0r"..., 2095) = 2095
lseek(3, 29264, SEEK_SET) = 29264
write(3, "K\0\0\0\1*\0\0R\0\0\0\2+\0\0[\0\0"..., 4096) = 4096
write(3, "~(\0\0\2y\0\0\206(\0\0\2c\0\0\216"..., 2648) = 2648
lseek(3, 21232, SEEK_SET) = 21232
write(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2912) = 2912
lseek(3, 18455, SEEK_SET) = 18455
write(3, "\0.symtab\0.strtab\0.shstrtab\0."..., 1257) = 1257
lseek(3, 0, SEEK_SET) = 0
write(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\1"..., 52) = 52
lseek(3, 19712, SEEK_SET) = 19712
write(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 1520) = 1520
close(3) = 0
munmap(0x40044000, 4096) = 0
_exit(0) = ?

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/