Re: Serious compatibility breakage in -current.

From: Kostik Belousov <kostikbel_at_gmail.com>
Date: Sun, 2 Dec 2007 16:30:48 +0200
On Sun, Dec 02, 2007 at 12:59:15AM -0800, Carl Shapiro wrote:
> On Dec 1, 2007 9:48 PM, Kostik Belousov <kostikbel_at_gmail.com> wrote:
> > Is this some new code ? I did tested it on CLUCL-19d compiled for
> > RELENG_6. Also, the sigbus_handler() from lisp/FreeBSD-os.c rev 1.12
> > does not contain the check, it seems (that describes why it worked for
> > me).
> 
> Okay, this clearly explains why we are seeing different things.  The
> si_code check was added in version 1.16.  This postdates the release
> of CMUCL your first patch was tested against.  Incidentally, I added
> that check to the SIGBUS handler and should have known that it does
> not appear in a formal release.  Sorry about that.
> 
> > Could you, please, describe what was tested in more details ? Did
> > you run the CMUCL (and sbcl) with the patch ? If yes, could you, please,
> > show the file(1) output on the bin/lisp and bin/sbcl binary ?
> 
> I have a small test program that maps a page with PROT_NONE and
> generates a protection violation by writing a byte to it.  The "mmap6"
> executable was compiled on a FreeBSD 6.1 system.  The "mmap7"
> executable was compiled on my 7.0-BETA3 system with your patch
> applied.  Below is a transcript of these two programs being run on the
> patched 7.0-BETA3 system.
> 
> freebsd7% file mmap6
> mmap6: ELF 32-bit LSB executable, Intel 80386, version 1 (FreeBSD),
> dynamically linked (uses shared libs), not stripped
> freebsd7% ./mmap6
> __FreeBSD_version=601000
> signum=10,info->si_code=12,context=0xbfbfe9d0
> freebsd7% file ./mmap7
> ./mmap7: ELF 32-bit LSB executable, Intel 80386, version 1 (FreeBSD),
> for FreeBSD 7.0 (700055), dynamically linked (uses shared libs),
> FreeBSD-style, not stripped
> freebsd7% ./mmap7
> __FreeBSD_version=700055
> signum=11,info->si_code=2,context=0xbfbfe9e0
> 
> The source code to this program is in a bug report I submitted a few
> days ago and errantly filed under "misc".  Please visit
> http://www.freebsd.org/cgi/query-pr.cgi?pr=118304 and page down to the
> "How-To-Repeat" heading.
> 
> I have also recompiled CMUCL on a FreeBSD 7 system starting with a
> FreeBSD 6 binary and everything seems to work.  I believe the output
> of my small test program provides sufficient proof that the interfaces
> we rely on are working as expected.

Yes, I have the similar program to. I asked somewhat different question.
sbcl has the following code in the src/runtime/bsd-os.c:

    /* Memory fault signal on FreeBSD was changed from SIGBUS to
     * SIGSEGV. */
    if (getosreldate() < 700004)
        sig_memory_fault = SIGBUS;
    else
        sig_memory_fault = SIGSEGV;

It shall broke in the way similar to the CMUCL, after I commit the patch
to CURRENT/RELENG_7, regardless of whether I MFC crtbrand.c fix to RELENG_6.
This is why the machdep sysctls for i386/amd64 are introduced.

Are you satisfied with this ? I, even after help from Kris Kennaway,
still unable to provide the solution that does not broke something, at
least without manual intervention (aka sysctl).

Received on Sun Dec 02 2007 - 13:30:57 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:23 UTC