Control stack exhaustion when compiling large /= form

Bug #1753004 reported by Paul F. Dietz on 2018-03-02
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SBCL
Undecided
Unassigned

Bug Description

(defun m2 (n) `(lambda () (/= ,@ (loop for i from 1 to n collect i))))

(m2 10) ==> (lambda () (/= 1 2 3 4 5 6 7 8 9 10))

(compile nil (m2 120))

==>

Control stack exhausted (no more space for function call frames).
This is probably due to heavily nested or infinitely recursive function
calls, or a tail call that SBCL cannot or has not optimized away.
[...]
  0: (SB-KERNEL::CONTROL-STACK-EXHAUSTED-ERROR)
  1: ("foreign function: call_into_lisp")
  2: ("foreign function: post_signal_tramp")
  3: (SB-KERNEL::VALUES-SPECIFIER-TYPE-R ((OR FUNCTION SYMBOL) . T) (OR FUNCTION SYMBOL))
  4: (SB-KERNEL:VALUES-SPECIFIER-TYPE (OR FUNCTION SYMBOL))
  5: (SB-C::COMPILER-VALUES-SPECIFIER-TYPE (OR FUNCTION SYMBOL))
  6: (SB-C::THE-IN-POLICY (OR FUNCTION SYMBOL) #<SB-C::GLOBAL-VAR :%SOURCE-NAME = :TYPE #1=#<SB-KERNEL:FUN-TYPE (FUNCTION (NUMBER &REST NUMBER) (VALUES BOOLEAN &OPTIONAL))> :DEFINED-TYPE #1# :WHERE-FROM :D..
  7: (SB-C::IR1-CONVERT-THE #<SB-C::CTRAN 1 {100C09C383}> #<SB-C::CTRAN 2 {100C09CD03}> #<SB-C::LVAR 3 {100C09CD33}> (THE (OR FUNCTION SYMBOL) #<SB-C::GLOBAL-VAR :%SOURCE-NAME = :TYPE #1=#<SB-KERNEL:FUN-TY..
  8: (SB-C::IR1-CONVERT #<SB-C::CTRAN 1 {100C09C383}> #<SB-C::CTRAN 2 {100C09CD03}> #<SB-C::LVAR 3 {100C09CD33}> (THE (OR FUNCTION SYMBOL) #<SB-C::GLOBAL-VAR :%SOURCE-NAME = :TYPE #1=#<SB-KERNEL:FUN-TYPE (..
  9: (SB-C::IR1-CONVERT-COMBINATION #<SB-C::CTRAN 1 {100C09C383}> #<SB-C::CTRAN 4 {100C09CA63}> #<SB-C::LVAR 5 {100C09CA93}> (= #:G4 #:G14) #<SB-C::GLOBAL-VAR :%SOURCE-NAME = :TYPE #1=#<SB-KERNEL:FUN-TYPE ..
 10: (SB-C::IR1-CONVERT-COMBINATION-CHECKING-TYPE #<SB-C::CTRAN 1 {100C09C383}> #<SB-C::CTRAN 4 {100C09CA63}> #<SB-C::LVAR 5 {100C09CA93}> (= #:G4 #:G14) #<SB-C::GLOBAL-VAR :%SOURCE-NAME = :TYPE #1=#<SB-KE..
 11: (SB-C::IR1-CONVERT #<SB-C::CTRAN 1 {100C09C383}> #<SB-C::CTRAN 4 {100C09CA63}> #<SB-C::LVAR 5 {100C09CA93}> (= #:G4 #:G14))
 12: (SB-C::IR1-CONVERT-IF #<SB-C::CTRAN 1 {100C09C383}> #<SB-C::CTRAN 6 {100332DE93}> #<SB-C::LVAR 7 {100332DEC3}> (IF (= #1=#:G4 #:G14) NIL (IF (= #1# #:G13) NIL (IF # NIL #))))
 13: (SB-C::IR1-CONVERT #<SB-C::CTRAN 1 {100C09C383}> #<SB-C::CTRAN 6 {100332DE93}> #<SB-C::LVAR 7 {100332DEC3}> (IF (= #1=#:G4 #:G14) NIL (IF (= #1# #:G13) NIL (IF # NIL #))))
 14: (SB-C::IR1-CONVERT-IF #<SB-C::CTRAN 8 {100C09BB53}> #<SB-C::CTRAN 6 {100332DE93}> #<SB-C::LVAR 7 {100332DEC3}> (IF (= #1=#:G4 #:G15) NIL (IF (= #1# #:G14) NIL (IF # NIL #))))
[...]

Stas Boukarev (stassats) on 2018-03-02
Changed in sbcl:
status: New → In Progress
Stas Boukarev (stassats) wrote :

3d8f54451089262b2cbc43699c10aee1a22f8e44

Changed in sbcl:
status: In Progress → Fix Committed
Stas Boukarev (stassats) on 2018-03-31
Changed in sbcl:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers