bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

backup-buffer-copy loops if old backup can't be deleted


From: Martin von Gagern
Subject: backup-buffer-copy loops if old backup can't be deleted
Date: Mon, 20 Aug 2007 21:58:29 +0200
User-agent: Thunderbird 2.0.0.6 (X11/20070817)

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: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]