with-alien leads to GC invariant lost
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
SBCL |
Invalid
|
Undecided
|
Unassigned |
Bug Description
After these definitions:
(define-alien-type statfs
(struct statfs
(type long)
(bsize long) ;Block size
(blocks long) ;Total blocks
(bfree long) ;Total free blocks
(bavail long) ;Free blocks to non-superuser
(files long) ;Total inodes
(ffree long) ;Free inodes
(fsid long)
(namelen long) ;Max filename length
))
(define-
(path c-string)
(data (* statfs)))
This code, which worked in 1.0.56, now crashes lisp in 1 .2.5 with the error
GC invariant lost, file "gencgc.c", line 303:
(with-alien ((data statfs))
(statfs "/" (addr data)))
Doing it without stack-allocating the structure still works:
(let ((data (make-alien statfs)))
(statfs "/" data))
uname -a
Linux tunic6.
*features*
(:ALIEN-CALLBACKS :ANSI-CL :ASH-RIGHT-VOPS :C-STACK-
:COMMON-LISP :COMPARE-
:FLOAT-EQL-VOPS :GENCGC :IEEE-FLOATING-
:LINKAGE-TABLE :LINUX :LITTLE-ENDIAN :MEMORY-
:OS-PROVIDES-
:OS-PROVIDES-
:OS-PROVIDES-
:SB-DOC :SB-EVAL :SB-FUTEX :SB-LDB :SB-PACKAGE-LOCKS :SB-SIMD-PACK
:SB-SOURCE-
:STACK-
:STACK-
:STACK-
:UNWIND-
You need to include the code to reproduce the issue.