From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Han-Wen Nienhuys Newsgroups: gmane.comp.gnu.lilypond.devel,gmane.lisp.guile.devel Subject: Java finalization & smobs? Date: Fri, 10 Dec 2021 15:59:13 +0100 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="9949"; mail-complaints-to="usenet@ciao.gmane.io" Cc: lilypond-devel To: Guile Devel Original-X-From: lilypond-devel-bounces+gnu-lilypond-devel=m.gmane-mx.org@gnu.org Fri Dec 10 15:59:43 2021 Return-path: Envelope-to: gnu-lilypond-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mvhN7-0002Jb-HJ for gnu-lilypond-devel@m.gmane-mx.org; Fri, 10 Dec 2021 15:59:41 +0100 Original-Received: from localhost ([::1]:54962 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mvhN5-0006bW-Jk for gnu-lilypond-devel@m.gmane-mx.org; Fri, 10 Dec 2021 09:59:39 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:56510) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mvhMy-0006a4-KW; Fri, 10 Dec 2021 09:59:32 -0500 Original-Received: from [2607:f8b0:4864:20::136] (port=33737 helo=mail-il1-x136.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mvhMs-00023b-Av; Fri, 10 Dec 2021 09:59:32 -0500 Original-Received: by mail-il1-x136.google.com with SMTP id i6so8736232ila.0; Fri, 10 Dec 2021 06:59:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:from:date:message-id:subject:to:cc; bh=jSyrGhASq9+fdZkl2s5scUd4CyPcH7wvhOFHNly0msM=; b=lwvZapbezloVXhfUxd/+Xqs13VaQB2W6RqnN1x5aQx6BPBDRFNhhXP0YtMuHdKVNQp vBPR03l1isbd8OrUo6nz6EZVeOZD3K/FkuPGJV7RszzVtc50CIPDdbenb+aHa6wnSOkC ucv39B1J8yLcbgvgdIfe7Oc1GQouVT8GcqaPUzqPQY47wTV1SMobqvbxdeXtiHkdSTVi WhYQNIPBFSLuBm5SZCftG0Pfh5/mdWsWocEBXouNKeNKLvgX3sgXXTsL/ky2bmieBymo 67WMSe1W5TOy1C/k9NALdbjlyiTxKhAguXz2yc8DnWDUX4ox0oEerX3omXomNOhikOn7 2r1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:from:date:message-id:subject:to:cc; bh=jSyrGhASq9+fdZkl2s5scUd4CyPcH7wvhOFHNly0msM=; b=Vxz4oy6em5eQWDEU5hWqd56zm84lZSt7y7g2IpvKHGH4iFjacj2Ax68dLwN3ddIWaP QCz0njuPj3dtLoV7acMXAAfzZ0aXdurEUBo5GspU6bIGZCoox9kYxnnEj/dzUR/C5kIt EZK0w2P40GNDX+FqX7eo9FCFWQ9SGyUhqPAXlz/6w5LeUoL45s+LkrNDZk8rV6HjPPnS upnB8k4Q8wCUTFyDxna+pg9XOzBtn3/bH/Sxgk4okzC2WkFkJ2wqIjELZ0ha7v4obhiH G9UW+Kp6SrP/hs/uxQU+3TCpCOVUohEkvctRoxD26DHVxqDb8X4+u3izYmfr5KmxBgNp ucog== X-Gm-Message-State: AOAM533eOhU1wLRO8i9KFA7HULkB0T5EhX7Jwg3uFYtOthV4z+WFEuv8 F5ahs+AP3zPumJPf2mCVZrDNGWMy3z+mwAMBuqgaK0gn6/4= X-Google-Smtp-Source: ABdhPJxfcKbOXmavWOr+ktURKDAKfAZZboXwe0Xl7SGMAuvgU+6PHUXuU0zI1GRwSYJCBqvpZATysTDyVSAb9kjcuYs= X-Received: by 2002:a05:6e02:1945:: with SMTP id x5mr20305368ilu.287.1639148364070; Fri, 10 Dec 2021 06:59:24 -0800 (PST) X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::136 (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::136; envelope-from=hanwenn@gmail.com; helo=mail-il1-x136.google.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: lilypond-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussions on LilyPond development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: lilypond-devel-bounces+gnu-lilypond-devel=m.gmane-mx.org@gnu.org Original-Sender: "lilypond-devel" Xref: news.gmane.io gmane.comp.gnu.lilypond.devel:78856 gmane.lisp.guile.devel:20993 Archived-At: 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