From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Mike Kupfer Newsgroups: gmane.emacs.bugs Subject: bug#58721: 28.2; dired with delete-by-moving-to-trash can't trash directory twice Date: Fri, 28 Oct 2022 22:25:16 -0700 Message-ID: <189664.1667021116@alto> References: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="10200"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 58721@debbugs.gnu.org, Gustavo Barros To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Oct 29 07:26:35 2022 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 1ooeMc-0002YJ-QY for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 29 Oct 2022 07:26:34 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ooeMN-0006Ck-R2; Sat, 29 Oct 2022 01:26:20 -0400 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 1ooeM6-0006Bw-Ji for bug-gnu-emacs@gnu.org; Sat, 29 Oct 2022 01:26:05 -0400 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 1ooeM6-00089Q-CX for bug-gnu-emacs@gnu.org; Sat, 29 Oct 2022 01:26:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ooeM5-0000qS-QQ for bug-gnu-emacs@gnu.org; Sat, 29 Oct 2022 01:26:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Mike Kupfer Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 29 Oct 2022 05:26:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 58721 X-GNU-PR-Package: emacs Original-Received: via spool by 58721-submit@debbugs.gnu.org id=B58721.16670211283203 (code B ref 58721); Sat, 29 Oct 2022 05:26:01 +0000 Original-Received: (at 58721) by debbugs.gnu.org; 29 Oct 2022 05:25:28 +0000 Original-Received: from localhost ([127.0.0.1]:34796 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ooeLX-0000pa-Om for submit@debbugs.gnu.org; Sat, 29 Oct 2022 01:25:28 -0400 Original-Received: from shell1.rawbw.com ([198.144.192.42]:47345 ident=root) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ooeLT-0000pP-Ka for 58721@debbugs.gnu.org; Sat, 29 Oct 2022 01:25:27 -0400 Original-Received: from alto (135-180-174-133.dsl.dynamic.sonic.net [135.180.174.133] (may be forged)) (authenticated bits=0) by shell1.rawbw.com (8.15.1/8.15.1) with ESMTPSA id 29T5PG8S061758 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 28 Oct 2022 22:25:22 -0700 (PDT) (envelope-from mkupfer@alum.berkeley.edu) X-Authentication-Warning: shell1.rawbw.com: Host 135-180-174-133.dsl.dynamic.sonic.net [135.180.174.133] (may be forged) claimed to be alto In-Reply-To: Your message of "Fri, 28 Oct 2022 14:44:29 +0300." <83edusjhpe.fsf@gnu.org> X-Mailer: MH-E 8.6+git; nmh 1.7.1; Emacs 29.0.50 Content-ID: <189663.1667021116.1@alto> 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: , Original-Sender: "bug-gnu-emacs" Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:246484 Archived-At: Eli Zaretskii wrote: > > From: Gustavo Barros [...] > > Can anyone else reproduce this, or is it really just me? > = > Yes, if someone else could reproduce, it could help. I can reproduce it (Emacs 28.2, Debian 11). I copied my ~/src/emacs-git tree to various directories and then tried trashing it. The failure only happened when trashing a tree that was on a separate filesystem from $HOME, and then it happened reliably. The type of filesystem that contained the copy didn't seem to matter--I saw the problem with both ext4 and vfat. My $HOME is ext4. When trashing a directory tree on the same filesystem, it's sufficient to rename the top-level directory into the trash hierarchy. But Unix doesn't support that across filesystems, so the directory tree needs to be copied into the trash hierarchy and then deleted at the original location. Since we see an empty directory after the error, I assume that something is going wrong with the copy phase. I set a breakpoint in #'copy-directory and got this stack: * copy-directory("/tmp/emacs-git" "/home/kupfer/.local/share/Trash/files/e= macs-gitH0l..." t nil) rename-file("/tmp/emacs-git" "/home/kupfer/.local/share/Trash/files/emac= s-gitH0l..." t) move-file-to-trash("/tmp/emacs-git") delete-directory("/tmp/emacs-git" always t) dired-delete-file("/tmp/emacs-git" top t) dired-internal-do-deletions((("/tmp/emacs-git" . #>)) nil t) dired-do-flagged-delete() funcall-interactively(dired-do-flagged-delete) call-interactively(dired-do-flagged-delete nil nil) command-execute(dired-do-flagged-delete) The target directory (emacs-gitH0lx1e) already exists. In fact, it looks like the target directory already exists when #'rename-file is called. But I think that's expected. I clicked on the "..." in the backtrace to see whether the new name ends with a "/", and it does not. Hrm. Shouldn't the call to copy-directory look like copy-directory("/tmp/emacs-git" "/home/kupfer/.local/share/Trash/files/e= macs-gitH0l..." t nil t) ^^^ ? mike