From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jean Abou Samra Newsgroups: gmane.lisp.guile.devel Subject: =?utf-8?Q?Re:_=E2=80=9CToo_many_root_sets=E2=80=9D_when_calling_?= =?utf-8?Q?compile_frequently?= Date: Sat, 20 Aug 2022 13:08:25 +0200 Message-ID: References: <86a5dfb7-f763-21b7-1856-a257fa42b906@telenet.be> Mime-Version: 1.0 (1.0) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="32237"; mail-complaints-to="usenet@ciao.gmane.io" Cc: guile-devel@gnu.org To: Maxime Devos Original-X-From: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Sat Aug 20 13:08:54 2022 Return-path: Envelope-to: guile-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 1oPMLV-0008Et-St for guile-devel@m.gmane-mx.org; Sat, 20 Aug 2022 13:08:53 +0200 Original-Received: from localhost ([::1]:36460 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oPMLU-0002Rk-Am for guile-devel@m.gmane-mx.org; Sat, 20 Aug 2022 07:08:52 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:39312) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oPMLB-0002R1-2N for guile-devel@gnu.org; Sat, 20 Aug 2022 07:08:33 -0400 Original-Received: from mout.kundenserver.de ([217.72.192.73]:32895) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oPML9-000145-Ci for guile-devel@gnu.org; Sat, 20 Aug 2022 07:08:32 -0400 Original-Received: from smtpclient.apple ([37.167.7.79]) by mrelayeu.kundenserver.de (mreue109 [212.227.15.184]) with ESMTPSA (Nemesis) id 1M26j1-1oRqNO3zD7-002ZHb; Sat, 20 Aug 2022 13:08:28 +0200 In-Reply-To: <86a5dfb7-f763-21b7-1856-a257fa42b906@telenet.be> X-Mailer: iPhone Mail (19G71) X-Provags-ID: V03:K1:kXI4T8CPMAB3Of8py96nHiDaQia4Y6viQXLRwykWjxLAeIK0iLf 3Z0i/Lu/ES1ButTk2VMwprfNQsufi1lSAzuE3nzXPMcdAJvYXaQhk+jUVlgebOsyWNi8wO8 FGBjkzolP/sxniBXyRAxJAnxUUdTMiLl2U/GSoGakoPqFxYYhx1CpAQFkscXKrTY7fWEXp/ 7ulGwaul/7/xSHZhvDEyw== X-UI-Out-Filterresults: notjunk:1;V03:K0:Ft+gkrpmC5U=:THzIoSVaLv+8gVZHT1yBxn v2MeUD0a9FcW972AsfKa4xKBEJ13kNN1/f1FuqGcPPTiPnHUAvxFheqob34pPpKNGcm+8Kd/S qgFXTspvmMC2EdbBujy/G4YJgYbi/NRmLZUy34h3BX5w6DXsLsWKXTf12M7iHUQTSP5baHANc fp/sYE4My1AppLAn9vG3SuRTU4NJyJSq+iFY61KNyYX1rp/OR6HTHdXlVBJ824btKv/Rz7qfK eJN4jl5mbXtCoKoqWmF/25DzRNBWds/5LUMN8eq5U79vE9OqR4lFKgj2Hf0UvYv0dHJjqCpIc LVO5fYxlqP00KKQ91Pk7afX92aOBM0gBLnt1a2U4AaWGBXx3qsDQ9VcBoypMln7d2Mnd1bRLw Z0ykptCeBVVgJljjKfViJz2R604JAXXICRzhFKcIO0VubNtcyjivE1Ihq0Wvvdq0uOAGhFdW9 rcBQO/8Mq9Fnwu+IZnTyETsZzQaPuujXVSULCic2U8mOuVOzDp/KHAn9KUpE+HW9eVmelyBJz iN93V6Vm++45bxI0rt+gVxMir8R0s96/6So4y1H/fDVm3Pzpr723BppnTZa9Xpjgcz+upRIQw JXZ2l1+X22dUAQiTDcHfIDg79UE0/uqqsUbj3NZ79Yc501EY7yngRCbVyLBR1QDtOjVv3urAQ bHN6jhZmuJItpc6V39WP7c7jVKcPh7zS/QcgZuhlXsCEiZ/AXHs1Obn0C88+F4zopxQ11ugQf LxHf5dRiSELznSPRy+c/z6HBSiUGA6WyoPwYDg== Received-SPF: none client-ip=217.72.192.73; envelope-from=jean@abou-samra.fr; helo=mout.kundenserver.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Original-Sender: "guile-devel" Xref: news.gmane.io gmane.lisp.guile.devel:21314 Archived-At: > Le 19 ao=C3=BBt 2022 =C3=A0 12:19, Maxime Devos a= =C3=A9crit : >=20 > =EF=BB=BF >> On 19-08-2022 00:18, Jean Abou Samra wrote: >> Hi, >>=20 >> Calling the Guile compiler often causes this BDWGC error: =E2=80=9CToo >> many root sets=E2=80=9D. >>=20 >> scheme@(guile-user)> (define-syntax-rule (repeat n expr expr* ...) (do ((= i 0 (1+ i))) ((eqv? i n)) expr expr* ...)) >> scheme@(guile-user)> (use-modules (system base compile)) >> scheme@(guile-user)> (repeat 10000 (compile 5)) >> Too many root sets >> Abandon (core dumped) >>=20 >> Any idea what is going on here? Should I report it as a bug? >> Is there a workaround? >>=20 >> Thanks, >> Jean >=20 > IIRC, Guile used to support garbage collection of compiled code, but that s= upport has been removed. >=20 > I cannot find that in the Git history or NEWS, so maybe that's incorrect. >=20 > If that is correct, maybe with sufficient tests and care, support for unlo= ading compiled code can be restored, removing the call to GC_add_roots. Thanks for your reply. I didn=E2=80=99t dig into the history yet, but I migh= t do it later. For now, I have a question. What is the actual purpose of the= GC_add_roots call? Is it just to give eternal protection to the objects poi= nted to by pointers in the memory section? In that case, wouldn=E2=80=99t it= also work to create a bytevector from the root section and use scm_permanen= t_object on it? Or is this a subtlety where Guile registers its ELF bytecode= as if it were a dynamic library (also ELF)? It would be great if Guile supported garbage collection of loaded bytecode, b= ut for my use case in LilyPond, it is actually not strictly necessary. It s= hould suffice not to error out on the nth call. Jean