From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Andrea Corallo via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#46256: [feature/native-comp] AOT eln files ignored if run from build tree Date: Sun, 07 Mar 2021 21:51:15 +0000 Message-ID: References: <86eehujcip.fsf@gmail.com> <86blch14qt.fsf@gmail.com> <83h7m84h9g.fsf@gnu.org> <86v9ao5czu.fsf@gmail.com> <86wnutogrh.fsf@gmail.com> <86wnut8fb9.fsf@gmail.com> <861rd1tbpa.fsf@gmail.com> <83pn0km6y3.fsf@gnu.org> <86ft1f8ara.fsf@gmail.com> <83sg5cjdn8.fsf@gnu.org> <83r1kwjcy2.fsf@gnu.org> <8335x6u9o4.fsf@gnu.org> <83zgzesrku.fsf@gnu.org> Reply-To: Andrea Corallo Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="36808"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: Eli Zaretskii , andrewjmoreton@gmail.com, 46256@debbugs.gnu.org To: Pip Cet Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Mar 07 22:52:13 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1lJ1Jr-0009Pj-Cg for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 07 Mar 2021 22:52:11 +0100 Original-Received: from localhost ([::1]:47786 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lJ1Jq-0000PU-G8 for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 07 Mar 2021 16:52:10 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:41692) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lJ1Ji-0000Nn-DA for bug-gnu-emacs@gnu.org; Sun, 07 Mar 2021 16:52:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:58371) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lJ1Ji-0005wB-65 for bug-gnu-emacs@gnu.org; Sun, 07 Mar 2021 16:52:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lJ1Ji-0001gE-4K for bug-gnu-emacs@gnu.org; Sun, 07 Mar 2021 16:52:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Andrea Corallo Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 07 Mar 2021 21:52:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 46256 X-GNU-PR-Package: emacs Original-Received: via spool by 46256-submit@debbugs.gnu.org id=B46256.16151538816411 (code B ref 46256); Sun, 07 Mar 2021 21:52:02 +0000 Original-Received: (at 46256) by debbugs.gnu.org; 7 Mar 2021 21:51:21 +0000 Original-Received: from localhost ([127.0.0.1]:41684 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lJ1J3-0001fL-4c for submit@debbugs.gnu.org; Sun, 07 Mar 2021 16:51:21 -0500 Original-Received: from mx.sdf.org ([205.166.94.24]:55579) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lJ1Iy-0001f9-Q4 for 46256@debbugs.gnu.org; Sun, 07 Mar 2021 16:51:19 -0500 Original-Received: from mab (ma.sdf.org [205.166.94.33]) by mx.sdf.org (8.15.2/8.14.5) with ESMTPS id 127LpFgm013744 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits) verified NO); Sun, 7 Mar 2021 21:51:15 GMT In-Reply-To: (Pip Cet's message of "Sun, 7 Mar 2021 21:27:57 +0000") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:201790 Archived-At: Pip Cet writes: > On Sun, Mar 7, 2021 at 8:17 PM Andrea Corallo via Bug reports for GNU > Emacs, the Swiss army knife of text editors > wrote: >> Eli Zaretskii writes: >> >> From: Andrea Corallo >> >> Cc: 46256@debbugs.gnu.org, andrewjmoreton@gmail.com >> >> Date: Sun, 07 Mar 2021 18:53:50 +0000 >> What I think is going on here: >> >> The same .eln file is loaded two times, we detect that and try to reuse >> the same compilation unit (the Lisp object) instead of a new one. >> >> We keep a pointer to the compilation unit representing the .eln file in >> each .eln. Here we read it and we have it into 'saved_cu', we try to >> dereference it and extract the CU with XNATIVE_COMP_UNIT but something >> goes wrong. >> >> This object might have been GC'ed for some reason and we might be >> looking at the same GC issue I've seen on 32bit wide-int (my guess). >> *If* this is the case the question is: why is the CU GC'ed? > > Why wouldn't it be? I'm trying to follow along here :-) If the CU was GC'ed the eln should have been dlclosed. If that's the case at the next load we should get a fresh handle and 'saved_cu' should be NULL (ops! Qnil... :/) because static allocated. Here what we see is that we are loading two times without dlclosing and the object pointed by 'cu_saved' has some issue. So thinking about: the fact that the eln was never dlclosed should be prove that the CU was not GC'ed and so I was wrong. This suggests also that before further talking stupid I'd better say I'm done for the day :) Andrea