2012-01-14 12:21:05 |
Attila Lendvai |
description |
happens on SBCL head, which is 1.0.55
the symptom (long after startup, reproducibly triggered by a function):
-------------------
fatal error encountered in SBCL pid 712(tid 140737270740736):
internal error too early in init, can't recover
internal error #31 (Object is of the wrong type.)
SC: 21, Offset: 6 $1= 0x1010c3b083: instance pointer
SC: 21, Offset: 0 $2= 0x10003ee2d7: list pointer
due to:
---------
(sb-alien:extern-alien "internal_errors_enabled" boolean) => NIL
i've looked around in the SBCL code, but it should be set to T by SB-IMPL::REINIT, which in turn seems to be called from save-lisp-and-die after restart... so i don't understand what's going on.
for now my workaround is this, in my toplevel function:
(if (sb-alien:extern-alien "internal_errors_enabled" boolean)
(format t "TODO: delete this KLUDGE, seems like it's not needed anymore")
(progn
(format t "setting internal_errors_enabled to T")
(setf (sb-alien:extern-alien "internal_errors_enabled" boolean) t)))
the image is saved by this code:
http://dwim.hu/darcsweb/darcsweb.cgi?r=HEAD%20hu.dwim.build;a=headblob;f=/source/build.lisp#l305
i've tested both with and without "1.0.48.29: better end-of-the-world handling", but the behavior is the same. |
1.0.55 x86-64
(define-alien-type-translator boolean (&optional (bits sb!vm:n-word-bits))
...)
but on the C side:
typedef int boolean;
so, the C side is 32 bits, while the default size for the type translator is 64 bits.
this is very misleading and results in e.g.:
(setf (sb-alien:extern-alien "lose_on_corruption_p" boolean) t)
for a user who doesn't look twice it looks completely fine, but it silently corrupts memory. |
|