public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [BUG] copy file result with zero
@ 2011-10-01 14:01 Dave Young
  2011-10-01 14:39 ` Ted Ts'o
  0 siblings, 1 reply; 15+ messages in thread
From: Dave Young @ 2011-10-01 14:01 UTC (permalink / raw)
  To: Linux Kernel Mailing List; +Cc: linux-ext4

Hi,

Weird problem, when I build app from source,
make; make install
run the command, but got "cannot execute binary file"

hexdump shows the installed binary is full of zero

Is it related to ext4 fiemap problem described below?
http://lwn.net/Articles/429349/

I finally managed to find the way to reproduce this:
just cp a elf binary A  to file B, then cp B to file C,  then you will get:
A == B != C

ie.
cp /bin/ls ls1
cp ls1 ls2

ls2 will be filled with zero

Below is a strace log of install, kernel version is 3.1.0-rc6+
geteuid()                               = 0
umask(0)                                = 022
stat("/tmp/vpnc", 0x7fff85363710)       = -1 ENOENT (No such file or directory)
stat("vpnc", {st_mode=S_IFREG|0755, st_size=368662, ...}) = 0
lstat("/tmp/vpnc", 0x7fff85363250)      = -1 ENOENT (No such file or directory)
open("vpnc", O_RDONLY)                  = 3
fstat(3, {st_mode=S_IFREG|0755, st_size=368662, ...}) = 0
open("/tmp/vpnc", O_WRONLY|O_CREAT|O_EXCL, 0755) = 4
fstat(4, {st_mode=S_IFREG|0755, st_size=0, ...}) = 0
uname({sys="Linux", node="darkstar", ...}) = 0
ioctl(3, FS_IOC_FIEMAP, 0x7fff85361f60) = 0
ftruncate(4, 368662)                    = 0
fsetxattr(4, "system.posix_acl_access",
"\x02\x00\x00\x00\x01\x00\x06\x00\xff\xff\xff\xff\x04\x00\x00\x00\xff\xff\xff\xff
\x00\x00\x00\xff\xff\xff\xff", 28, 0) = 0
close(4)                                = 0
close(3)                                = 0
chmod("/tmp/vpnc", 0755)                = 0
close(0)                                = 0
close(1)                                = 0
close(2)                                = 0
exit_group(0)                           = ?
-- 
Regards
Dave

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2011-10-03 15:52 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-01 14:01 [BUG] copy file result with zero Dave Young
2011-10-01 14:39 ` Ted Ts'o
2011-10-01 23:37   ` Dave Young
2011-10-02  6:41     ` Jeff liu
2011-10-02  7:59       ` Andreas Dilger
2011-10-02  7:14         ` Jeff liu
2011-10-02  8:46           ` Dave Young
2011-10-02 11:54         ` Christoph Hellwig
2011-10-03  9:26         ` Yongqiang Yang
2011-10-03 13:11           ` Lukas Czerner
2011-10-03 14:18             ` Ted Ts'o
2011-10-03 15:51               ` Lukas Czerner
2011-10-02  8:02       ` Andreas Dilger
2011-10-02  8:43         ` Dave Young
2011-10-03 11:08           ` Pádraig Brady

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox