[Pvfs2-users] corrupted output

Michael Moore mtmoore at clemson.edu
Wed Dec 15 10:34:38 EST 2010


In my testing I was not able to reproduce the behavior. The last line 
message is on the last line in both files.
[mtmoore at devorange35 pvfs2]$ tail -n 1 test2.txt 
--- should be the last line ---

and the two files are identical minus one character:
[mtmoore at devorange35 pvfs2]$ diff test1.txt test2.txt 
17c17
< 0xxxxxxxxx1xxxxxxxxx2xxxxxxxxx3xxxxxxxxx4xxxxxx
---
> 0xxxxxxxxx1xxxxxxxxx2xxxxxxxxx3xxxxxxxxx4xxxxxxx

I'm doing this on a CentOS 5 host and tested against Orange-Branch 
and HEAD from CVS. Both yielded the same results. I did link against a 
newer version of db,4.8.30. I haven't looked at the strace output 
yet. What is the server setup and config you are using when running 
this test? My testing was just a client sitting on the same box 
as the server with TCP.

Michael

On Wed, Dec 15, 2010 at 09:39:32AM -0500, Chris Poultney wrote:
> Sure - it's attached. I ran exactly the code I posted earlier.
> 
> -crispy
> 
> 
> On 12/14/2010 07:25 PM, Sam Lang wrote:
> >
> > Hi Chris,
> >
> > Would you be willing to run your test with strace and post the output?  That will help us figure out what read/write system calls PVFS is getting from your app.
> >
> > Thanks,
> > -sam
> >
> > On Dec 14, 2010, at 4:29 PM, Chris Poultney wrote:
> >
> >> All-
> >>
> >> I'm having a problem where files written to a PVFS volume overwrite the beginning of the file after some output has already been generated, as if lseek() had been called mid-write. The overwriting behavior does not show up on a regular ext3 volume. Sample code is attached. I'd like to know if anyone can duplicate this behavior, because it looks like a bug.
> >>
> >> Essentially what happens is this: given a large (1024+ character) string, I write some portion of the string using a C++ ostream, then write another line:
> >>
> >> out<<  st.substr(0, N);
> >> out<<  "done";
> >>
> >> If N<  1024, everything is fine. If N>= 1024, "done" is written at the beginning of the file, overwriting what was there before.
> >>
> >> I'd love to figure this out!
> >>
> >> Cheers,
> >> -crispy
> >>
> >> <pvfstest.cpp>_______________________________________________
> >> Pvfs2-users mailing list
> >> Pvfs2-users at beowulf-underground.org
> >> http://www.beowulf-underground.org/mailman/listinfo/pvfs2-users
> >

> execve("/home/crispy/tmp/pvfstest", ["/home/crispy/tmp/pvfstest"], [/* 27 vars */]) = 0
> brk(0)                                  = 0x21f8000
> access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
> mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7ff2fa6f7000
> access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)
> open("/etc/ld.so.cache", O_RDONLY)      = 3
> fstat(3, {st_mode=S_IFREG|0644, st_size=33131, ...}) = 0
> mmap(NULL, 33131, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7ff2fa6ee000
> close(3)                                = 0
> access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
> open("/usr/lib/libstdc++.so.6", O_RDONLY) = 3
> read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\240\244\5\0\0\0\0\0"..., 832) = 832
> fstat(3, {st_mode=S_IFREG|0644, st_size=1044112, ...}) = 0
> mmap(NULL, 3223608, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7ff2fa1c6000
> mprotect(0x7ff2fa2bc000, 2097152, PROT_NONE) = 0
> mmap(0x7ff2fa4bc000, 36864, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xf6000) = 0x7ff2fa4bc000
> mmap(0x7ff2fa4c5000, 81976, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7ff2fa4c5000
> close(3)                                = 0
> access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
> open("/lib/libm.so.6", O_RDONLY)        = 3
> read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\360>\0\0\0\0\0\0"..., 832) = 832
> fstat(3, {st_mode=S_IFREG|0644, st_size=534832, ...}) = 0
> mmap(NULL, 2629864, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7ff2f9f43000
> mprotect(0x7ff2f9fc5000, 2093056, PROT_NONE) = 0
> mmap(0x7ff2fa1c4000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x81000) = 0x7ff2fa1c4000
> close(3)                                = 0
> access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
> open("/lib/libgcc_s.so.1", O_RDONLY)    = 3
> read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\200-\0\0\0\0\0\0"..., 832) = 832
> fstat(3, {st_mode=S_IFREG|0644, st_size=92552, ...}) = 0
> mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7ff2fa6ed000
> mmap(NULL, 2188280, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7ff2f9d2c000
> mprotect(0x7ff2f9d42000, 2093056, PROT_NONE) = 0
> mmap(0x7ff2f9f41000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x15000) = 0x7ff2f9f41000
> close(3)                                = 0
> access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
> open("/lib/libc.so.6", O_RDONLY)        = 3
> read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0`\355\1\0\0\0\0\0"..., 832) = 832
> fstat(3, {st_mode=S_IFREG|0755, st_size=1572232, ...}) = 0
> mmap(NULL, 3680296, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7ff2f99a9000
> mprotect(0x7ff2f9b23000, 2093056, PROT_NONE) = 0
> mmap(0x7ff2f9d22000, 20480, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x179000) = 0x7ff2f9d22000
> mmap(0x7ff2f9d27000, 18472, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7ff2f9d27000
> close(3)                                = 0
> mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7ff2fa6ec000
> mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7ff2fa6ea000
> arch_prctl(ARCH_SET_FS, 0x7ff2fa6ea720) = 0
> mprotect(0x7ff2f9d22000, 16384, PROT_READ) = 0
> mprotect(0x7ff2f9f41000, 4096, PROT_READ) = 0
> mprotect(0x7ff2fa1c4000, 4096, PROT_READ) = 0
> mprotect(0x7ff2fa4bc000, 28672, PROT_READ) = 0
> mprotect(0x601000, 4096, PROT_READ)     = 0
> mprotect(0x7ff2fa6f9000, 4096, PROT_READ) = 0
> munmap(0x7ff2fa6ee000, 33131)           = 0
> brk(0)                                  = 0x21f8000
> brk(0x2219000)                          = 0x2219000
> open("test1.txt", O_WRONLY|O_CREAT|O_TRUNC, 0666) = 3
> write(3, "0xxxxxxxxx1xxxxxxxxx2xxxxxxxxx3x"..., 1056) = 1056
> close(3)                                = 0
> open("test2.txt", O_WRONLY|O_CREAT|O_TRUNC, 0666) = 3
> writev(3, [{NULL, 0}, {"0xxxxxxxxx1xxxxxxxxx2xxxxxxxxx3x"..., 1024}], 2) = 1024
> write(3, "\n--- should be the last line ---"..., 33) = 33
> close(3)                                = 0
> exit_group(0)                           = ?

> _______________________________________________
> Pvfs2-users mailing list
> Pvfs2-users at beowulf-underground.org
> http://www.beowulf-underground.org/mailman/listinfo/pvfs2-users



More information about the Pvfs2-users mailing list