unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
* Java finalization & smobs?
@ 2021-12-10 14:59 Han-Wen Nienhuys
  2021-12-10 18:00 ` Maxime Devos
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Han-Wen Nienhuys @ 2021-12-10 14:59 UTC (permalink / raw)
  To: Guile Devel; +Cc: lilypond-devel

Hi Guile devs,

We are debugging a GC issue in LilyPond when used with Guile 2.2, and
could use some help.

The issue and associated Merge Request are here:

https://gitlab.com/lilypond/lilypond/-/issues/6218
https://gitlab.com/lilypond/lilypond/-/merge_requests/1035

We are using smobs with custom mark and free functions for
interfacing with our C++ code. We are seeing that sometimes mark
functions are called on smobs which have their dependencies already
collected, leading to crashes.

We can change our mark routines to avoid the crash, but it's unclear
to us if this behavior is intended or not, and we worry that this will
come back to bite us in the future.

On the one hand, the docs for smobs state "must assume .. all SCM
values that it references have already been freed and are thus
invalid", which suggests that smob freeing happens in random order,
which is consistent with what we see. On the other hand, Guile sets up
BDWGC with GC_java_finalization=1, which should keep GC dependencies
of an object alive until the object itself is finalized, and I think
we have observed the mark calls that make this happen.

which of the two is it?

(I am seeing the problem on Fedora 35, with Guile 2.2.7 and libgc 8.0.4)

--
Han-Wen Nienhuys - hanwenn@gmail.com - http://www.xs4all.nl/~hanwen



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-12-10 18:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-10 14:59 Java finalization & smobs? Han-Wen Nienhuys
2021-12-10 18:00 ` Maxime Devos
2021-12-10 18:02 ` Maxime Devos
2021-12-10 18:10 ` Maxime Devos

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).