From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Martin von Gagern Newsgroups: gmane.emacs.bugs Subject: backup-buffer-copy loops if old backup can't be deleted Date: Mon, 20 Aug 2007 21:58:29 +0200 Message-ID: <46C9F265.1070902@gmx.net> Reply-To: bug-gnu-emacs@gnu.org, Martin von Gagern NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0332378250==" X-Trace: sea.gmane.org 1187641797 21527 80.91.229.12 (20 Aug 2007 20:29:57 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 20 Aug 2007 20:29:57 +0000 (UTC) To: bug-gnu-emacs@gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Aug 20 22:29:54 2007 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1INDsn-0005uR-Ow for geb-bug-gnu-emacs@m.gmane.org; Mon, 20 Aug 2007 22:29:54 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1INDsl-0006BJ-MZ for geb-bug-gnu-emacs@m.gmane.org; Mon, 20 Aug 2007 16:29:51 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1INDOh-0006wt-Mv for bug-gnu-emacs@gnu.org; Mon, 20 Aug 2007 15:58:47 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1INDOg-0006wF-78 for bug-gnu-emacs@gnu.org; Mon, 20 Aug 2007 15:58:47 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1INDOg-0006wC-0p for bug-gnu-emacs@gnu.org; Mon, 20 Aug 2007 15:58:46 -0400 Original-Received: from mail.gmx.net ([213.165.64.20]) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1INDOe-0001lD-Ss for bug-gnu-emacs@gnu.org; Mon, 20 Aug 2007 15:58:45 -0400 Original-Received: (qmail invoked by alias); 20 Aug 2007 19:58:40 -0000 Original-Received: from ppp-88-217-44-103.dynamic.mnet-online.de (EHLO [88.217.44.103]) [88.217.44.103] by mail.gmx.net (mp042) with SMTP; 20 Aug 2007 21:58:40 +0200 X-Authenticated: #858129 X-Provags-ID: V01U2FsdGVkX1+Gnq1nD9GGYk6BNOBoDNBa7v8JOEH1sZPlskIYzw /DLqdkTux/KI3n User-Agent: Thunderbird 2.0.0.6 (X11/20070817) X-Enigmail-Version: 0.95.3 X-Y-GMX-Trusted: 0 X-Detected-Kernel: Linux 2.6, seldom 2.4 (older, 4) X-Mailman-Approved-At: Mon, 20 Aug 2007 16:29:49 -0400 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list 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-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:16401 Archived-At: This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --===============0332378250== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig53EDB5B268F661E34458F9EF" This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig53EDB5B268F661E34458F9EF Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi! I've found a bug in emacs 22.1 and posted a bug report with my distro: https://bugs.gentoo.org/show_bug.cgi?id=3D189627 The Gentoo devs figured they didn't patch that part of the sources, so this is an issue with the official 21.1 release sources as well. The bug occurs when there is a backup file FILE~ for some FILE the user modified and wants to save. If the user doesn't have the privileges to unlink FILE~, it will try over and over again, resulting in an infinite loop. Pressing C-g gets it out of the loop, but the modifications still haven't been saved. Backtraces always mention backup-buffer-copy, I guess that's where the actual loop happens. Steps to reproduce this: 1. mkdir emacs-bug 2. cd emacs-bug 3. echo foo > foo.txt 4. echo bar > foo.txt~ 5. chmod u-w . foo.txt~ 6. emacs foo.txt 7. Change contents from "foo" to "baz" 8. C-x C-s to save Backtrace looks like this: copy-file(".../foo.txt" ".../foo.txt~" nil t) byte-code("..." [from-name to-name nil (delete-file to-name) ((file-error)) copy-file t] 5) backup-buffer-copy(".../foo.txt" ".../foo.txt~" 420) byte-code("..." [file-precious-flag backup-by-copying modes real-file-name backup-by-copying-when-linked backup-by-copying-when-mismatch 0 logand 3072 file-writable-p file-name-directory file-nlinks 1 file-attributes 2 9 file-ownership-preserved-p backup-buffer-copy rename-file t backup-by-copying-when-privileged-mismatch attr backupname setmodes] 4) byte-code("..." [targets delete-old-versions real-file-name buffer-file-name modes buffer-backed-up t nil y-or-n-p format "Delete excess backup versions of %s? " file-modes (byte-code "..." [file-precious-flag backup-by-copying modes real-file-name backup-by-copying-when-linked backup-by-copying-when-mismatch 0 logand 3072 file-writable-p file-name-directory file-nlinks 1 file-attributes 2 9 file-ownership-preserved-p backup-buffer-copy rename-file t backup-by-copying-when-privileged-mismatch attr backupname setmodes] 4) ((file-error ...)) (byte-code "..." [targets delete-file] 2) ((file-error)) setmodes] 5) backup-buffer() basic-save-buffer-2() basic-save-buffer-1() basic-save-buffer() save-buffer(1) call-interactively(save-buffer) Greetings, Martin von Gagern --------------enig53EDB5B268F661E34458F9EF Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFGyfJvRhp6o4m9dFsRAjNCAJ41Nzg0WCwOFSYFO5lsnOk/EQO0xACdEApE 13qURE5RNs98enOaWRShL8Y= =Jo2y -----END PGP SIGNATURE----- --------------enig53EDB5B268F661E34458F9EF-- --===============0332378250== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ bug-gnu-emacs mailing list bug-gnu-emacs@gnu.org http://lists.gnu.org/mailman/listinfo/bug-gnu-emacs --===============0332378250==--