sbcl: malloc.c:2372: sysmalloc: Assertion
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
SBCL |
Invalid
|
Undecided
|
Unassigned |
Bug Description
I have some code using CFFI library. The code interface with CUDA library. When I run the code more than once (actually after the second, before the third run), it failed with the following error
sbcl: malloc.c:2372: sysmalloc: Assertion `(old_top == (((mbinptr) (((char *) &((av)->bins[((1) - 1) * 2])) - __builtin_offsetof (struct malloc_chunk, fd)))) && old_size == 0) || ((unsigned long) (old_size) >= (unsigned long)((
fatal error encountered in SBCL pid 11489(tid 140737353881408):
SIGABRT received.
I'm expecting to run the code repeatedly without error. For double checking, the code was run on Clozure CL version 1.11, without any issue several times.
Test code is at the end.
Linux distribution: Linux Mint 17.1 Rebecca
: uname -a
Linux rock 3.13.0-37-generic #64-Ubuntu SMP Mon Sep 22 21:28:38 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
: sbcl --version
SBCL 1.3.11.14-e9f232b
CL-USER(3): *features*
(CFFI-FEATURES:
CFFI-SYS:
:ASDF-
:NON-BASE-
:ALIEN-CALLBACKS :ANSI-CL :ASH-RIGHT-VOPS :C-STACK-
:COMMON-LISP :COMPACT-
:COMPLEX-
:FP-AND-
:INLINE-CONSTANTS :INTEGER-EQL-VOP :LARGEFILE :LINKAGE-TABLE :LINUX
:LITTLE-ENDIAN :MEMORY-
:OS-PROVIDES-
:OS-PROVIDES-POLL :OS-PROVIDES-PUTWC :OS-PROVIDES-
:PACKAGE-
:RAW-SIGNED-WORD :SB-DOC :SB-EVAL :SB-FUTEX :SB-LDB :SB-PACKAGE-LOCKS
:SB-SIMD-PACK :SB-SOURCE-
:STACK-
:STACK-
:STACK-
:UNWIND-
Test code:
-------
(ql:quickload :cffi)
(ql:quickload :cffi-grovel)
(use-package :cffi)
(cffi:load-
(cffi:load-
;; Including CFFI-GROVEL auto generated code
;; (modified to include shortest snippet producing the issue)
(cffi:defcstruct (device-properties :size 600)
(totalglobalmem :unsigned-int :offset 256))
(cl:defconstant size-of-
;; End of CFFI-GROVEL auto generated code
(defcfun (%cuda-
(properties :pointer)
(device-id :int))
(defun device-properties (&optional (device-id 0))
(with-
(%cuda-
(with-
p (:struct device-properties))
(list
(list 'totalglobalmem totalglobalmem)))))
(loop for i from 1 upto 10
do (print i)
do (print (device-
Sample Run
-------
: sbcl --load cuda-query-
This is SBCL 1.3.11.14-e9f232b, an implementation of ANSI Common Lisp.
More information about SBCL is available at <http://
SBCL is free software, provided as is, with absolutely no warranty.
It is mostly in the public domain; some portions are provided under
BSD-style licenses. See the CREDITS and COPYING files in the
distribution for more information.
To load "cffi":
Load 1 ASDF system:
cffi
; Loading "cffi"
.
To load "cffi-grovel":
Load 1 ASDF system:
cffi-grovel
; Loading "cffi-grovel"
1
((TOTALGLOBALMEM 2081161216))
2
((TOTALGLOBALMEM 2081161216))
sbcl: malloc.c:2372: sysmalloc: Assertion `(old_top == (((mbinptr) (((char *) &((av)->bins[((1) - 1) * 2])) - __builtin_offsetof (struct malloc_chunk, fd)))) && old_size == 0) || ((unsigned long) (old_size) >= (unsigned long)((
fatal error encountered in SBCL pid 12714(tid 140737353881408):
SIGABRT received.
Welcome to LDB, a low-level debugger for the Lisp runtime environment.
could you provide a backtrace from ldb? (the command is 'backtrace')