cairo-font-extents in cairo/cairo.text.lisp returns a (:struct cairo-font-extents-t) obtained from with-foreign-object.
However, according to with-foreign-object's documentation, the object created by it is not valid outside the scope of with-foreign-object, if I understand correctly.
Indeed, accessing a field of the returned structure leads to a crash at least under ECL on NetBSD/amd64.
Sorry for not providing any patch, but I don't see a way around this bug without changing the lisp API.
A workaround is to use directly cairo::%cairo-font-extents but as the name implies, this is suboptimal.
A quick look around shows there are other such uses in other functions, so if you confirm my analysis, I think you should audit all uses of with-foreign-object and similar macros.
Hi,
cairo-font-extents in cairo/cairo.text.lisp returns a (:struct cairo-font-extents-t) obtained from with-foreign-object.
However, according to with-foreign-object's documentation, the object created by it is not valid outside the scope of with-foreign-object, if I understand correctly.
Indeed, accessing a field of the returned structure leads to a crash at least under ECL on NetBSD/amd64.
Sorry for not providing any patch, but I don't see a way around this bug without changing the lisp API. A workaround is to use directly cairo::%cairo-font-extents but as the name implies, this is suboptimal.
A quick look around shows there are other such uses in other functions, so if you confirm my analysis, I think you should audit all uses of with-foreign-object and similar macros.
Regards