strace results. First for a small file where the copy was done successfully, then
for a larger file where the problems start. Note that the strace results do
behaviour.
Success:
open("test.xml", O_RDONLY|O_LARGEFILE) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=1858, ...}) = 0
open("test2.xml", O_WRONLY|O_TRUNC|O_LARGEFILE) = 4
fstat64(4, {st_mode=S_IFREG|0644, st_size=0, ...}) = 0
fstat64(3, {st_mode=S_IFREG|0644, st_size=1858, ...}) = 0
read(3, "<?xml version=\"1.0\" ?><source_li"..., 4096) = 1858
write(4, "<?xml version=\"1.0\" ?><source_li"..., 1858) = 1858
read(3, "", 4096) = 0
close(4) = 0
close(3) = 0
exit_group(0) = ?
Failure:
open("test.png", O_RDONLY|O_LARGEFILE) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=17318, ...}) = 0
open("test2.png", O_WRONLY|O_TRUNC|O_LARGEFILE) = 4
fstat64(4, {st_mode=S_IFREG|0644, st_size=0, ...}) = 0
fstat64(3, {st_mode=S_IFREG|0644, st_size=17318, ...}) = 0
read(3, "\211PNG\r\n\32\n\0\0\0\rIHDR\0\0\3 \0\0\2X\10\6\0\0\0\232"..., 4096) = 4096
write(4, "\211PNG\r\n\32\n\0\0\0\rIHDR\0\0\3 \0\0\2X\10\6\0\0\0\232"..., 4096) = 4096
read(3, "\222$)\243\364\367\303\366\355a\305\243\266\26*+\335bW"..., 4096) = 4096
write(4, "\222$)\243\364\367\303\366\355a\305\243\266\26*+\335bW"..., 4096) = 4096
read(3, "\244\24\364\302\v/\360\375\357\177\377\312\327N\262\334"..., 4096) = 4096
write(4, "\244\24\364\302\v/\360\375\357\177\377\312\327N\262\334"..., 4096) = 4096
read(3, "D\222$I\267\316\21,)I\215\217CM\r\24\26\302\322\245p\356"..., 4096) = 4096
write(4, "D\222$I\267\316\21,)I\215\217CM\r\24\26\302\322\245p\356"..., 4096) = 4096
read(3, "\"\361\361\361\272\343\216;t\340\300\201p\227\202\10\365"..., 4096) = 934
write(4, "\"\361\361\361\272\343\216;t\340\300\201p\227\202\10\365"..., 934) = -1 EINVAL (Invalid argument)
Another failure:
open("test.png", O_RDONLY|O_LARGEFILE) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=17318, ...}) = 0
open("test2.png", O_WRONLY|O_CREAT|O_LARGEFILE, 0100644) = 4
fstat64(4, {st_mode=S_IFREG|0644, st_size=0, ...}) = 0
fstat64(3, {st_mode=S_IFREG|0644, st_size=17318, ...}) = 0
read(3, "\211PNG\r\n\32\n\0\0\0\rIHDR\0\0\3 \0\0\2X\10\6\0\0\0\232"..., 4096) = 4096
write(4, "\211PNG\r\n\32\n\0\0\0\rIHDR\0\0\3 \0\0\2X\10\6\0\0\0\232"..., 4096) = 4096
read(3, "\222$)\243\364\367\303\366\355a\305\243\266\26*+\335bW"..., 4096) = 4096
write(4, "\222$)\243\364\367\303\366\355a\305\243\266\26*+\335bW"..., 4096) = 4096
read(3, "\244\24\364\302\v/\360\375\357\177\377\312\327N\262\334"..., 4096) = 4096
write(4, "\244\24\364\302\v/\360\375\357\177\377\312\327N\262\334"..., 4096) = 4096
read(3, "D\222$I\267\316\21,)I\215\217CM\r\24\26\302\322\245p\356"..., 4096) = 4096
write(4, "D\222$I\267\316\21,)I\215\217CM\r\24\26\302\322\245p\356"..., 4096) = 4096
read(3, "\"\361\361\361\272\343\216;t\340\300\201p\227\202\10\365"..., 4096) = 934
write(4, "\"\361\361\361\272\343\216;t\340\300\201p\227\202\10\365"..., 934) = 934
read(3, "", 4096) = 0
close(4) = -1 EINVAL (Invalid argument)
And yet another one:
open("/home2/knodlseder/test.png", O_RDONLY|O_LARGEFILE) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=17318, ...}) = 0
open("/home2/knodlseder/test2.png", O_WRONLY|O_TRUNC|O_LARGEFILE) = 4
fstat64(4, {st_mode=S_IFREG|0644, st_size=0, ...}) = 0
fstat64(3, {st_mode=S_IFREG|0644, st_size=17318, ...}) = 0
read(3, "\211PNG\r\n\32\n\0\0\0\rIHDR\0\0\3 \0\0\2X\10\6\0\0\0\232"..., 4096) = 4096
write(4, "\211PNG\r\n\32\n\0\0\0\rIHDR\0\0\3 \0\0\2X\10\6\0\0\0\232"..., 4096) = 4096
read(3, "\222$)\243\364\367\303\366\355a\305\243\266\26*+\335bW"..., 4096) = 4096
write(4, "\222$)\243\364\367\303\366\355a\305\243\266\26*+\335bW"..., 4096) = 4096
read(3, "\244\24\364\302\v/\360\375\357\177\377\312\327N\262\334"..., 4096) = 4096
write(4, "\244\24\364\302\v/\360\375\357\177\377\312\327N\262\334"..., 4096) = 4096
read(3, "D\222$I\267\316\21,)I\215\217CM\r\24\26\302\322\245p\356"..., 4096) = 4096
write(4, "D\222$I\267\316\21,)I\215\217CM\r\24\26\302\322\245p\356"..., 4096) = -1 EINVAL (Invalid argument)