From: James Y K. <fo...@fu...> - 2006-11-22 22:12:33
|
I'm getting the following error: The value -2164842066 is not of type (SIGNED-BYTE 32). 0] backtrace 0: ((LAMBDA (SB-IMPL::E)) #<TYPE-ERROR {810A5021}>) 1: ((LAMBDA (SB-IMPL::E)) #<TYPE-ERROR {810A5021}>) 2: (SIGNAL #<TYPE-ERROR {810A5021}>) 3: (ERROR TYPE-ERROR) 4: (SB-KERNEL::OBJECT-NOT-TYPE-ERROR-HANDLER #<unavailable argument> #.(SB-SYS:INT-SAP #X55AF65BC) #<ALIEN-VALUE :SAP #X55AF626C :TYPE (* (STRUCT SB-VM::OS-CONTEXT-T- STRUCT))> (142 14)) 5: (SB-KERNEL:INTERNAL-ERROR #.(SB-SYS:INT-SAP #X55AF626C) #<unavailable argument>) 6: ("foreign function: call_into_lisp") 7: ("foreign function: funcall2") 8: ("foreign function: interrupt_internal_error") 9: ("foreign function: sigtrap_handler") 10: (SB-VM:FIXUP-CODE-OBJECT #<code object {8109DFAF}> 1421 67383 :RELATIVE) 11: (SB-C::DO-CORE-FIXUPS #<code object {8109DFAF}> (#S(SB-C::FIXUP-NOTE :KIND :ABSOLUTE :FIXUP #S(SB-C:FIXUP :NAME NIL :FLAVOR :CODE-OBJECT :OFFSET 65) :POSITION 1427) #S(SB-C::FIXUP-NOTE :KIND :RELATIVE :FIXUP #S(SB-C:FIXUP :NAME SB-VM::ALLOCATE-CONS-TO-EAX :FLAVOR :ASSEMBLY-ROUTINE :OFFSET NIL) :POSITION 1421) ........ It looks to me like it's due to the following piece of code, on line 128 of x86-vm.c. If loc-sap is at an address > 0x80000000, (which it seems it will be in the above traceback), then rel-val will be out of the range of signed-byte-32, and thus cause this error. Probably this code should be doing modular signed-byte 32 arithmetic rather than restricting the range? My sbcl has a dynamic heap that starts below 0x80000000, but ends above it, so I didn't notice this until recently, since the code objects just so happened to always be below the boundary. > (:relative > ;; Fixup is the actual address wanted. > ;; > ;; Record relative fixups that point outside the code > ;; object. > (when (or (< fixup obj-start-addr) (> fixup code-end-addr)) > (add-fixup code offset)) > ;; Replace word with value to add to that loc to get there. > (let* ((loc-sap (+ (sap-int sap) offset)) > (rel-val (- fixup loc-sap n-word-bytes))) > (declare (type (unsigned-byte 32) loc-sap) > (type (signed-byte 32) rel-val)) > (setf (signed-sap-ref-32 sap offset) rel-val))) James |