From: Dr. Werner Fink
Subject: CLISP 1996-07-22
Date: 
Message-ID: <ts67z8brwo.fsf@boole.fs100.suse.de>
Hi,

        I'm currently working on CLISP 1996-07-22, a Common Lisp
implementation done by Bruno Haible, Michael Stoll and Marcus Daniels.
The interpreter should run under Linux-2.0.29/ELF (gcc is 2.7.2.1,
binutils 2.7.0.3/2.7.0.9, libc 5.2.18/5.4.7 and higher).

On compiling the full set of possibilities I've detected that the
generational gc will not work under ELF ... a short test of this
can be done with the binary packages on
  ftp://sunsite.unc.edu/pub/linux/devel/lang/lisp/clisp-linux-elf.tar.gz
by making the lisp interpreter with the full set of the possible
modules (make fromdir=full). On the first gc one gets the ``final'' result:

*** - handle_fault error2 ! address = 0x4010C00 not in [0x4000000,0x4000000) !
SIGSEGV cannot be cured. Fault address = 0x4010C00.
Segmentation fault

Ok, the intervall is really funny ;-) ... it's looks like a mistake in
the complicated cpp macros in lispbibl.d/lispbibl.c ...
Is there any fix avaible to get the generational garbage collection
stabel on work under ELF?

With -DNO_GENERATIONAL_GC the normal garbage collection works without
stopping during the tests with `full/lisp.run -M full/lispinit.mem'.
Only the 15 digit definition of PI and the usage of libm causes some
precision errors.

Note: I have to add the option -freg-struct-return to make the tests
during configure happy ... and I'm using readline, dynamic-ffi, and
after a few changes dynamic-modules.

BTW: One question more: What's the main difference of the gcl and the
CLIPS implementation of Common Lisp (speed, language and graphic
interfaces, function calls, ..., CLtL2 support, running maxima)?


      Werner

-- 
 Dr. Werner Fink  --  S.u.S.E. GmbH,  Gebhardtstr. 2, 90762 Fuerth,  Germany
 ···········@suse.de     http://www.suse.de/~werner/     fax:+49-911-3206727
 Click <A HREF="http://www.suse.de/~werner/">here</A>
------   Hiroshima '45   -----   Chernobyl '86   -----   Windows '95   -----
From: Bruno Haible
Subject: Re: CLISP 1996-07-22
Date: 
Message-ID: <5fmvuk$o1u$1@nz12.rz.uni-karlsruhe.de>
Dr. Werner Fink <······@boole.fs100.suse.de> wrote:
>
> The interpreter should run under Linux-2.0.29/ELF (gcc is 2.7.2.1,
> binutils 2.7.0.3/2.7.0.9, libc 5.2.18/5.4.7 and higher).
>
> On compiling the full set of possibilities I've detected that the
> generational gc will not work under ELF ... a short test of this
> can be done with the binary packages on
>  ftp://sunsite.unc.edu/pub/linux/devel/lang/lisp/clisp-linux-elf.tar.gz
> by making the lisp interpreter with the full set of the possible
> modules (make fromdir=full).

Dear Werner,

Thank you very much for the report. It is a bug in clisp's GC (generational
GC only) which occurs under certain conditions when FFI objects are present
in memory. Please apply this patch to the source before rebuilding clisp:

*** src/spvw.d.bak	Sun Jul 21 20:14:52 1996
--- src/spvw.d	Thu Mar  6 19:21:12 1997
***************
*** 4661,4677 ****
                                    { count = ((Srecord)objptr)->reclength; nextptr = objptr + size_srecord(count); }
                                    else
                                    { count = ((Xrecord)objptr)->reclength; nextptr = objptr + size_xrecord(count,((Xrecord)objptr)->recxlength); }
                                  if (nextptr >= gen0_start)
                                    { var aint ptr = (aint)&((Record)objptr)->recdata[0];
                                      if (ptr < gen0_start)
                                        { var uintL count_thispage = (gen0_start-ptr)/sizeof(object);
!                                         if ((varobject_alignment == sizeof(object)) # das erzwingt count >= count_thispage
!                                             || (count >= count_thispage)
!                                            )
                                            { count -= count_thispage; }
                                            else
                                            { count = 0; }
                                          ptr = gen0_start;
                                        }
                                      do { physpage->continued_addr = (object*)ptr;
                                           gen0_start += physpagesize;
--- 4661,4675 ----
                                    { count = ((Srecord)objptr)->reclength; nextptr = objptr + size_srecord(count); }
                                    else
                                    { count = ((Xrecord)objptr)->reclength; nextptr = objptr + size_xrecord(count,((Xrecord)objptr)->recxlength); }
                                  if (nextptr >= gen0_start)
                                    { var aint ptr = (aint)&((Record)objptr)->recdata[0];
                                      if (ptr < gen0_start)
                                        { var uintL count_thispage = (gen0_start-ptr)/sizeof(object);
!                                         if (count >= count_thispage)
                                            { count -= count_thispage; }
                                            else
                                            { count = 0; }
                                          ptr = gen0_start;
                                        }
                                      do { physpage->continued_addr = (object*)ptr;
                                           gen0_start += physpagesize;
***************
*** 4792,4808 ****
                                      { count = ((Srecord)objptr)->reclength; nextptr = objptr + size_srecord(count); }
                                      else
                                      { count = ((Xrecord)objptr)->reclength; nextptr = objptr + size_xrecord(count,((Xrecord)objptr)->recxlength); }
                                    if (nextptr >= gen0_start)
                                      { var aint ptr = (aint)&((Record)objptr)->recdata[0];
                                        if (ptr < gen0_start)
                                          { var uintL count_thispage = (gen0_start-ptr)/sizeof(object);
!                                           if ((varobject_alignment == sizeof(object)) # das erzwingt count >= count_thispage
!                                               || (count >= count_thispage)
!                                              )
                                              { count -= count_thispage; }
                                              else
                                              { count = 0; }
                                            ptr = gen0_start;
                                          }
                                        do { physpage->continued_addr = (object*)ptr;
                                             gen0_start += physpagesize;
--- 4790,4804 ----
                                      { count = ((Srecord)objptr)->reclength; nextptr = objptr + size_srecord(count); }
                                      else
                                      { count = ((Xrecord)objptr)->reclength; nextptr = objptr + size_xrecord(count,((Xrecord)objptr)->recxlength); }
                                    if (nextptr >= gen0_start)
                                      { var aint ptr = (aint)&((Record)objptr)->recdata[0];
                                        if (ptr < gen0_start)
                                          { var uintL count_thispage = (gen0_start-ptr)/sizeof(object);
!                                           if (count >= count_thispage)
                                              { count -= count_thispage; }
                                              else
                                              { count = 0; }
                                            ptr = gen0_start;
                                          }
                                        do { physpage->continued_addr = (object*)ptr;
                                             gen0_start += physpagesize;

Many thanks for your help tracking this down!

                             Bruno