failed AVER: (FUNCTIONP INITFUN)

Bug #1300904 reported by Tomas Hlavaty on 2014-04-01
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SBCL
Undecided
Unassigned

Bug Description

SBCL 1.1.17.2-d62e488 x86 and x86_64

CL-USER> (ERROR 'SB-PCL::SLOTD-INITIALIZATION-ERROR :INITARG :INITFORM :KIND :MISSING)

fails with

  failed AVER: (FUNCTIONP INITFUN)
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:
 0: [RETRY] Retry SLIME REPL evaluation request.
 1: [*ABORT] Return to SLIME's top level.
 2: [ABORT] Abort thread (#<THREAD "repl-thread" RUNNING {1003AE8063}>)

Backtrace:
  0: (SB-INT:BUG "~@<failed AVER: ~2I~_~A~:>" (FUNCTIONP SB-KERNEL::INITFUN))
  1: (SB-IMPL::%FAILED-AVER (FUNCTIONP SB-KERNEL::INITFUN))
  2: (SB-KERNEL::FIND-SLOT-DEFAULT #<SB-KERNEL::CONDITION-CLASSOID SB-PCL::SLOTD-INITIALIZATION-ERROR> #S(SB-KERNEL::CONDITION-SLOT :NAME SB-PCL::VALUE :INITARGS (:VALUE) :READERS (SB-PCL::S$
  3: (MAKE-CONDITION SB-PCL::SLOTD-INITIALIZATION-ERROR :INITARG :INITFORM :KIND :MISSING)
      Locals:
        SB-KERNEL::INITARGS = (:INITARG :INITFORM :KIND :MISSING)
        TYPE = SB-PCL::SLOTD-INITIALIZATION-ERROR
  4: (ERROR SB-PCL::SLOTD-INITIALIZATION-ERROR :INITARG :INITFORM :KIND :MISSING)
  5: (SB-INT:SIMPLE-EVAL-IN-LEXENV (ERROR (QUOTE SB-PCL::SLOTD-INITIALIZATION-ERROR) :INITARG :INITFORM :KIND :MISSING) #<NULL-LEXENV>)
  6: (EVAL (ERROR (QUOTE SB-PCL::SLOTD-INITIALIZATION-ERROR) :INITARG :INITFORM :KIND :MISSING))
  7: (SWANK::EVAL-REGION "(ERROR 'SB-PCL::SLOTD-INITIALIZATION-ERROR :INITARG :INITFORM :KIND :MISSING) ..)
  8: ((LAMBDA NIL :IN SWANK::REPL-EVAL))
  9: (SWANK::TRACK-PACKAGE #<CLOSURE (LAMBDA NIL :IN SWANK::REPL-EVAL) {1004A235EB}>)
 10: (SWANK::CALL-WITH-RETRY-RESTART "Retry SLIME REPL evaluation request." #<CLOSURE (LAMBDA NIL :IN SWANK::REPL-EVAL) {1004A2352B}>)
 11: (SWANK::CALL-WITH-BUFFER-SYNTAX NIL #<CLOSURE (LAMBDA NIL :IN SWANK::REPL-EVAL) {1004A2350B}>)
 12: (SWANK::REPL-EVAL "(ERROR 'SB-PCL::SLOTD-INITIALIZATION-ERROR :INITARG :INITFORM :KIND :MISSING) ..)
 13: (SB-INT:SIMPLE-EVAL-IN-LEXENV (SWANK:LISTENER-EVAL "(ERROR 'SB-PCL::SLOTD-INITIALIZATION-ERROR :INITARG :INITFORM :KIND :MISSING) ..)
 14: (EVAL (SWANK:LISTENER-EVAL "(ERROR 'SB-PCL::SLOTD-INITIALIZATION-ERROR :INITARG :INITFORM :KIND :MISSING) ..)
 15: (SWANK:EVAL-FOR-EMACS (SWANK:LISTENER-EVAL "(ERROR 'SB-PCL::SLOTD-INITIALIZATION-ERROR :INITARG :INITFORM :KIND :MISSING) ..)
 16: (SWANK::PROCESS-REQUESTS NIL)
 17: ((LAMBDA NIL :IN SWANK::HANDLE-REQUESTS))
 18: ((LAMBDA NIL :IN SWANK::HANDLE-REQUESTS))
 19: (SWANK-BACKEND::CALL-WITH-BREAK-HOOK #<FUNCTION SWANK:SWANK-DEBUGGER-HOOK> #<CLOSURE (LAMBDA NIL :IN SWANK::HANDLE-REQUESTS) {1003AF00FB}>)
 20: ((FLET SWANK-BACKEND:CALL-WITH-DEBUGGER-HOOK :IN "/mnt/old/home/hlavaty/lisp/slime/swank-sbcl.lisp") #<FUNCTION SWANK:SWANK-DEBUGGER-HOOK> #<CLOSURE (LAMBDA NIL :IN SWANK::HANDLE-REQUES$
 21: (SWANK::CALL-WITH-BINDINGS ((*STANDARD-OUTPUT* . #1=#<SWANK-BACKEND::SLIME-OUTPUT-STREAM {1003AC8BC3}>) (*STANDARD-INPUT* . #2=#<SWANK-BACKEND::SLIME-INPUT-STREAM {10039FB4B3}>) (*TRACE$
 22: (SWANK::HANDLE-REQUESTS #<SWANK::CONNECTION {10035080A3}> NIL)
 23: ((FLET #:WITHOUT-INTERRUPTS-BODY-1226 :IN SB-THREAD::INITIAL-THREAD-FUNCTION-TRAMPOLINE))
 24: ((FLET SB-THREAD::WITH-MUTEX-THUNK :IN SB-THREAD::INITIAL-THREAD-FUNCTION-TRAMPOLINE))
 25: ((FLET #:WITHOUT-INTERRUPTS-BODY-660 :IN SB-THREAD::CALL-WITH-MUTEX))
 26: (SB-THREAD::CALL-WITH-MUTEX #<CLOSURE (FLET SB-THREAD::WITH-MUTEX-THUNK :IN SB-THREAD::INITIAL-THREAD-FUNCTION-TRAMPOLINE) {7FFFF504EC8B}> #<SB-THREAD:MUTEX "thread result lock" owner: $
 27: (SB-THREAD::INITIAL-THREAD-FUNCTION-TRAMPOLINE #<SB-THREAD:THREAD "repl-thread" RUNNING {1003AE8063}> #S(SB-THREAD:SEMAPHORE :NAME "Thread setup semaphore" :%COUNT 0 :WAITCOUNT 0 :MUTEX$
 28: ("foreign function: call_into_lisp")
 29: ("foreign function: new_thread_trampoline")

the form (ERROR 'SB-PCL::SLOTD-INITIALIZATION-ERROR :INITARG :INITFORM :KIND :MISSING) is in pcl/init.lisp:141

i would expect the error to be thrown, however it fails with aver instead

in 1.0.58 i get "Lock on package SB-PCL violated when interning SLOTD-INITIALIZATION-ERROR while in package COMMON-LISP-USER." so it seems like the symbol is newer than that

it fails in find-slot-default, code/condition.lisp:192

i suspect 885a956ae2044a0c5c4a2b55db8e32b7f6b48d05 broke it

for some reason it expects that condition-slot-initfunction is not nil and is a function

Attila Lendvai (attila-lendvai) wrote :

the simplest for m to test:

(make-condition 'SB-PCL::SLOTD-INITIALIZATION-ERROR)

redefining the (define-condition slotd-initialization-error ...) form fixes the problem.

the source of the problem is that this returns nil instead of a function before redefinition:

(sb-kernel::condition-slot-initfunction (sb-kernel::find-condition-class-slot (sb-kernel::find-classoid 'SB-PCL::SLOTD-INITIALIZATION-ERROR) 'sb-pcl::value))

this suggests that probably something happens differently while bootstrapping, but my knowledge runs fuzzy at that territory...

Stas Boukarev (stassats) on 2014-04-01
Changed in sbcl:
assignee: nobody → Stas Boukarev (stassats)
status: New → Triaged
Stas Boukarev (stassats) wrote :

In edbf1a2a115dc496676a131a493536b44125ce34.

Changed in sbcl:
status: Triaged → Fix Committed
assignee: Stas Boukarev (stassats) → nobody
Tomas Hlavaty (tomas-hlavaty) wrote :

thanks for the fix, it works now

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