GNU bug report logs - #14652
24.3; ZIP files corrupted when saved via tramp

Previous Next

Package: emacs;

Reported by: JuanLeon Lahoz <juanleon.lahoz <at> gmail.com>

Date: Tue, 18 Jun 2013 15:50:02 UTC

Severity: important

Found in version 24.3

Done: Michael Albinus <michael.albinus <at> gmx.de>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 14652 in the body.
You can then email your comments to 14652 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#14652; Package emacs. (Tue, 18 Jun 2013 15:50:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to JuanLeon Lahoz <juanleon.lahoz <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Tue, 18 Jun 2013 15:50:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: JuanLeon Lahoz <juanleon.lahoz <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.3; ZIP files corrupted when saved via tramp
Date: Tue, 18 Jun 2013 13:49:51 +0200
[Message part 1 (text/plain, inline)]
Dear Emacs maintainers,

I start emacs with emacs -Q.  Then I open two remote files (foo.tgz and
foo.zip).  I modify a file within both of them.  I save them.  foo.tgz gets
upated correctly and foo.zip gets corrupted (same happens with jar files,
btw,
since they are zipped).

[ For reproducing the issue, you don't need the foo.tgz file, I just
mention that
to point that other compressed formats work fine for me ].

The remote files are in a system available via SSH, so that is what tramp
uses.

The funny thing is that when I modify the zip file locally, it works
fine and emacs does not remind me I need to save the zip file (emacs
reminds me to do it with the tgz file), but remotely emacs reminds me to
save the zip file.  When I do, it gets corrupted.

I was not sure if the problem lies within tramp or in the emacs code that
deals
with zip files, so I filed a bug report to tramp.  Here is their answer:

   I would say it is due to arc-mode.el. I've checked the code shortly; it
uses
   `call-process' internally, which is not prepared for remote files.
Replacing
   all such calls by `process-file' was not reasonable, at least handling of
   temporary files must be improved as well.

   I recommend to file a bug report towards Emacs, by "M-x
report-emacs-bug".

(I would appreciate very much a way to get a patch for fixing this, if/when
available)

Configured using:
 `configure '--with-x-toolkit=gtk3''

Important settings:
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix
  default enable-multibyte-characters: t

Minor modes in effect:
  tooltip-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Load-path shadows:
None found.

Features:
(shadow sort gnus-util mail-extr emacsbug message format-spec rfc822 mml
easymenu mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231
mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums
mm-util mail-prsvr mail-utils time-date tooltip ediff-hook vc-hooks
lisp-float-type mwheel x-win x-dnd tool-bar dnd fontset image regexp-opt
fringe tabulated-list newcomment lisp-mode register page menu-bar
rfn-eshadow timer select scroll-bar mouse jit-lock font-lock syntax
facemenu font-core frame cham georgian utf-8-lang misc-lang vietnamese
tibetan thai tai-viet lao korean japanese hebrew greek romanian slovak
czech european ethiopic indian cyrillic chinese case-table epa-hook
jka-cmpr-hook help simple abbrev minibuffer loaddefs button faces
cus-face macroexp files text-properties overlay sha1 md5 base64 format
env code-pages mule custom widget hashtable-print-readable backquote
make-network-process dynamic-setting system-font-setting
font-render-setting move-toolbar gtk x-toolkit x multi-tty emacs)
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#14652; Package emacs. (Thu, 20 Jun 2013 12:03:02 GMT) Full text and rfc822 format available.

Message #8 received at 14652 <at> debbugs.gnu.org (full text, mbox):

From: Michael Albinus <michael.albinus <at> gmx.de>
To: JuanLeon Lahoz <juanleon.lahoz <at> gmail.com>
Cc: 14652 <at> debbugs.gnu.org
Subject: Re: bug#14652: 24.3; ZIP files corrupted when saved via tramp
Date: Thu, 20 Jun 2013 14:02:10 +0200
JuanLeon Lahoz <juanleon.lahoz <at> gmail.com> writes:

> Dear Emacs maintainers,

Hi,

> The funny thing is that when I modify the zip file locally, it works
> fine and emacs does not remind me I need to save the zip file (emacs
> reminds me to do it with the tgz file), but remotely emacs reminds me
> to save the zip file. When I do, it gets corrupted.
>
> I was not sure if the problem lies within tramp or in the emacs code
> that deals with zip files, so I filed a bug report to tramp. Here is
> their answer:
>
> I would say it is due to arc-mode.el. I've checked the code shortly;
> it uses `call-process' internally, which is not prepared for remote
> files.  Replacing all such calls by `process-file' was not reasonable,
> at least handling of temporary files must be improved as well.

I have checked arc-mode.el in detail; the usage of `call-process' is not
a problem, because it is applied on local copies of the archive.

