Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Sun, Dec 02, 2007 at 12:59:15AM -0800, Carl Shapiro wrote:
> On Dec 1, 2007 9:48 PM, Kostik Belousov 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=3D601000
> signum=3D10,info->si_code=3D12,context=3D0xbfbfe9d0
> 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=3D700055
> signum=3D11,info->si_code=3D2,context=3D0xbfbfe9e0
> 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=3D118304 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
if (getosreldate() < 700004)
sig_memory_fault =3D SIGBUS;
sig_memory_fault =3D 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).

Content-Type: application/pgp-signature
Content-Disposition: inline

Version: GnuPG v1.4.7 (FreeBSD)

iD8DBQFHUsGXC3+MBN1Mb4gRAjVjAKCu80neeehUtfD+mlzJAj f6h+ipSACfUmKB