Re: compat_linux(8) has 2GB filesize limit in 4.2-stable

2008-02-06 Thread Glenn Mulvaney

Philip Guenther wrote:

On Feb 5, 2008 6:27 PM, Glenn Mulvaney [EMAIL PROTECTED] wrote:
  

I'm running a linux binary via compat_linux(8) built from
ports/emulators/fedora in 4.2-stable.  Emulated binaries can't create or
read files  2GB regardless of limits or login class.  Does anyone have
advice on how to remove this limit?



Can that Linux binary create and read files larger than 2GB on a
*Linux* system?  If it doesn't use 64bit capable syscalls, then
there's nothing the BSD compat layer can do about it.  As a
counter-example, a quick check shows that a 'cat' binary from RHEL AS
4 has no problems with a file over 4GB in size, but strace/ktrace show
that it uses the Linux fstat64() call, etc.

(Hmm, do the compat_linux versions of the 32bit-only syscalls return
EOVERFLOW like the Linux ones would on files 2GB?  I don't _see_ code
to check that...)
  


The binary definitely can create  read files larger than 2GB on a linux 
system.  It's the p4d binary from Perforce under emulation that I'm 
having a problem with. 

The 64bit calls are in the compat layer 
(/usr/src/sys/compat/linux/linux_file64.c)   ktrace shows calls to 
fstat64(), but pread() segvs on p4d reading files larger than 2GB, and 
pwrite() segvs on p4d writing files larger than 2GB. 


-Glenn



Re: compat_linux(8) has 2GB filesize limit in 4.2-stable

2008-02-06 Thread Miod Vallat

The binary definitely can create  read files larger than 2GB on a
linux system.  It's the p4d binary from Perforce under emulation that
I'm having a problem with. The 64bit calls are in the compat layer
(/usr/src/sys/compat/linux/linux_file64.c)   ktrace shows calls to
fstat64(), but pread() segvs on p4d reading files larger than 2GB, and
pwrite() segvs on p4d writing files larger than 2GB. -Glenn


COMPAT_LINUX emulation of pread() and pwrite() system calls is limited to
32-bit file offsets.

However, Linux kernels eventually changed these system calls to use 64-bit
file offsets (without using a different system call number, unfortunately).

The COMPAT_LINUX code is in dire need of an upgrade to match more recent
linux kernels...

Miod



Re: compat_linux(8) has 2GB filesize limit in 4.2-stable

2008-02-06 Thread Matthew Szudzik
 The COMPAT_LINUX code is in dire need of an upgrade to match more recent
 linux kernels...

I certainly agree.  For example, I need to compile a custom OpenBSD
kernel with this patch

 http://marc.info/?l=openbsd-miscm=119479722118605

just to get certain programs running under compat_linux.



compat_linux(8) has 2GB filesize limit in 4.2-stable

2008-02-05 Thread Glenn Mulvaney
I'm running a linux binary via compat_linux(8) built from 
ports/emulators/fedora in 4.2-stable.  Emulated binaries can't create or 
read files  2GB regardless of limits or login class.  Does anyone have 
advice on how to remove this limit?



-Glenn



Re: compat_linux(8) has 2GB filesize limit in 4.2-stable

2008-02-05 Thread Philip Guenther
On Feb 5, 2008 6:27 PM, Glenn Mulvaney [EMAIL PROTECTED] wrote:
 I'm running a linux binary via compat_linux(8) built from
 ports/emulators/fedora in 4.2-stable.  Emulated binaries can't create or
 read files  2GB regardless of limits or login class.  Does anyone have
 advice on how to remove this limit?

Can that Linux binary create and read files larger than 2GB on a
*Linux* system?  If it doesn't use 64bit capable syscalls, then
there's nothing the BSD compat layer can do about it.  As a
counter-example, a quick check shows that a 'cat' binary from RHEL AS
4 has no problems with a file over 4GB in size, but strace/ktrace show
that it uses the Linux fstat64() call, etc.

(Hmm, do the compat_linux versions of the 32bit-only syscalls return
EOVERFLOW like the Linux ones would on files 2GB?  I don't _see_ code
to check that...)


Philip Guenther