compiler errors on a form with failed AVER

Bug #1308328 reported by Attila Lendvai on 2014-04-16
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
SBCL
Medium
Unassigned

Bug Description

with sbcl:

(lisp-implementation-version)
"1.1.17.42.nested-errors.1-ae099d6"

when it's loaded with all kinds of libs, notably iolib, and then compiling the file:

(in-package :cl-user)

(def test http/x-forwarded-for ()
  (is (iolib.sockets:ipv4-address-p (parse-x-forwarded-for-value "1.2.3.4")))
  (is (iolib.sockets:ipv6-address-p (parse-x-forwarded-for-value "2001:0db8:85a3:0000:0000:8a2e:0370:7334")))
  (bind (((:values client proxies) (parse-x-forwarded-for-value "1.2.3.4, 5.6.7.8, 7.8.9.10")))
    (is (iolib.sockets:ipv4-address-p client))
    (is (= 2 (length proxies)))
    (is (every 'iolib.sockets:ipv4-address-p proxies)))
  (bind (((:values client proxies) (parse-x-forwarded-for-value "2001:0db8:85a3:0000:0000:8a2e:0370:7334, 5.6.7.8")))
    (is (iolib.sockets:ipv6-address-p client))
    (is (= 1 (length proxies)))
    (is (every 'iolib.sockets:ipv4-address-p proxies))))

leads to this AVER:

failed AVER:
    (AND (EQ (CTRAN-KIND START) INSIDE-BLOCK)
         (NOT (BLOCK-DELETE-P BLOCK)))
This is probably a bug in SBCL itself. (Alternatively, SBCL
might have been corrupted by bad user code, e.g. by an undefined
Lisp operation like (FMAKUNBOUND 'COMPILE), or by stray pointers
from alien code or from unsafe Lisp code; or there might be a
bug in the OS or hardware that SBCL is running on.) If it seems
to be a bug in SBCL itself, the maintainers would like to know
about it. Bug reports are welcome on the SBCL mailing lists,
which you can find at <http://sbcl.sourceforge.net/>.
   [Condition of type SB-INT:BUG]

Restarts:
 2: ABORT Abort compilation.
 1: *ABORT Return to SLIME's top level.
 0: ABORT Abort thread (#<THREAD "worker" RUNNING {100D9BB7F3}>)

Backtrace:
  0: (SB-INT:BUG "~@<failed AVER: ~2I~_~A~:>" (AND (EQ (SB-C::CTRAN-KIND SB-C::START) :INSIDE-BLOCK) (NOT (SB-C::BLOCK-DELETE-P BLOCK))))
  1: (SB-IMPL::%FAILED-AVER (AND (EQ (SB-C::CTRAN-KIND SB-C::START) :INSIDE-BLOCK) (NOT (SB-C::BLOCK-DELETE-P BLOCK))))
      Locals:
        SB-DEBUG::ARG-0 = (AND (EQ (SB-C::CTRAN-KIND SB-C::START) :INSIDE-BLOCK) (NOT (SB-C::BLOCK-DELETE-P BLOCK)))
  2: (SB-C::NODE-ENDS-BLOCK #<SB-C::COMBINATION :FUN #<SB-C::REF :LEAF #<SB-C::GLOBAL-VAR :%SOURCE-NAME DEF :TYPE #1=#<SB-KERNEL:BUILT-IN-CLASSOID FUNCTION (read-only)> :DEFINED-TYPE #1# :KIND :GLOBAL-FUN..
      Locals:
        SB-DEBUG::ARG-0 = #<SB-C::COMBINATION :FUN #<SB-C::REF :LEAF # {100D9E9483}> :ARGS (# # # # # # ...) {100D9E9503}>
  3: (SB-C::MERGE-TOPLEVEL-LAMBDAS (#<SB-C::CLAMBDA :%SOURCE-NAME SB-C::.ANONYMOUS. :%DEBUG-NAME (SB-C::TOP-LEVEL-FORM #) :KIND :TOPLEVEL :TYPE #<SB-KERNEL:BUILT-IN-CLASSOID FUNCTION (read-only)> :WHERE-FR..
      Locals:
        SB-DEBUG::ARG-0 = (#<SB-C::CLAMBDA ..>)
  4: (SB-C::SUB-COMPILE-TOPLEVEL-LAMBDAS (#<SB-C::CLAMBDA :%SOURCE-NAME SB-C::.ANONYMOUS. :%DEBUG-NAME (SB-C::TOP-LEVEL-FORM #) :KIND :TOPLEVEL :TYPE #<SB-KERNEL:BUILT-IN-CLASSOID FUNCTION (read-only)> :WH..
  5: (SB-C::COMPILE-TOPLEVEL-LAMBDAS (#<SB-C::CLAMBDA :%SOURCE-NAME SB-C::.ANONYMOUS. :%DEBUG-NAME (SB-C::TOP-LEVEL-FORM #) :KIND :TOPLEVEL :TYPE #<SB-KERNEL:BUILT-IN-CLASSOID FUNCTION (read-only)> :WHERE-..
  6: (SB-C::COMPILE-TOPLEVEL (#<SB-C::CLAMBDA :%SOURCE-NAME SB-C::.ANONYMOUS. :%DEBUG-NAME (SB-C::TOP-LEVEL-FORM #) :KIND :TOPLEVEL :TYPE #<SB-KERNEL:BUILT-IN-CLASSOID FUNCTION (read-only)> :WHERE-FROM :DE..
  7: (SB-C::CONVERT-AND-MAYBE-COMPILE (DEF TEST HTTP/X-FORWARDED-FOR NIL (IS (IOLIB.SOCKETS:IPV4-ADDRESS-P #)) (IS (IOLIB.SOCKETS:IPV6-ADDRESS-P #)) ...) (SB-C::ORIGINAL-SOURCE-START 0 0))
  8: ((FLET SB-C::DEFAULT-PROCESSOR :IN SB-C::PROCESS-TOPLEVEL-FORM) (DEF TEST HTTP/X-FORWARDED-FOR NIL (IS (IOLIB.SOCKETS:IPV4-ADDRESS-P #)) (IS (IOLIB.SOCKETS:IPV6-ADDRESS-P #)) ...))
  9: (SB-C::PROCESS-TOPLEVEL-FORM (DEF TEST HTTP/X-FORWARDED-FOR NIL (IS (IOLIB.SOCKETS:IPV4-ADDRESS-P #)) (IS (IOLIB.SOCKETS:IPV6-ADDRESS-P #)) ...) (SB-C::ORIGINAL-SOURCE-START 0 0) NIL)
 10: (SB-C::SUB-SUB-COMPILE-FILE #<SB-C::SOURCE-INFO >)
 11: ((FLET SB-THREAD::WITH-RECURSIVE-LOCK-THUNK :IN SB-C::SUB-COMPILE-FILE))
 12: ((FLET #:WITHOUT-INTERRUPTS-BODY-689 :IN SB-THREAD::CALL-WITH-RECURSIVE-LOCK))
 13: (SB-THREAD::CALL-WITH-RECURSIVE-LOCK #<CLOSURE (FLET SB-THREAD::WITH-RECURSIVE-LOCK-THUNK :IN SB-C::SUB-COMPILE-FILE) {7FFFF47D55AB}> #<SB-THREAD:MUTEX "World Lock" owner: #<SB-THREAD:THREAD "worker" ..
 14: ((LAMBDA NIL :IN SB-C::SUB-COMPILE-FILE))
 15: ((FLET SB-C::WITH-IT :IN SB-C::%WITH-COMPILATION-UNIT))
 16: (SB-C::SUB-COMPILE-FILE #<SB-C::SOURCE-INFO >)
 17: (COMPILE-FILE "/tmp/fileVGvCsn" :OUTPUT-FILE NIL :VERBOSE NIL :PRINT NIL :EXTERNAL-FORMAT :UTF-8 :TRACE-FILE NIL :BLOCK-COMPILE NIL :EMIT-CFASL NIL)

Attila Lendvai (attila-lendvai) wrote :

unfortunately i couldn't reproduce simply by loaded iolib and trying to compile the file.

also note that this is a non-blocking issue for me. if you cannot make use of it, then feel free to close this bug.

Stas Boukarev (stassats) wrote :

Reduced:
(x ((a)) (x (every z list)))

Changed in sbcl:
status: New → Triaged
importance: Undecided → Medium
tags: added: compiler-ir1
removed: compiler
Attila Lendvai (attila-lendvai) wrote :

/me bows in front of Stas' repeated test-reduction abilities.

Stas Boukarev (stassats) wrote :

And to simplify:

(a ((b))
   (c
    (let ((x))
      (block nil (lambda () (return))))))

Paul F. Dietz (paul-f-dietz) wrote :

This bug pops up in the random tester (SBCL 1.2.5):

(defparameter *f3*
  '(lambda (a c)
    (declare (type (integer 104233 622985) a))
    (declare (type (integer -54069182 937) c))
    (declare (ignorable a c))
    (declare
     (optimize (speed 2) (space 3) (safety 2) (debug 0)
      (compilation-speed 3)))
    (block b1
      (prog1
   (let* ((*s4*
    (the integer
      (return-from b1 a))
     ))
       (declare (dynamic-extent *s4*))
       0)
 ))))

#|

* (compile nil *f3*)

debugger invoked on a SB-INT:BUG in thread
#<THREAD "main thread" RUNNING {1003016813}>:
    failed AVER:
      (AND (EQ (CTRAN-KIND START) INSIDE-BLOCK) (NOT (BLOCK-DELETE-P BLOCK)))
  This is probably a bug in SBCL itself. (Alternatively, SBCL might have been
  corrupted by bad user code, e.g. by an undefined Lisp operation like
  (FMAKUNBOUND 'COMPILE), or by stray pointers from alien code or from unsafe
  Lisp code; or there might be a bug in the OS or hardware that SBCL is running
  on.) If it seems to be a bug in SBCL itself, the maintainers would like to
  know about it. Bug reports are welcome on the SBCL mailing lists, which you
  can find at <http://sbcl.sourceforge.net/>.

Type HELP for debugger help, or (SB-EXT:EXIT) to exit from SBCL.

restarts (invokable by number or by possibly-abbreviated name):
  0: [ABORT] Exit debugger, returning to top level.

(SB-INT:BUG "~@<failed AVER: ~2I~_~A~:>" (AND (EQ (SB-C::CTRAN-KIND SB-C::START) :INSIDE-BLOCK) (NOT (SB-C::BLOCK-DELETE-P BLOCK))))
0]

Stas Boukarev (stassats) wrote :

In d34f08f171f7de7ba6969a6f0537c96c61fe522c

Changed in sbcl:
status: Triaged → Fix Committed
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