From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Andy Moreton Newsgroups: gmane.emacs.bugs Subject: bug#60996: 29.0.60; Native compile fails to remove temp file for trampoline Date: Sun, 22 Jan 2023 12:51:34 +0000 Message-ID: <86tu0iwx49.fsf@gmail.com> References: <74d13c46-5b26-9dd8-45dc-32b7fda25421@gmail.com> <833583ks9t.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="11148"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) To: 60996@debbugs.gnu.org Cancel-Lock: sha1:k0qdkIV6PpXqhAK0kZ2Gus/dnus= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Jan 22 13:52:26 2023 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 1pJZph-0002kc-VX for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 22 Jan 2023 13:52:25 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pJZpP-0004pR-Lf; Sun, 22 Jan 2023 07:52:07 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pJZpK-0004pA-Ns for bug-gnu-emacs@gnu.org; Sun, 22 Jan 2023 07:52:06 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pJZpK-0003ak-7s for bug-gnu-emacs@gnu.org; Sun, 22 Jan 2023 07:52:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pJZpJ-00077X-MM for bug-gnu-emacs@gnu.org; Sun, 22 Jan 2023 07:52:01 -0500 X-Loop: help-debbugs@gnu.org In-Reply-To: <74d13c46-5b26-9dd8-45dc-32b7fda25421@gmail.com> Resent-From: Andy Moreton Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 22 Jan 2023 12:52:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 60996 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.167439191927364 (code B ref -1); Sun, 22 Jan 2023 12:52:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 22 Jan 2023 12:51:59 +0000 Original-Received: from localhost ([127.0.0.1]:50830 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pJZpH-00077G-9b for submit@debbugs.gnu.org; Sun, 22 Jan 2023 07:51:59 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:36460) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pJZpC-000772-IQ for submit@debbugs.gnu.org; Sun, 22 Jan 2023 07:51:58 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pJZp9-0004jr-8F for bug-gnu-emacs@gnu.org; Sun, 22 Jan 2023 07:51:52 -0500 Original-Received: from ciao.gmane.io ([116.202.254.214]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pJZp1-0003ZD-TI for bug-gnu-emacs@gnu.org; Sun, 22 Jan 2023 07:51:46 -0500 Original-Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1pJZoy-0001lQ-32 for bug-gnu-emacs@gnu.org; Sun, 22 Jan 2023 13:51:40 +0100 X-Injected-Via-Gmane: http://gmane.org/ Received-SPF: pass client-ip=116.202.254.214; envelope-from=geb-bug-gnu-emacs@m.gmane-mx.org; helo=ciao.gmane.io X-Spam_score_int: 4 X-Spam_score: 0.4 X-Spam_bar: / X-Spam_report: (0.4 / 5.0 requ) BAYES_00=-1.9, DKIM_ADSP_CUSTOM_MED=0.001, FORGED_GMAIL_RCVD=1, FREEMAIL_FORGED_FROMDOMAIN=0.112, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, NML_ADSP_CUSTOM_MED=0.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:253930 Archived-At: On Sun 22 Jan 2023, Eli Zaretskii wrote: >> Date: Sat, 21 Jan 2023 22:12:10 +0000 >> From: Andy Moreton >> >> Recently emacs 29 (and master) has started showing an error and >> backtrace during startup: >> >> Debugger entered--Lisp error: (permission-denied "Removing old name" >> "Permission denied" "c:/Users/ajm/AppData/Local/Temp/comp-lambda-MTAMbr...") >> delete-file("c:/Users/ajm/AppData/Local/Temp/comp-lambda-MTAMbr...") > > We need a reproducible recipe to investigate this, or results of such > investigation by you: which code has the file open when we try > deleting it, and why that other code has it open? > > For a recipe, it should be enough to present a minimal init file which > causes the problem (but pleased make it really minimal: as few lines > as strictly needed for reproduction) It may take considerable time and effort to reduce my init file down to a simple reproducer... > Btw, "comp-lambda-MTAMbr..." seems to tell that it's some part of > comp.el, which sounds strange: comp.el is supposed to be > natively-compiled during the build, and that includes the trampolines > for it. Hmm... The backtrace always seems to contain: delete file("path/to/comp-lambda-XXXXX.eln") comp--native-compile((lambda (...) ...)) comp-trampoline-compile(function-name) comp-subr-trampoline-install(function-name) advice--add-function(...) advice-add(function-name ...) So it looks very much like compiling trampolines is involved. >> Tracing execution of emacs with Process Explorer shows that the temp >> file used to native compile trampolines is opened and closed repeatedly >> by emacs, and at the point of the backtrace is still open by the same >> emacs process. > > We need to know which code opened it the last time and didn't close > it. Can you figure that out? All the files Emacs opens go through 2 > functions in w32.c: sys_fopen and sys_open, so by running with 2 > breakpoints there that show the backtrace and continue, you should be > able to see the culprit, and we can then take it from there. Thanks. I'll take a look in gdb and report back if I get further info. >> I am not sure excactly when this issue started, but I did not see it in >> emacs-29 or master bootstrapped before this month. > > Could be because we now compile trampolines differently (to avoid the > danger of the "fork bomb" due to recursive compilation of > trampolines by async subprocesses). > > Andrea, any suggestions or comments? > > Thanks.