Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 26 Mar 2004 15:20:31 -0600
From:      Dan Nelson <dnelson@allantgroup.com>
To:        Paul Mather <paul@gromit.dlib.vt.edu>
Cc:        freebsd-emulation@freebsd.org
Subject:   Re: IBCS2 regression in FreeBSD 5??
Message-ID:  <20040326212031.GE3446@dan.emsphone.com>
In-Reply-To: <20040326181140.GA15934@dan.emsphone.com>
References:  <20031012000509.GA59843@gromit.dlib.vt.edu> <20040326181140.GA15934@dan.emsphone.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040326212031.GE3446>