From owner-freebsd-bugs@FreeBSD.ORG Tue Jan 24 16:30:39 2006 Return-Path: X-Original-To: freebsd-bugs@hub.freebsd.org Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0407E16A41F for ; Tue, 24 Jan 2006 16:30:39 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 091BB43D91 for ; Tue, 24 Jan 2006 16:30:21 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id k0OGUIiv082488 for ; Tue, 24 Jan 2006 16:30:18 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id k0OGUIIQ082487; Tue, 24 Jan 2006 16:30:18 GMT (envelope-from gnats) Date: Tue, 24 Jan 2006 16:30:18 GMT Message-Id: <200601241630.k0OGUIIQ082487@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org From: David Kelly Cc: Subject: Re: kern/92243: sendfile(2) returns early on files > 4GB X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: David Kelly List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Jan 2006 16:30:39 -0000 The following reply was made to PR kern/92243; it has been noted by GNATS. From: David Kelly To: "David G. Lawrence" Cc: freebsd-gnats-submit@FreeBSD.org Subject: Re: kern/92243: sendfile(2) returns early on files > 4GB Date: Tue, 24 Jan 2006 10:29:13 -0600 On Mon, Jan 23, 2006 at 11:09:08PM -0800, David G. Lawrence wrote: > > >How-To-Repeat: > > Get a file which is larger than 4G via ftpd, apache, or anything else which uses sendfile(2). > > Do you know if sendfile(2) is returning an error in the failure case? I don't know the method for attaching gdb to a running daemon, have never had need of it before. Have sprinkled printf's in ftpd and edited the return message trying to understand what is happening. I think sendfile is returning once and ftpd is calling it again then the 2nd time the count is zero so ftp returns "premature end." This is untouched stock RELENG6: 230 User dkelly logged in. Remote system type is UNIX. Using binary mode to transfer files. ftp> get test/bigfile /dev/null local: /dev/null remote: test/bigfile 229 Entering Extended Passive Mode (|||50786|) 150 Opening BINARY mode data connection for 'test/bigfile' (4556820480 bytes). 226 Transfer finished due to premature end of file. 261853184 bytes received in 00:05 (48.76 MB/s) ftp> It always leaves exactly 4GB behind: dkelly@Grumpy {1009} dc 16 o 4556820480 261853184 - p 100000000 If I copy bigfile: dkelly@Grumpy {1010} cp -p test/bigfile test/big2 Then the ftpd/sendfile works for the next few hours or days or until reboot. Doesn't matter if the file is hosted on my simple one-disk filesystem or my 2-disk gvinum striped filesystem. dkelly@Grumpy {1011} ftp localhost Trying ::1... Connected to localhost.home. 220 Grumpy.DynDNS.org FTP server (Version 6.00LS) ready. Name (localhost:dkelly): 331 Password required for dkelly. Password: 230 User dkelly logged in. Remote system type is UNIX. Using binary mode to transfer files. ftp> get test/big2 /dev/null local: /dev/null remote: test/big2 229 Entering Extended Passive Mode (|||50787|) 150 Opening BINARY mode data connection for 'test/big2' (4556820480 bytes). 226 Transfer complete. 4556820480 bytes received in 02:11 (32.94 MB/s) ftp> -- David Kelly N4HHE, dkelly@HiWAAY.net ======================================================================== Whom computers would destroy, they must first drive mad.