From: Bob Felts
Subject: Bug in SBCL 1.0.10?
Date: 
Message-ID: <1i7b54o.e8uwlu1r662b4N%wrf3@stablecross.com>
I'm running SBCL 1.0.10 via AquaMacs 1.2 and Slime 2.0 on Mac OS X
10.4.10.  The code below (obfuscated solution to a Project Euler
problem) causes Lisp to hang when compiling the function.  If I run sbcl
from the Terminal app and paste the function at the prompt, sbcl hangs
too.  Before I send this to the sbcl developers, can anyone confirm?  

Minor changes cause the problem to disappear, but I can't correlate the
changes to anything (e.g. change the last "15" to "1" and it compiles;
change "(* n (+ n 1) bim)" to "(* n (+ n 1))" and it compiles).
LispWorks has no problem with this code.

(defun foo ( )
  (labels ((bar (baz bim)
        (let ((n (+ baz bim)))
          (* n (+ n 1) bim))))
    (let ((a (bar 1 1))
     (b (bar 1 5))
     (c (bar 1 15)))
      (- (+ a b) c))))

From: Dimiter "malkia" Stanev
Subject: Re: Bug in SBCL 1.0.10?
Date: 
Message-ID: <5pk5grFrqjpvU1@mid.individual.net>
Bob Felts wrote:
> I'm running SBCL 1.0.10 via AquaMacs 1.2 and Slime 2.0 on Mac OS X
> 10.4.10.  The code below (obfuscated solution to a Project Euler
> problem) causes Lisp to hang when compiling the function.  If I run sbcl
> from the Terminal app and paste the function at the prompt, sbcl hangs
> too.  Before I send this to the sbcl developers, can anyone confirm?  
> 
> Minor changes cause the problem to disappear, but I can't correlate the
> changes to anything (e.g. change the last "15" to "1" and it compiles;
> change "(* n (+ n 1) bim)" to "(* n (+ n 1))" and it compiles).
> LispWorks has no problem with this code.
> 
> (defun foo ( )
>   (labels ((bar (baz bim)
>         (let ((n (+ baz bim)))
>           (* n (+ n 1) bim))))
>     (let ((a (bar 1 1))
>      (b (bar 1 5))
>      (c (bar 1 15)))
>       (- (+ a b) c))))
> 

I'm getting this on Windows with SBCL 1.0.9 (Starting sbcl, and pasting 
the data in it)

C:\>sbcl
This is SBCL 1.0.9, an implementation of ANSI Common Lisp.
More information about SBCL is available at <http://www.sbcl.org/>.

SBCL is free software, provided as is, with absolutely no warranty.
It is mostly in the public domain; some portions are provided under
BSD-style licenses.  See the CREDITS and COPYING files in the
distribution for more information.

This is experimental prerelease support for the Windows platform: use
at your own risk.  "Your Kitten of Death awaits!"
* (defun foo ( )
   (labels ((bar (baz bim)
         (let ((n (+ baz bim)))
           (* n (+ n 1) bim))))
     (let ((a (bar 1 1))
      (b (bar 1 5))
      (c (bar 1 15)))
       (- (+ a b) c))))
fatal error encountered in SBCL pid 4152:
GC invariant lost, file "gencgc.c", line 832

