Debian 64t transition causes build failure on 32bit arch
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
SBCL |
New
|
Undecided
|
Unassigned |
Bug Description
Hi,
During a rebuild of sbcl 2.3.7 on Debian/unstable, after the https:/
> "obj/from-
>
> debugger invoked on a TYPE-ERROR:
> The value
> 542868266893180929
> is not of type
> (UNSIGNED-BYTE 32)
> when setting slot SB-THREAD:
...
> (GET-INTERNAL-
> 0]
This seems to be related to the 64t change as when I try to rebuild on armhf I see a change in the grovelled data:
(sid_armhf-
--- ./crossbuild-
+++ output/
@@ -30,7 +30,7 @@
(define-alien-type off-t (signed 64))
(define-alien-type size-t (unsigned 32))
(define-alien-type ssize-t (signed 32))
-(define-alien-type time-t (signed 32))
+(define-alien-type time-t (signed 64))
(define-alien-type suseconds-t (signed 32))
(define-alien-type uid-t (unsigned 32))
;; Types in src/runtime/wrap.h. See that file for explantion.
@@ -141,6 +141,7 @@
(defconstant clock-process-
(defconstant clock-realtime-
(defconstant clock-realtime-
+(defconstant clock-tai 11) ; #xb
(defconstant clock-monotonic
(defconstant clock-monotonic-raw 4) ; #x4
(defconstant clock-boottime 7) ; #x7
@@ -149,11 +150,11 @@
;;; structures
(define-alien-type nil
(struct timeval
- (tv-sec (signed 32))
- (tv-usec (signed 32))))
+ (tv-sec (signed 64))
+ (tv-usec (signed 64))))
(define-alien-type nil
(struct timespec
- (tv-sec (signed 32))
+ (tv-sec (signed 64))
(tv-nsec (signed 32))))
I think we need to change
❯ git grep observed-
src/code/
src/code/unix.lisp: (sb-thread:
to account for the 64bit nature of tv-sec and friends, even on 32 bit architectures.
Best regards, Peter
The easiest solution may be to put some C code in wrap.c that returns a timespec the way lisp expects it to look because I don't see anything in the Lisp side that seems wrong. Nanoseconds are immediately scaled down by 10^6 after calling clock_gettime so that get-internal- real-time remains a fixnum. Therefore anything stored in the 'observed-delta' slot should not be too large.
I'll bet it's a discrepancy in what Lisp thinks a 64-bit integer looks in a C structure in this ABI (is it most-significant half first or second? I don't know). I see no other instance where Lisp cared about that for a 32-bit build. A few kernel types were 64-bit already, but none of them very interesting to Lisp: dev_t, ino_t for example