unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* backup-buffer-copy loops if old backup can't be deleted
@ 2007-08-20 19:58 Martin von Gagern
  2007-08-21  6:50 ` martin rudalics
  0 siblings, 1 reply; 23+ messages in thread
From: Martin von Gagern @ 2007-08-20 19:58 UTC (permalink / raw)
  To: bug-gnu-emacs


[-- Attachment #1.1: Type: text/plain, Size: 2288 bytes --]

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=189627
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


[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 252 bytes --]

[-- Attachment #2: Type: text/plain, Size: 149 bytes --]

_______________________________________________
bug-gnu-emacs mailing list
bug-gnu-emacs@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-gnu-emacs

^ permalink raw reply	[flat|nested] 23+ messages in thread
[parent not found: <mailman.5018.1187641790.32220.bug-gnu-emacs@gnu.org>]

end of thread, other threads:[~2007-08-25  4:07 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-20 19:58 backup-buffer-copy loops if old backup can't be deleted Martin von Gagern
2007-08-21  6:50 ` martin rudalics
     [not found] <mailman.5018.1187641790.32220.bug-gnu-emacs@gnu.org>
2007-08-20 22:01 ` Martin von Gagern
     [not found] ` <mailman.5021.1187647310.32220.bug-gnu-emacs@gnu.org>
2007-08-21 12:18   ` Martin von Gagern
2007-08-21 14:37     ` martin rudalics
2007-08-21 14:51       ` Martin von Gagern
2007-08-21 15:28         ` martin rudalics
2007-08-21 19:35         ` Glenn Morris
2007-08-21 21:01           ` martin rudalics
2007-08-21 21:50             ` Glenn Morris
2007-08-22  9:13               ` Martin von Gagern
2007-08-22  9:44                 ` martin rudalics
2007-08-22  9:48                   ` Martin von Gagern
2007-08-22 12:40                     ` martin rudalics
2007-08-22 21:37                     ` Michael Schierl
2007-08-21 22:21             ` Martin von Gagern
2007-08-22  9:51               ` Ulrich Mueller
2007-08-23 20:59     ` Richard Stallman
2007-08-24  7:13       ` Martin von Gagern
2007-08-24  9:10         ` martin rudalics
2007-08-25  4:07           ` Richard Stallman
2007-08-25  4:07         ` Richard Stallman
     [not found]     ` <mailman.5219.1187902794.32220.bug-gnu-emacs@gnu.org>
2007-08-24  6:11       ` Ulrich Mueller

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).