From owner-freebsd-current@FreeBSD.ORG Thu Nov 29 11:28:33 2007 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B960816A41A for ; Thu, 29 Nov 2007 11:28:33 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from relay02.kiev.sovam.com (relay02.kiev.sovam.com [62.64.120.197]) by mx1.freebsd.org (Postfix) with ESMTP id 5AD1213C465 for ; Thu, 29 Nov 2007 11:28:33 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from [212.82.216.226] (helo=deviant.kiev.zoral.com.ua) by relay02.kiev.sovam.com with esmtps (TLSv1:AES256-SHA:256) (Exim 4.67) (envelope-from ) id 1IxhZE-000Ma9-TP; Thu, 29 Nov 2007 13:28:31 +0200 Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.1/8.14.1) with ESMTP id lATBSOpn071332; Thu, 29 Nov 2007 13:28:24 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.2/8.14.2/Submit) id lATBSOYj071331; Thu, 29 Nov 2007 13:28:24 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 29 Nov 2007 13:28:24 +0200 From: Kostik Belousov To: Carl Shapiro Message-ID: <20071129112824.GD83121@deviant.kiev.zoral.com.ua> References: <4dcb5abd0711290226u69105089ya10526519e5cc12d@mail.gmail.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="hxkXGo8AKqTJ+9QI" Content-Disposition: inline In-Reply-To: <4dcb5abd0711290226u69105089ya10526519e5cc12d@mail.gmail.com> User-Agent: Mutt/1.4.2.3i X-Scanner-Signature: b46f4584ea35a5bfe65e3be67b2b2352 X-DrWeb-checked: yes X-SpamTest-Envelope-From: kostikbel@gmail.com X-SpamTest-Group-ID: 00000000 X-SpamTest-Info: Profiles 1835 [Nov 29 2007] X-SpamTest-Info: helo_type=3 X-SpamTest-Info: {received from trusted relay: not dialup} X-SpamTest-Method: none X-SpamTest-Method: Local Lists X-SpamTest-Rate: 0 X-SpamTest-Status: Not detected X-SpamTest-Status-Extended: not_detected X-SpamTest-Version: SMTP-Filter Version 3.0.0 [0255], KAS30/Release Cc: freebsd-current@freebsd.org, davidxu@freebsd.org Subject: Re: Serious compatibility breakage in -current. X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2007 11:28:33 -0000 --hxkXGo8AKqTJ+9QI Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Nov 29, 2007 at 02:26:11AM -0800, Carl Shapiro wrote: > Developers, >=20 > FreeBSD 7 has changed the protection violation signal from SIGBUS to > SIGSEGV. Unfortunately, when an old binary is run on a current > FreeBSD system, protection violations cause a SIGSEGV to be delivered > to the executable instead of the anticipated SIGBUS. Binaries > compiled on older versions of FreeBSD are not prepared to handle > SIGSEGV in response to page protection violations. >=20 > One consequence of this change is that applications that handle page > protection violations, such as the CMUCL Lisp compiler have broken. > CMUCL binaries compiled for FreeBSD 4, FreeBSD 5, and FreeBSD 6 crash > on -current. Investments FreeBSD users have in binaries that handle > page protection violations, such as things that link against boehm-gc, > are lost forever. This significantly increases the cost of an upgrade > to FreeBSD 7. >=20 > The switch from SIGBUS to SIGSEGV is well motivated. However, it is > not clear that consideration was given to binaries running under > compat{4,5,6}x. One would expect the compat infrastructure to > translate protection violation signals from SIGSEGV to SIGBUS while > executing older binaries. This would ensure that the applications > that establish SIGBUS handlers to catch protection violations continue > to work. >=20 > Among the open source operating systems the FreeBSD project has one of > the best traditions of supporting old binaries. It would truly be a > shame for this tradition to abruptly end as of the next major release. > As a developer who supports several versions of FreeBSD through > binary compatibility anything that can help us avoid breakage as of > the next FreeBSD release would be appreciated. >=20 > Thanks, >=20 > Carl (and the many FreeBSD users of CMUCL) I can confirm that FreeBSD-6 binary of the CMUCL 19d does not work. It is interesting that sbcl has no problems on RELENG_7. The change of the raised signal was introduced in the following commit: i386/i386/trap.c, revision 1.282 amd64/amd64/trap.c, revision 1.295 date: 2005/10/14 12:43:45; author: davidxu; state: Exp; lines: +41 -12 Please, try the patch below and report whether it is enough to fix cmucl and any other regressions. diff --git a/sys/amd64/amd64/trap.c b/sys/amd64/amd64/trap.c index 62d81f6..ba32fc7 100644 --- a/sys/amd64/amd64/trap.c +++ b/sys/amd64/amd64/trap.c @@ -311,10 +311,8 @@ trap(struct trapframe *frame) =20 if (i =3D=3D SIGSEGV) ucode =3D SEGV_MAPERR; - else { - i =3D SIGSEGV; /* XXX hack */ - ucode =3D SEGV_ACCERR; - } + else + ucode =3D BUS_ADRERR; break; =20 case T_DIVIDE: /* integer divide fault */ diff --git a/sys/i386/i386/trap.c b/sys/i386/i386/trap.c index e66fa1e..3127488 100644 --- a/sys/i386/i386/trap.c +++ b/sys/i386/i386/trap.c @@ -374,10 +374,8 @@ trap(struct trapframe *frame) =20 if (i =3D=3D SIGSEGV) ucode =3D SEGV_MAPERR; - else { - i =3D SIGSEGV; /* XXX hack */ - ucode =3D SEGV_ACCERR; - } + else=20 + ucode =3D BUS_ADRERR; addr =3D eva; break; =20 --hxkXGo8AKqTJ+9QI Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (FreeBSD) iD8DBQFHTqJXC3+MBN1Mb4gRAiJRAJ9D3FAHt/97MdF3QJVEJeWC8Dz9KQCgyva6 kK6XqNk9aBhyvtVTk2oIDek= =qlYG -----END PGP SIGNATURE----- --hxkXGo8AKqTJ+9QI--