From owner-freebsd-emulation@FreeBSD.ORG Fri Mar 26 13:20:37 2004 Return-Path: Delivered-To: freebsd-emulation@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 33F5B16A4CE for ; Fri, 26 Mar 2004 13:20:37 -0800 (PST) Received: from dan.emsphone.com (dan.emsphone.com [199.67.51.101]) by mx1.FreeBSD.org (Postfix) with ESMTP id C199F43D41 for ; Fri, 26 Mar 2004 13:20:36 -0800 (PST) (envelope-from dan@dan.emsphone.com) Received: (from dan@localhost) by dan.emsphone.com (8.12.10/8.12.10) id i2QLKWBY034116; Fri, 26 Mar 2004 15:20:32 -0600 (CST) (envelope-from dan) Date: Fri, 26 Mar 2004 15:20:31 -0600 From: Dan Nelson To: Paul Mather Message-ID: <20040326212031.GE3446@dan.emsphone.com> References: <20031012000509.GA59843@gromit.dlib.vt.edu> <20040326181140.GA15934@dan.emsphone.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040326181140.GA15934@dan.emsphone.com> X-OS: FreeBSD 5.2-CURRENT X-message-flag: Outlook Error User-Agent: Mutt/1.5.6i cc: freebsd-emulation@freebsd.org Subject: Re: IBCS2 regression in FreeBSD 5?? X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.1 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: Fri, 26 Mar 2004 21:20:37 -0000 In the last episode (Mar 26), Dan Nelson said: > In the last episode (Oct 11), Paul Mather said: > > Does anyone know whether the IBCS2 emulation functionality > > regressed going from FreeBSD 4 to FreeBSD 5? I ask because I have > > a statically-linked SCO binary that works under FreeBSD 4.8-STABLE > > but not under FreeBSD 5.1-RELEASE-p10 (or a version of > > 5.1-CURRENT). > > > > I have ibcs2 and coff modules, and know that IBCS2 at least > > partially works. For example, I can run the "hello_world" example > > program in /usr/share/examples/ibcs2 as well as some others. But, > > the program in question exits immediately with "Abort". Here's > > what I get when running the program using ktrace on 5.1: > > > > 40019 ktrace RET ktrace 0 > > 40019 ktrace CALL execve(0xbfbffc7b,0xbfbffb88,0xbfbffb94) > > 40019 ktrace NAMI "/usr/adsm/dsmc" > > And I guess this is a very belated "me too" :) I get the same on > 5.2-RELEASE and -current. > > Paul, did you ever figure out the cause? After a short bit of debugging it looks like a memory mapping issue. The vm_map_find call at line 475 overlaps a previously-mapped range and fails. The error isn't checked, so the exec continues and the process aborts later. If I manually add one page to the map address it works and my test program is able to at least print out its version number. Here's a comparison of the /proc/pid/map files between 4.8 and 5.2. They were generated by trussing the program, then hitting ^Z to pause it. Without the truss it exited too quickly. ==> map.4 <== 0x0 0x6000 6 9 0xd62c4360 r-x 2 1 0x0 COW NC vnode 0x400000 0x403000 3 0 0xd68ad1e0 rwx 1 0 0x2180 COW NNC vnode 0x403000 0x406000 3 0 0xd6ffb7e0 rwx 1 0 0x2180 NCOW NNC default 0xbfbe0000 0xbfc00000 2 0 0xd6e73d80 rwx 1 0 0x2180 NCOW NNC default ==> map.5 <== 0x0 0x6000 6 14 0xc625b8c4 r-x 2 1 0x0 COW NC vnode /a/emssrv5/io1/g1/cobol.7a.1a.11.10/bin/cobrun 0x400000 0x403000 3 0 0xc3fe7840 rwx 1 0 0x2180 COW NNC vnode /a/emssrv5/io1/g1/cobol.7a.1a.11.10/bin/cobrun 0x403000 0x407000 3 0 0xc3edfc60 rwx 1 0 0x2180 NCOW NNC default - 0xbfbe0000 0xbfc00000 2 0 0xc60b3000 rwx 1 0 0x2180 NCOW NNC default - The third region looks like it has one extra page of memory allocated for some reason. And more interestingly, not all programs fail. I have one that works fine on a stock kernel. -- Dan Nelson dnelson@allantgroup.com