cp file with zero size: EINVAL

From: Bjoern A. Zeeb <bzeeb-lists_at_lists.zabbadoz.net>
Date: Fri, 23 Jan 2004 09:08:14 +0000 (UTC)
Hi,

I am running a kernel about a week old (HEAD) and some world from
around 22 Sep.  For some reason I had not installed world yet (though
built).

Now I am seeing this:

bz_at_host:~> touch abc
bz_at_host:~> ls -l abc
-rw-rw-r--    1 bz       staff           0 Jan 23 08:51 abc
bz_at_host:~> cp abc abd
cp: abc: Invalid argument

This works fine with a some day old HEAD and 5.2R so I first suspected
that it may be related to the statfs changes and my inconstistent
userspace/kernel. COMPAT_FREEBSD4 is set in the new kernel of course.

Then I did a ktrace cp abc abd. Here is the output of the relevant
parts of kdump output:

--- cut ---
...
 53044 cp       CALL  mmap(0,0x1000,0x3,0x1002,0xffffffff,0,0,0)
 53044 cp       RET   mmap 671477760/0x2805f000
 53044 cp       CALL  break(0x8073000)
 53044 cp       RET   break 0
 53044 cp       CALL  break(0x8074000)
 53044 cp       RET   break 0
 53044 cp       CALL  break(0x8075000)
 53044 cp       RET   break 0
 53044 cp       CALL  break(0x8076000)
 53044 cp       RET   break 0
 53044 cp       CALL  stat(0x80751a8,0x8075148)
 53044 cp       NAMI  "abc"
 53044 cp       RET   stat 0
 53044 cp       CALL  stat(0x805f048,0xbfbfe480)
 53044 cp       NAMI  "abd"
 53044 cp       RET   stat 0
 53044 cp       CALL  open(0x8074000,0,0)
 53044 cp       NAMI  "abc"
 53044 cp       RET   open 3
 53044 cp       CALL  open(0x805f048,0x401,0)
 53044 cp       NAMI  "abd"
 53044 cp       RET   open 4
 53044 cp       CALL  mmap(0,0,0x1,0x1,0x3,0,0,0)
 53044 cp       RET   mmap 671477760/0x2805f000
 53044 cp       CALL  write(0x4,0x2805f000,0)
 53044 cp       GIO   fd 4 wrote 0 bytes
       ""
 53044 cp       RET   write 0
 53044 cp       CALL  munmap(0x2805f000,0)
 53044 cp       RET   munmap -1 errno 22 Invalid argument
 53044 cp       CALL  write(0x2,0xbfbfdc60,0x4)
 53044 cp       GIO   fd 2 wrote 4 bytes
       "cp: "
 53044 cp       RET   write 4
 53044 cp       CALL  write(0x2,0xbfbfdc80,0x3)
 53044 cp       GIO   fd 2 wrote 3 bytes
       "abc"
 53044 cp       RET   write 3
 53044 cp       CALL  write(0x2,0x805caea,0x2)
 53044 cp       GIO   fd 2 wrote 2 bytes
       ": "
 53044 cp       RET   write 2
 53044 cp       CALL  write(0x2,0xbfbfdc60,0x11)
 53044 cp       GIO   fd 2 wrote 17 bytes
       "Invalid argument
       "
 53044 cp       RET   write 17/0x11
 53044 cp       CALL  close(0x3)
 53044 cp       RET   close 0
 53044 cp       CALL  close(0x4)
 53044 cp       RET   close 0
 53044 cp       CALL  exit(0x1)
--- cut ---

If I remember correctly there had been some changes around this...
Compat problem with new kernel and old binaries ?
Just wanted to let you know.

Building HEAD and kernel now, creating a backup and going to
install then.

-- 
Greetings

Bjoern A. Zeeb				bzeeb at Zabbadoz dot NeT
56 69 73 69 74				http://www.zabbadoz.net/
Received on Fri Jan 23 2004 - 00:08:39 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:37:39 UTC