bug#12809: segfault with (weird use of) make-struct and make-vtable
From:
Areth Unknown
Subject:
bug#12809: segfault with (weird use of) make-struct and make-vtable
Date:
Mon, 5 Nov 2012 22:29:50 +0100
This code makes guile segfault, tested in the versions 2.0.6.49 and 2.0.6.66 ..
--------
(define v-blocks (make-vtable "pR")) ;; note that this is a protected tail array read-only
(define block-2 (make-struct v-blocks 1 ;; note that this only has one element '((0 2 2 0) (0 2 2 0) (0 0 0 0)
(0 0 0 0))))
;; (struct-ref block-2 0)
;; => Segmentation fault (core dumped) ------
There isn't really any reason (for me) to use make-struct or make-vtable (instead of srfi-9) as they are very low level, but it still shouldn't segfault.