Archives could be marked as "remote". In that case, the archive is not
saved by intention when it is modified, but the message mentioned above
appears.

However, the following patch I have committed to the trunk allows to
save the archive by "C-x C-s" (this is `save-buffer'), without
corrupting the archive:

--8<---------------cut here---------------start------------->8---
*** ~/src/emacs/lisp/arc-mode.el.~113092~  2013-06-20 13:56:09.298495645 +0200
--- ~/src/emacs/lisp/arc-mode.el         2013-06-20 13:40:03.496925664 +0200
***************
*** 689,697 ****
    (setq revert-buffer-function 'archive-mode-revert)
    (auto-save-mode 0)
  
!       ;; Remote archives are not written by a hook.
!       (if archive-remote nil
!         (add-hook 'write-contents-functions 'archive-write-file nil t))
  
        (make-local-variable 'require-final-newline)
        (setq require-final-newline nil)
--- 689,695 ----
    (setq revert-buffer-function 'archive-mode-revert)
    (auto-save-mode 0)
  
!       (add-hook 'write-contents-functions 'archive-write-file nil t)
  
        (make-local-variable 'require-final-newline)
        (setq require-final-newline nil)
--8<---------------cut here---------------end--------------->8---

> (I would appreciate very much a way to get a patch for fixing this,
> if/when available)

Could you, please, check whether the patch works for you?

Best regards, Michael.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#14652; Package emacs. (Thu, 20 Jun 2013 12:46:02 GMT) Full text and rfc822 format available.

Message #11 received at 14652 <at> debbugs.gnu.org (full text, mbox):

From: JuanLeon Lahoz <juanleon.lahoz <at> gmail.com>
To: Michael Albinus <michael.albinus <at> gmx.de>
Cc: 14652 <at> debbugs.gnu.org
Subject: Re: bug#14652: 24.3; ZIP files corrupted when saved via tramp
Date: Thu, 20 Jun 2013 14:45:42 +0200
[Message part 1 (text/plain, inline)]
On Thu, Jun 20, 2013 at 2:02 PM, Michael Albinus <michael.albinus <at> gmx.de>wrote:

> JuanLeon Lahoz <juanleon.lahoz <at> gmail.com> writes:
> > (I would appreciate very much a way to get a patch for fixing this,
> > if/when available)
>
> Could you, please, check whether the patch works for you?
>
> Best regards, Michael.
>

Patch is working fine for me :-)

Thanks!
juanleon
[Message part 2 (text/html, inline)]

Reply sent to Michael Albinus <michael.albinus <at> gmx.de>:
You have taken responsibility. (Thu, 20 Jun 2013 12:52:02 GMT) Full text and rfc822 format available.

Notification sent to JuanLeon Lahoz <juanleon.lahoz <at> gmail.com>:
bug acknowledged by developer. (Thu, 20 Jun 2013 12:52:03 GMT) Full text and rfc822 format available.

Message #16 received at 14652-done <at> debbugs.gnu.org (full text, mbox):

From: Michael Albinus <michael.albinus <at> gmx.de>
To: JuanLeon Lahoz <juanleon.lahoz <at> gmail.com>
Cc: 14652-done <at> debbugs.gnu.org
Subject: Re: bug#14652: 24.3; ZIP files corrupted when saved via tramp
Date: Thu, 20 Jun 2013 14:51:36 +0200
JuanLeon Lahoz <juanleon.lahoz <at> gmail.com> writes:

> Patch is working fine for me :-)

Thanks for testing. I'm closing the bug.

> Thanks!
> juanleon

Best regards, Michael.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 19 Jul 2013 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 11 years and 341 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.