From: Hannah Schroeter
Subject: Clisp on OpenBSD
Date: 
Message-ID: <d5alu5$nbb$1@c3po.use.schlund.de>
Hello!

Seems clisp can't cope with the changes in OpenBSD-current (after the
tag for the upcoming 3.7 release, so the release seems still to include
a working clisp (based on 2.33.2)).

I asked around on the OpenBSD ports mailing list and got the hint that
the problem might very probably be related to the changes in the
malloc implementation, which now uses mmap for all allocations,
and non-MAP_FIXED mappings are randomized by the kernel's mmap
implementation.

A typical error I get when building on OpenBSD 3.7-current, i386 is like
this:

./lisp.run -B . -N locale -Efile UTF-8 -Eterminal UTF-8 -norc -m 750KW -x "(and (load \"init.lisp\") (sys::%saveinitmem) (ext::exit))"
Cannot map memory to address 0xe8477000 .
 errno = EINVAL: Invalid argument.
Trying to make room through a GC...
Cannot map memory to address 0xe8477000 .
 errno = EINVAL: Invalid argument.
Trying to make room through a GC...
Segmentation fault (core dumped)

And yeah, you can't mmap with MAP_FIXED and a hint of 0xe8477000, as
the mappable area is between 0 and 0xcfbfe000.

Can someone help out?

Kind regards,

Hannah.

From: Sam Steingold
Subject: Re: Clisp on OpenBSD
Date: 
Message-ID: <ufyx3yn6y.fsf@gnu.org>
> * Hannah Schroeter <······@fpuyhaq.qr> [2005-05-04 14:24:05 +0000]:
>
> Seems clisp can't cope with the changes in OpenBSD-current (after the
> tag for the upcoming 3.7 release, so the release seems still to include
> a working clisp (based on 2.33.2)).
>
> I asked around on the OpenBSD ports mailing list and got the hint that
> the problem might very probably be related to the changes in the
> malloc implementation, which now uses mmap for all allocations,
> and non-MAP_FIXED mappings are randomized by the kernel's mmap
> implementation.
>
> A typical error I get when building on OpenBSD 3.7-current, i386 is like
> this:
>
> ./lisp.run -B . -N locale -Efile UTF-8 -Eterminal UTF-8 -norc -m 750KW -x "(and (load \"init.lisp\") (sys::%saveinitmem) (ext::exit))"
> Cannot map memory to address 0xe8477000 .
>  errno = EINVAL: Invalid argument.
> Trying to make room through a GC...
> Cannot map memory to address 0xe8477000 .
>  errno = EINVAL: Invalid argument.
> Trying to make room through a GC...
> Segmentation fault (core dumped)
>
> And yeah, you can't mmap with MAP_FIXED and a hint of 0xe8477000, as
> the mappable area is between 0 and 0xcfbfe000.

Take a look at clisp/unix/PLATFORMS - it contains many portability hints.

-- 
Sam Steingold (http://www.podval.org/~sds) running w2k
<http://pmw.org.il/> <http://www.memri.org/> <http://www.mideasttruth.com/>
<http://www.palestinefacts.org/> <http://ffii.org/> <http://www.camera.org>
I just forgot my whole philosophy of life!!!
From: Florian Weimer
Subject: Re: Clisp on OpenBSD
Date: 
Message-ID: <87oebrvvn1.fsf@deneb.enyo.de>
* Hannah Schroeter:

> I asked around on the OpenBSD ports mailing list and got the hint that
> the problem might very probably be related to the changes in the
> malloc implementation, which now uses mmap for all allocations,
> and non-MAP_FIXED mappings are randomized by the kernel's mmap
> implementation.

Correct.  Unfortunately, the OpenBSD maintainers refuse to add ways to
reenable deterministic mappings.

The solution is simple: Don't use OpenBSD.  Other systems provide both
address space randomization (for processes mainly written in C) and
backwards-compatible mappings for everything else.
From: Bruno Haible
Subject: Re: Clisp on OpenBSD
Date: 
Message-ID: <d5fnpg$e1l$1@laposte.ilog.fr>
Hannah Schroeter wrote:

> A typical error I get when building on OpenBSD 3.7-current, i386 is like
> this:
> Cannot map memory to address 0xe8477000 .
> errno = EINVAL: Invalid argument.
> ...
> the mappable area is between 0 and 0xcfbfe000.

Try building clisp with the following in the Makefile's CFLAGS:
-DNO_SINGLEMAP -DNO_TRIVIALMAP -DNO_MULTIMAP_FILE -DNO_MULTIMAP_SHM

This will disable the use of mmap() and generational GC, but yield a
working clisp.

Bruno