LDB monitor
ldb>
From: Alex Mizrahi
Subject: Re: Bug in SBCL 1.0.10?
Date: 
Message-ID: <4734b128$0$90268$14726298@news.sunsite.dk>
(message (Hello 'Bob)
(you :wrote  :on '(Fri, 9 Nov 2007 11:10:40 -0500))
(

 BF> I'm running SBCL 1.0.10 via AquaMacs 1.2 and Slime 2.0 on Mac OS X
 BF> 10.4.10.  The code below (obfuscated solution to a Project Euler
 BF> problem) causes Lisp to hang when compiling the function.  If I run
 BF> sbcl from the Terminal app and paste the function at the prompt, sbcl
 BF> hangs too.  Before I send this to the sbcl developers, can anyone
 BF> confirm?

yup. if you press ctrl-c, you'll see stuff like this:

167: (SB-KERNEL::SIMPLIFY-UNIONS
      (#<SB-KERNEL:NUMERIC-TYPE (INTEGER 180 180)>
       #<SB-KERNEL:NUMERIC-TYPE (INTEGER 360 360)>
       #<SB-KERNEL:NUMERIC-TYPE (INTEGER 108 108)>
       #<SB-KERNEL:NUMERIC-TYPE (INTEGER 600 600)>
       #<SB-KERNEL:NUMERIC-TYPE (INTEGER 1620 1620)>
       #<SB-KERNEL:NUMERIC-TYPE (INTEGER 192 192)>
       #<SB-KERNEL:NUMERIC-TYPE (INTEGER 300 300)>
       #<SB-KERNEL:NUMERIC-TYPE (INTEGER 720 720)>
       #<SB-KERNEL:NUMERIC-TYPE (INTEGER 132 132)>
       #<SB-KERNEL:NUMERIC-TYPE (INTEGER 330 330)>
       #<SB-KERNEL:NUMERIC-TYPE (INTEGER 810 810)>
       #<SB-KERNEL:NUMERIC-TYPE (INTEGER 138 138)> ...))
168: (SB-KERNEL::%TYPE-UNION
      (#<SB-KERNEL:NUMERIC-TYPE (INTEGER 180 180)>
       #<SB-KERNEL:NUMERIC-TYPE (INTEGER 360 360)>
       #<SB-KERNEL:NUMERIC-TYPE (INTEGER 108 108)>
       #<SB-KERNEL:NUMERIC-TYPE (INTEGER 600 600)>
       #<SB-KERNEL:NUMERIC-TYPE (INTEGER 1620 1620)>
       #<SB-KERNEL:NUMERIC-TYPE (INTEGER 192 192)>
       #<SB-KERNEL:NUMERIC-TYPE (INTEGER 300 300)>
       #<SB-KERNEL:NUMERIC-TYPE (INTEGER 720 720)>
       #<SB-KERNEL:NUMERIC-TYPE (INTEGER 132 132)>
       #<SB-KERNEL:NUMERIC-TYPE (INTEGER 330 330)>
       #<SB-KERNEL:NUMERIC-TYPE (INTEGER 810 810)>
       #<SB-KERNEL:NUMERIC-TYPE (INTEGER 138 138)> ...))
169: (SB-C::IR1-OPTIMIZE-COMBINATION
      #<SB-C::COMBINATION
        :FUN #<SB-C::REF :LEAF # {AD48569}>
        :ARGS (#<SB-C::COMBINATION :FUN # :ARGS # {AD48BF9}>
               #<SB-C::COMBINATION :FUN # :ARGS # {AD48EB9}>) {AD485A1}>)

so it looks like SIMPLIFY-UNIONS is buggy

)
(With-best-regards '(Alex Mizrahi) :aka 'killer_storm)
"Hanging In The Balance Of Deceit And Blasphemy") 
From: Waldek Hebisch
Subject: Re: Bug in SBCL 1.0.10?
Date: 
Message-ID: <fh2l7m$8kg$1@z-news.pwr.wroc.pl>
Bob Felts <····@stablecross.com> wrote:
> I'm running SBCL 1.0.10 via AquaMacs 1.2 and Slime 2.0 on Mac OS X
> 10.4.10.  The code below (obfuscated solution to a Project Euler
> problem) causes Lisp to hang when compiling the function.  If I run sbcl
> from the Terminal app and paste the function at the prompt, sbcl hangs
> too.  Before I send this to the sbcl developers, can anyone confirm?  
> 
> Minor changes cause the problem to disappear, but I can't correlate the
> changes to anything (e.g. change the last "15" to "1" and it compiles;
> change "(* n (+ n 1) bim)" to "(* n (+ n 1))" and it compiles).
> LispWorks has no problem with this code.
> 
> (defun foo ( )
>   (labels ((bar (baz bim)
>         (let ((n (+ baz bim)))
>           (* n (+ n 1) bim))))
>     (let ((a (bar 1 1))
>      (b (bar 1 5))
>      (c (bar 1 15)))
>       (- (+ a b) c))))
> 

I tried it using sbcl-1.0.4 on Intel Core 2 Duo running 64-bit Gentoo
Linux.   Compilation finished after hour and half.  So for me it
is not hanging, just compilation is extremally slow.  Given that
the function is very simple it is still a bug...

-- 
                              Waldek Hebisch
·······@math.uni.wroc.pl 
From: Rob Warnock
Subject: Re: Bug in SBCL 1.0.10?
Date: 
Message-ID: <n-GdnSim5c1noajanZ2dnUVZ_jidnZ2d@speakeasy.net>
Bob Felts <····@stablecross.com> wrote:
+---------------
| LispWorks has no problem with this code.
+---------------

Neither do CLISP or CMUCL: Both happily compile and run it:

    > (foo)

    -3864
    > 


-Rob

-----
Rob Warnock			<····@rpw3.org>
627 26th Avenue			<URL:http://rpw3.org/>
San Mateo, CA 94403		(650)572-2607