From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: No Wayman Newsgroups: gmane.emacs.bugs Subject: bug#62004: 30.0.50; comp-run-async-workers failure when default-directory deleted Date: Mon, 06 Mar 2023 16:29:19 -0500 Message-ID: <87jzztwo9h.fsf@gmail.com> References: <874jqxyhfo.fsf@gmail.com> <83sfeh7rlm.fsf@gnu.org> <87zg8px01l.fsf@gmail.com> <83mt4p7mv4.fsf@gnu.org> <87v8jdww42.fsf@gmail.com> <83jzzt7iac.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; format=flowed Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="36990"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.9.21; emacs 30.0.50 Cc: 62004@debbugs.gnu.org, akrl@sdf.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Mar 06 22:40:15 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 1pZIZ2-0009RJ-3y for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 06 Mar 2023 22:40:12 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pZIYt-0002QZ-8K; Mon, 06 Mar 2023 16:40:03 -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 1pZIYs-0002QM-Kc for bug-gnu-emacs@gnu.org; Mon, 06 Mar 2023 16:40:02 -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 1pZIYs-0002ZQ-C6 for bug-gnu-emacs@gnu.org; Mon, 06 Mar 2023 16:40:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pZIYs-0004nt-3r for bug-gnu-emacs@gnu.org; Mon, 06 Mar 2023 16:40:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: No Wayman Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 06 Mar 2023 21:40:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62004 X-GNU-PR-Package: emacs Original-Received: via spool by 62004-submit@debbugs.gnu.org id=B62004.167813878818440 (code B ref 62004); Mon, 06 Mar 2023 21:40:02 +0000 Original-Received: (at 62004) by debbugs.gnu.org; 6 Mar 2023 21:39:48 +0000 Original-Received: from localhost ([127.0.0.1]:43861 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pZIYd-0004nM-Pp for submit@debbugs.gnu.org; Mon, 06 Mar 2023 16:39:48 -0500 Original-Received: from mail-qv1-f44.google.com ([209.85.219.44]:34443) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pZIYc-0004n5-2s for 62004@debbugs.gnu.org; Mon, 06 Mar 2023 16:39:46 -0500 Original-Received: by mail-qv1-f44.google.com with SMTP id o3so7693595qvr.1 for <62004@debbugs.gnu.org>; Mon, 06 Mar 2023 13:39:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678138780; h=mime-version:message-id:in-reply-to:date:subject:cc:to:from :user-agent:references:from:to:cc:subject:date:message-id:reply-to; bh=z7RL5hJEZ627GFvzXjtFlUuWTpegg0Asr+kDx1x1zfc=; b=X619gBchC/GgGw+OygqB/o8db+0pTBuWwE44wGjJK9RkNaqI2IxDs2qdsT1018v8YU K0HA8dUjksNAP64HAAf7sa+sEw9wBP0+9dUJKB/qd0AbIlukOKrsAKvxB5/IKtCjAFuN BDFW9UanvakebAm58n2Bb67EuBikVURh198ysvSVf8fQS0S0COjcRXI7hgS3JOuT8l7U EHYpiDl1+Qcg0AR90poq4nVn+4mjQbKz72m8BYTYKHWxgxw3fyKJWy/c2it6lVL72NDc 2wzhqFIhMAuRh91hqoDandGXkamMsRdza1Pn8YaxR+9Tgln6MVhXO9mb1aLa8hwKaGN1 f7UA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678138780; h=mime-version:message-id:in-reply-to:date:subject:cc:to:from :user-agent:references:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=z7RL5hJEZ627GFvzXjtFlUuWTpegg0Asr+kDx1x1zfc=; b=AdPvfWcPFKFlwQ8zvf1WZF0FN22uamMKbiALrMAhqLWl3LByJ0mr4xT0Z2yCjMLyPR XJT6WBL0N9aCAd3gy9Wm3Wm+54S55lL2ytgE0OEvxkj4kmfcM8NM0WvYWIhIeEnQDcXJ ql8UlXOXCMJkv9xBZVGiaxl63cfiEZ0CoTazO5D74/vf6/z6Ljn0eWhcLUQUI/wYtYin thcfzCImtaD7nqnUmM3KV7/skllLEtMXtWATaGhC48YHIwLdw6EuRBD+iWLkw6Qf8BeL 5CvMpNb2jZTzTpOa1DBWdLDvVhhboz2ilDWmBPc8lDQtld6Vwg5nn9t/gejqVlAhrQPY VMUQ== X-Gm-Message-State: AO0yUKW0NBSt8ANOE8HuwWU26vZlvtQi9BL65X2Mx5wzqugg0MBXNc8K Er5JZJ+HsKsh0ZGiFCfNB0xwN+mqqlmsUw== X-Google-Smtp-Source: AK7set+7VYGkBANjFIHNz0SxLLvuTroSxeBk7PWsxa3MGue6RUrJ9HIbfLzR0MUGPQgI9xaMfvJkhw== X-Received: by 2002:ad4:5ece:0:b0:539:b68e:3444 with SMTP id jm14-20020ad45ece000000b00539b68e3444mr23672521qvb.27.1678138780284; Mon, 06 Mar 2023 13:39:40 -0800 (PST) Original-Received: from nbook ([2601:84:847f:c697:8a6b:6703:a961:212b]) by smtp.gmail.com with ESMTPSA id r145-20020a37a897000000b0073b69922cfesm8278916qke.85.2023.03.06.13.39.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Mar 2023 13:39:39 -0800 (PST) In-reply-to: <83jzzt7iac.fsf@gnu.org> 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:257421 Archived-At: Eli Zaretskii writes: > Sorry, I don't think I understand. Are you saying that we don't > bind > default-directory to a safe value when compiling? Correct. The default-directory is dependent on where comp-run-async-workers happens to kick off. This can be reliably reproduced by: 1. saving the following elisp into test.el: --8<---------------cut here---------------start------------->8--- ;; -*- lexical-binding: t; -*- (let* ((tempdir (expand-file-name "./temp/" user-emacs-directory)) (default-directory tempdir) (feat 'org)) ;; Ensure fresh test dir (when (file-exists-p tempdir) (delete-file tempdir)) (make-directory tempdir) ;; Ensure test feature is not loaded. (when (featurep feat) (unload-feature feat t)) (setq initial-buffer-choice (lambda () (with-current-buffer (find-file (expand-file-name "./temp.txt" tempdir)) (insert "My directory will be deleted.") (write-file (expand-file-name "./temp.txt" tempdir)) (delete-directory tempdir 'recursive) (message "default-directory: %S" default-directory) ;; comp-run-async-workers kicked off by JIT compilation here. ;; This buffer has a file-name, but the directory no longer exists. (require feat) (get-buffer-create (buffer-file-name)))))) --8<---------------cut here---------------end--------------->8--- 2. launching emacs in a temporary init directory via: > $ rm -rf /tmp/comp.test/ && emacs > --init-directory=/tmp/comp.test/ -l test.el This should result in a *Messages* buffer similar to: > For information about GNU Emacs and the GNU system, type C-h > C-a. > (New file) > Saving file /tmp/comp.test/temp/temp.txt... > Wrote /tmp/comp.test/temp/temp.txt > default-directory: "/tmp/comp.test/temp/" > comp-run-async-workers: Setting current directory: No such file > or directory, /tmp/comp.test/temp/ > IOW, how could a directory where the async compilation > subprocess runs become invalid, in Real Life? I ran into this error in the wild by: - Installing a package to review it. - Deleting the package's repository, but still had the package's main elisp buffer open/current. - Ran a command, which loaded a package, which kicked off the JIT comp process.