From: YANSWBVCG
Subject: gnu sigsegv handler broken in 2.43 (64-bit mode)
Date: 
Message-ID: <YK-dndxS8ehavMHanZ2dnUVZ_jOdnZ2d@comcast.com>
I attempted to build clisp 2.43 for 64-bit AMD OpenBSD 4.2.
configure reported a problem with sigsegv handling and
suggested using a handler. I downloaded the handler and
attempted to build it. The build fails with a compiler error.
====
gmake TARGETSTACK=" all" all-recursive
gmake[1]: Entering directory `/home/daf/Clisp/clisp-2.43/tools/libsigsegv-2.5'
Making all in src
gmake[2]: Entering directory `/home/daf/Clisp/clisp-2.43/tools/libsigsegv-2.5/src'
/bin/sh ../libtool --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I. -I.. -I. -I.    -g -O2 -c -o handler.lo handler.c
 gcc -DHAVE_CONFIG_H -I. -I.. -I. -I. -g -O2 -c handler.c -o handler.o
In file included from handler.c:20:
handler-unix.c: In function `sigsegv_handler':
handler-unix.c:147: error: structure has no member named `sc_esp'
handler-unix.c: In function `install_for':
handler-unix.c:322: warning: assignment from incompatible pointer type
gmake[2]: *** [handler.lo] Error 1
gmake[2]: Leaving directory `/home/daf/Clisp/clisp-2.43/tools/libsigsegv-2.5/src'
gmake[1]: *** [all-recursive] Error 1
gmake[1]: Leaving directory `/home/daf/Clisp/clisp-2.43/tools/libsigsegv-2.5'
gmake: *** [all] Error 2

From: Pekka Niiranen
Subject: Re: gnu sigsegv handler broken in 2.43 (64-bit mode)
Date: 
Message-ID: <475C2C90.1000009@pp5.inet.fi>
YANSWBVCG wrote:
> I attempted to build clisp 2.43 for 64-bit AMD OpenBSD 4.2.
> configure reported a problem with sigsegv handling and
> suggested using a handler. I downloaded the handler and
> attempted to build it. The build fails with a compiler error.
> ====
> gmake TARGETSTACK=" all" all-recursive
> gmake[1]: Entering directory `/home/daf/Clisp/clisp-2.43/tools/libsigsegv-2.5'
> Making all in src
> gmake[2]: Entering directory `/home/daf/Clisp/clisp-2.43/tools/libsigsegv-2.5/src'
> /bin/sh ../libtool --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I. -I.. -I. -I.    -g -O2 -c -o handler.lo handler.c
>  gcc -DHAVE_CONFIG_H -I. -I.. -I. -I. -g -O2 -c handler.c -o handler.o
> In file included from handler.c:20:
> handler-unix.c: In function `sigsegv_handler':
> handler-unix.c:147: error: structure has no member named `sc_esp'
> handler-unix.c: In function `install_for':
> handler-unix.c:322: warning: assignment from incompatible pointer type
> gmake[2]: *** [handler.lo] Error 1
> gmake[2]: Leaving directory `/home/daf/Clisp/clisp-2.43/tools/libsigsegv-2.5/src'
> gmake[1]: *** [all-recursive] Error 1
> gmake[1]: Leaving directory `/home/daf/Clisp/clisp-2.43/tools/libsigsegv-2.5'
> gmake: *** [all] Error 2

Hi,

I have too tried to compile CLISP v2.4x in
several OpenBSD/AMD64 -releases. No luck, ever.

Somebody should really redesign it to make it work with random malloc.

-pekka-
From: YANSWBVCG
Subject: Re: gnu sigsegv handler broken in 2.43 (64-bit mode)
Date: 
Message-ID: <M-Sdne5K66U8oMHanZ2dnUVZ_hmtnZ2d@comcast.com>
I configured clisp to use the gnu malloc and no sigsegv handler since
it seems to be broken. Then I got yet another error when I ran make:
=====
[snipped] ...
gmake[2]: Entering directory `/home/daf/Clisp/clisp-2.43/src/gllib'
gmake[3]: Entering directory `/home/daf/Clisp/clisp-2.43/src'
gmake[3]: Nothing to be done for `am--refresh'.
gmake[3]: Leaving directory `/home/daf/Clisp/clisp-2.43/src'
gmake[2]: Nothing to be done for `all-am'.
gmake[2]: Leaving directory `/home/daf/Clisp/clisp-2.43/src/gllib'
gmake[1]: Leaving directory `/home/daf/Clisp/clisp-2.43/src/gllib'
./lisp.run -B . -N locale -E 1:1 -Efile UTF-8 -Eterminal UTF-8 -norc -m 1800KW -x "(and (load \"init.lisp\") (sys::%saveinitmem) (ext::exit)) (ext::exit t)"
Cannot map memory to address 0x4000000000000 .
[spvw_mmap.d:359] errno = EINVAL: Invalid argument.
./lisp.run: Not enough memory for Lisp.
gmake: *** [interpreted.mem] Error 1

=====
I have 512 meg in my system. 
How much memory do I actually need to run Clisp in 64-bit mode?
From: Kaz Kylheku
Subject: Re: gnu sigsegv handler broken in 2.43 (64-bit mode)
Date: 
Message-ID: <4960aa8b-a1fc-4fcc-a9ef-411e3b1c3d10@l1g2000hsa.googlegroups.com>
On Dec 9, 11:10 am, YANSWBVCG <ยทยทยทยท@puf2.localhost.comcast.net> wrote:
> I configured clisp to use the gnu malloc and no sigsegv handler since
> it seems to be broken. Then I got yet another error when I ran make:
> =====
> [snipped] ...
> gmake[2]: Entering directory `/home/daf/Clisp/clisp-2.43/src/gllib'
> gmake[3]: Entering directory `/home/daf/Clisp/clisp-2.43/src'
> gmake[3]: Nothing to be done for `am--refresh'.
> gmake[3]: Leaving directory `/home/daf/Clisp/clisp-2.43/src'
> gmake[2]: Nothing to be done for `all-am'.
> gmake[2]: Leaving directory `/home/daf/Clisp/clisp-2.43/src/gllib'
> gmake[1]: Leaving directory `/home/daf/Clisp/clisp-2.43/src/gllib'
> ./lisp.run -B . -N locale -E 1:1 -Efile UTF-8 -Eterminal UTF-8 -norc -m 1800KW -x "(and (load \"init.lisp\") (sys::%saveinitmem) (ext::exit)) (ext::exit t)"
> Cannot map memory to address 0x4000000000000 .
> [spvw_mmap.d:359] errno = EINVAL: Invalid argument.
> ./lisp.run: Not enough memory for Lisp.
> gmake: *** [interpreted.mem] Error 1
>
> =====
> I have 512 meg in my system.
> How much memory do I actually need to run Clisp in 64-bit mode?

Wrong question; that's what you ask if you get ENOMEM from mmap; you
are getting EINVAL. So you have to investigate why. The error message
suggests that CLISP is mapping at a fixed address.

Unfortunately, that approach is usually a non-starter. The reason is
that you don't know what regions of the address space are available.
For a fixed-address mapping to work, it cannot overlap with any
existing mapping.

You have to know how the platform's mmap works: what is the address
range from which it carves out mappings, and in what direction does it
go. For instance, does it start mapping things near the top of its
range and work its way down, or vice versa? If you know these things,
you can forge a reasonable strategy for getting a fixed mapping, even
after a number of shared libraries have already loaded. You could try
mapping outside of mmap's arena, or you could try at the opposite end.