From owner-freebsd-emulation@FreeBSD.ORG Sun Mar 4 23:54:07 2007 Return-Path: X-Original-To: freebsd-emulation@freebsd.org Delivered-To: freebsd-emulation@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E3DD716A406 for ; Sun, 4 Mar 2007 23:54:07 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from mail2.fluidhosting.com (mx24.fluidhosting.com [204.14.89.7]) by mx1.freebsd.org (Postfix) with SMTP id 8E6FA13C4B6 for ; Sun, 4 Mar 2007 23:54:07 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: (qmail 32450 invoked by uid 399); 4 Mar 2007 23:27:27 -0000 Received: from localhost (HELO lap.dougb.net) (dougb@dougbarton.us@127.0.0.1) by localhost with SMTP; 4 Mar 2007 23:27:27 -0000 X-Originating-IP: 127.0.0.1 Message-ID: <45EB55DD.4030201@FreeBSD.org> Date: Sun, 04 Mar 2007 15:27:25 -0800 From: Doug Barton Organization: http://www.FreeBSD.org/ User-Agent: Thunderbird 2.0b2 (X11/20070116) MIME-Version: 1.0 To: jkim@freebsd.org, freebsd-emulation@freebsd.org Content-Type: multipart/mixed; boundary="------------080703080409030301040606" Cc: Subject: Linux emulation instability X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Mar 2007 23:54:08 -0000 This is a multi-part message in MIME format. --------------080703080409030301040606 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit jkim, The attached change to sys/i386/linux/linux_machdep.c causes my linux emulation to spontaneously reboot my machine (no panic, just BOOM) whenever I use the linux version of the thunderbird beta (that I'm using right now to type this). I built a system from sources right before this change and everything is normal, then when I add this change it becomes unstable. I'm currently in the process of building an up to date -current without this change to see if that's stable for me, but I thought you'd want to know ASAP. Doug -- This .signature sanitized for your protection --------------080703080409030301040606 Content-Type: text/plain; name="linux-bad.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="linux-bad.diff" Index: linux_machdep.c =================================================================== RCS file: /usr/local/ncvs/src/sys/i386/linux/linux_machdep.c,v retrieving revision 1.72 retrieving revision 1.73 diff -u -r1.72 -r1.73 --- linux_machdep.c 24 Feb 2007 16:49:25 -0000 1.72 +++ linux_machdep.c 27 Feb 2007 02:08:01 -0000 1.73 @@ -27,7 +27,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/i386/linux/linux_machdep.c,v 1.72 2007/02/24 16:49:25 netchild Exp $"); +__FBSDID("$FreeBSD: src/sys/i386/linux/linux_machdep.c,v 1.73 2007/02/27 02:08:01 jkim Exp $"); #include #include @@ -684,7 +684,9 @@ if (bsd_args.prot & (PROT_READ | PROT_WRITE | PROT_EXEC)) bsd_args.prot |= PROT_READ | PROT_EXEC; - if (linux_args->fd != -1) { + /* Linux does not check file descriptor when MAP_ANONYMOUS is set. */ + bsd_args.fd = (bsd_args.flags & MAP_ANON) ? -1 : linux_args->fd; + if (bsd_args.fd != -1) { /* * Linux follows Solaris mmap(2) description: * The file descriptor fildes is opened with @@ -692,7 +694,7 @@ * protection options specified. */ - if ((error = fget(td, linux_args->fd, &fp)) != 0) + if ((error = fget(td, bsd_args.fd, &fp)) != 0) return (error); if (fp->f_type != DTYPE_VNODE) { fdrop(fp, td); @@ -707,7 +709,6 @@ fdrop(fp, td); } - bsd_args.fd = linux_args->fd; if (linux_args->flags & LINUX_MAP_GROWSDOWN) { /* --------------080703080409030301040606--