GNU bug report logs - #64686
30.0.50; Tar mode @PaxHeader bug

Previous Next

Package: emacs;

Reported by: Devon Sean McCullough <emacs-hacker2017 <at> jovi.net>

Date: Mon, 17 Jul 2023 18:33:02 UTC

Severity: normal

Found in version 30.0.50

Done: Eli Zaretskii <eliz <at> gnu.org>

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 64686 in the body.
You can then email your comments to 64686 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#64686; Package emacs. (Mon, 17 Jul 2023 18:33:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Devon Sean McCullough <emacs-hacker2017 <at> jovi.net>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Mon, 17 Jul 2023 18:33:02 GMT) Full text and rfc822 format available.

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

From: Devon Sean McCullough <emacs-hacker2017 <at> jovi.net>
To: bug-gnu-emacs <at> gnu.org
Subject: 30.0.50; Tar mode @PaxHeader bug
Date: Mon, 17 Jul 2023 14:31:39 -0400
$ wget 
https://f-droid.org/repo/com.simplemobiletools.voicerecorder_36_src.tar.gz
$ emacs --no-init-file --no-site-file 
com.simplemobiletools.voicerecorder_36_src.tar.gz

should show something like the output of

$ tar -tvz < com.simplemobiletools.voicerecorder_36_src.tar.gz

instead of spurious ././@PaxHeader lines
interleaved with truncated long file names.

        Peace
            --Devon

P.S.  In case it matters:
$ tar --version
tar (GNU tar) 1.34
Copyright (C) 2021 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later 
<https://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by John Gilmore and Jay Fenlason.
$ type tar
tar is hashed (/usr/bin/tar)
$ ldd /usr/bin/tar
    linux-vdso.so.1 (0x00007ffca7b51000)
    libacl.so.1 => /lib/x86_64-linux-gnu/libacl.so.1 (0x00007fcd50638000)
    libselinux.so.1 => /lib/x86_64-linux-gnu/libselinux.so.1 
(0x00007fcd5060c000)
    libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fcd50438000)
    libpcre2-8.so.0 => /lib/x86_64-linux-gnu/libpcre2-8.so.0 
(0x00007fcd503a0000)
    libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fcd5039a000)
    /lib64/ld-linux-x86-64.so.2 (0x00007fcd506e2000)
    libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 
(0x00007fcd50378000)

In GNU Emacs 30.0.50 (build 2, x86_64-pc-linux-gnu, GTK+ Version
 3.24.27, cairo version 1.16.0) of 2023-05-10 built on LQ
Repository revision: e4c8ba6c0589f1ba0ba9993c4f1e9c0821d3ca6c
Repository branch: master
System Description: PureOS 10 (Byzantium)

Configured using:
 'configure --with-pgtk'

Configured features:
CAIRO DBUS FREETYPE GLIB GMP GNUTLS GSETTINGS HARFBUZZ LIBSELINUX
MODULES NOTIFY INOTIFY PDUMPER PGTK PNG SECCOMP SOUND THREADS
TOOLKIT_SCROLL_BARS XIM GTK3 ZLIB

Important settings:
  value of $LC_MONETARY: fr_FR.UTF-8
  value of $LC_NUMERIC: fr_FR.UTF-8
  value of $LC_TIME: fr_FR.UTF-8
  value of $LANG: en_US.UTF-8
  value of $XMODIFIERS: @im=ibus
  locale-coding-system: utf-8-unix

Major mode: Tar

Minor modes in effect:
  tooltip-mode: t
  global-eldoc-mode: t
  show-paren-mode: t
  electric-indent-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
  buffer-read-only: t
  line-number-mode: t
  indent-tabs-mode: t
  transient-mark-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message mailcap yank-media puny dired
dired-loaddefs rfc822 mml mml-sec password-cache epa derived epg rfc6068
epg-config gnus-util text-property-search time-date subr-x mm-decode
mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader
cl-loaddefs cl-lib sendmail rfc2047 rfc2045 ietf-drums mm-util
mail-prsvr mail-utils tar-mode arc-mode archive-mode jka-compr rmc
iso-transl tooltip cconv eldoc paren electric uniquify ediff-hook
vc-hooks lisp-float-type elisp-mode mwheel term/pgtk-win pgtk-win
term/common-win pgtk-dnd tool-bar dnd fontset image regexp-opt fringe
tabulated-list replace newcomment text-mode lisp-mode prog-mode register
page tab-bar menu-bar rfn-eshadow isearch easymenu timer select
scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors
frame minibuffer nadvice seq simple cl-generic indonesian philippine
cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao
korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech
european ethiopic indian cyrillic chinese composite emoji-zwj charscript
charprop case-table epa-hook jka-cmpr-hook help abbrev obarray oclosure
cl-preloaded button loaddefs theme-loaddefs faces cus-face macroexp
files window text-properties overlay sha1 md5 base64 format env
code-pages mule custom widget keymap hashtable-print-readable backquote
threads dbusbind inotify dynamic-setting system-font-setting
font-render-setting cairo gtk pgtk multi-tty make-network-process emacs)

Memory information:
((conses 16 46611 11513)
 (symbols 48 5497 0)
 (strings 32 16893 1459)
 (string-bytes 1 478022)
 (vectors 16 12517)
 (vector-slots 8 186004 14041)
 (floats 8 26 296)
 (intervals 56 2802 5)
 (buffers 976 13))





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#64686; Package emacs. (Thu, 27 Jul 2023 08:38:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Devon Sean McCullough <emacs-hacker2017 <at> jovi.net>
Cc: 64686 <at> debbugs.gnu.org, Stefan Monnier <monnier <at> iro.umontreal.ca>
Subject: Re: bug#64686: 30.0.50; Tar mode @PaxHeader bug
Date: Thu, 27 Jul 2023 11:38:17 +0300
> Date: Mon, 17 Jul 2023 14:31:39 -0400
> From: Devon Sean McCullough <emacs-hacker2017 <at> jovi.net>
> 
> $ wget 
> https://f-droid.org/repo/com.simplemobiletools.voicerecorder_36_src.tar.gz
> $ emacs --no-init-file --no-site-file 
> com.simplemobiletools.voicerecorder_36_src.tar.gz
> 
> should show something like the output of
> 
> $ tar -tvz < com.simplemobiletools.voicerecorder_36_src.tar.gz
> 
> instead of spurious ././@PaxHeader lines
> interleaved with truncated long file names.

Thanks.  In a nutshell, tar-mode didn't support Posix-standard pax
extended headers.  Should be fixed now on the master branch.

P.S. Thanks to Stefan who found a subtle bug in the prototype of this
fix.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#64686; Package emacs. (Thu, 27 Jul 2023 15:03:01 GMT) Full text and rfc822 format available.

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

From: Mattias Engdegård <mattias.engdegard <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Devon Sean McCullough <emacs-hacker2017 <at> jovi.net>, 64686 <at> debbugs.gnu.org,
 Stefan Monnier <monnier <at> iro.umontreal.ca>
Subject: bug#64686: 30.0.50; Tar mode @PaxHeader bug
Date: Thu, 27 Jul 2023 17:02:28 +0200
[Message part 1 (text/plain, inline)]
The change (2dc5f17c3e) causes packages-tests to fail; see attached log.
This is on macOS with an out-of-tree build.

[package-tests.log (application/octet-stream, attachment)]
[Message part 3 (text/plain, inline)]


Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#64686; Package emacs. (Thu, 27 Jul 2023 16:19:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Mattias Engdegård <mattias.engdegard <at> gmail.com>
Cc: emacs-hacker2017 <at> jovi.net, 64686 <at> debbugs.gnu.org, monnier <at> iro.umontreal.ca
Subject: Re: bug#64686: 30.0.50; Tar mode @PaxHeader bug
Date: Thu, 27 Jul 2023 19:19:31 +0300
> From: Mattias Engdegård <mattias.engdegard <at> gmail.com>
> Date: Thu, 27 Jul 2023 17:02:28 +0200
> Cc: Devon Sean McCullough <emacs-hacker2017 <at> jovi.net>,
>  64686 <at> debbugs.gnu.org,
>  Stefan Monnier <monnier <at> iro.umontreal.ca>
> 
> The change (2dc5f17c3e) causes packages-tests to fail; see attached log.
> This is on macOS with an out-of-tree build.

Thanks, should be fixed now.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#64686; Package emacs. (Thu, 27 Jul 2023 16:23:02 GMT) Full text and rfc822 format available.

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

From: Mattias Engdegård <mattias.engdegard <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: emacs-hacker2017 <at> jovi.net, 64686 <at> debbugs.gnu.org, monnier <at> iro.umontreal.ca
Subject: Re: bug#64686: 30.0.50; Tar mode @PaxHeader bug
Date: Thu, 27 Jul 2023 18:22:42 +0200
27 juli 2023 kl. 18.19 skrev Eli Zaretskii <eliz <at> gnu.org>:

> Thanks, should be fixed now.

Confirmed, thank you.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#64686; Package emacs. (Fri, 28 Jul 2023 10:05:01 GMT) Full text and rfc822 format available.

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

From: "Basil L. Contovounesios" <contovob <at> tcd.ie>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Devon Sean McCullough <emacs-hacker2017 <at> jovi.net>, 64686 <at> debbugs.gnu.org,
 Stefan Monnier <monnier <at> iro.umontreal.ca>
Subject: Re: bug#64686: 30.0.50; Tar mode @PaxHeader bug
Date: Fri, 28 Jul 2023 12:04:27 +0200
[Message part 1 (text/plain, inline)]
Eli Zaretskii [2023-07-27 11:38 +0300] wrote:
> Should be fixed now on the master branch.

Thanks, but doesn't tar-parse-pax-extended-header mutate
tar-attr-vector, which is initialised with a constant vector?

E.g. (aset [nil] 0 nil) would normally result in:
Warning: ‘aset’ on constant vector (arg 1)

Is this a welcome change?

[tar.diff (text/x-diff, inline)]
diff --git a/lisp/tar-mode.el b/lisp/tar-mode.el
index e4ea95343e0..2b6329fecc3 100644
--- a/lisp/tar-mode.el
+++ b/lisp/tar-mode.el
@@ -255,15 +255,14 @@ pax-decode-string
       (decode-coding-string str coding)
     str))
 
-(defvar tar-attr-vector '[nil nil nil nil nil nil nil nil])
+(defvar tar-attr-vector (make-vector 8 nil))
 (defun tar-parse-pax-extended-header (pos)
   "Parse a pax external header of a Posix-format tar file."
   (let ((end (+ pos 512))
         (result tar-attr-vector)
         (coding 'utf-8-unix)
         attr value record-len value-len)
-    (dotimes (i 8)
-      (aset result i nil))
+    (fillarray result nil)
     (goto-char pos)
     (while (and (< pos end)
                 (re-search-forward pax-extended-attribute-record-regexp
[Message part 3 (text/plain, inline)]
Thanks,
-- 
Basil

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#64686; Package emacs. (Fri, 28 Jul 2023 11:48:02 GMT) Full text and rfc822 format available.

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

From: Mattias Engdegård <mattias.engdegard <at> gmail.com>
To: Basil Contovounesios <contovob <at> tcd.ie>
Cc: Eli Zaretskii <eliz <at> gnu.org>,
 Devon Sean McCullough <emacs-hacker2017 <at> jovi.net>,
 Stefan Monnier <monnier <at> iro.umontreal.ca>, 64686 <at> debbugs.gnu.org
Subject: bug#64686: 30.0.50; Tar mode @PaxHeader bug 
Date: Fri, 28 Jul 2023 13:47:39 +0200
> Thanks, but doesn't tar-parse-pax-extended-header mutate tar-attr-vector, which is initialised with a constant vector?

Good catch. Little chance of detecting this one statically I'm afraid.

The patch is fine, but maybe we should return a fresh vector each time instead of reusing a single global object.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#64686; Package emacs. (Fri, 28 Jul 2023 12:22:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: "Basil L. Contovounesios" <contovob <at> tcd.ie>
Cc: emacs-hacker2017 <at> jovi.net, 64686 <at> debbugs.gnu.org, monnier <at> iro.umontreal.ca
Subject: Re: bug#64686: 30.0.50; Tar mode @PaxHeader bug
Date: Fri, 28 Jul 2023 15:21:56 +0300
> From: "Basil L. Contovounesios" <contovob <at> tcd.ie>
> Cc: Devon Sean McCullough <emacs-hacker2017 <at> jovi.net>,
>   64686 <at> debbugs.gnu.org,  Stefan Monnier <monnier <at> iro.umontreal.ca>
> Date: Fri, 28 Jul 2023 12:04:27 +0200
> 
> Thanks, but doesn't tar-parse-pax-extended-header mutate
> tar-attr-vector, which is initialised with a constant vector?
> 
> E.g. (aset [nil] 0 nil) would normally result in:
> Warning: ‘aset’ on constant vector (arg 1)
> 
> Is this a welcome change?

Yes, thanks.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#64686; Package emacs. (Fri, 28 Jul 2023 12:27:01 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Mattias Engdegård <mattias.engdegard <at> gmail.com>
Cc: contovob <at> tcd.ie, emacs-hacker2017 <at> jovi.net, 64686 <at> debbugs.gnu.org,
 monnier <at> iro.umontreal.ca
Subject: Re: bug#64686: 30.0.50; Tar mode @PaxHeader bug
Date: Fri, 28 Jul 2023 15:26:08 +0300
> From: Mattias Engdegård <mattias.engdegard <at> gmail.com>
> Date: Fri, 28 Jul 2023 13:47:39 +0200
> Cc: Eli Zaretskii <eliz <at> gnu.org>,
>  Devon Sean McCullough <emacs-hacker2017 <at> jovi.net>,
>  64686 <at> debbugs.gnu.org,
>  Stefan Monnier <monnier <at> iro.umontreal.ca>
> 
> maybe we should return a fresh vector each time instead of reusing a single global object.

I had that in the prototype, but decided I didn't like too much
consing this would produce.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#64686; Package emacs. (Fri, 28 Jul 2023 16:44:01 GMT) Full text and rfc822 format available.

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

From: "Basil L. Contovounesios" <contovob <at> tcd.ie>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: emacs-hacker2017 <at> jovi.net, 64686 <at> debbugs.gnu.org, monnier <at> iro.umontreal.ca
Subject: Re: bug#64686: 30.0.50; Tar mode @PaxHeader bug
Date: Fri, 28 Jul 2023 18:43:07 +0200
Eli Zaretskii [2023-07-28 15:21 +0300] wrote:

>> From: "Basil L. Contovounesios" <contovob <at> tcd.ie>
>> Cc: Devon Sean McCullough <emacs-hacker2017 <at> jovi.net>,
>>   64686 <at> debbugs.gnu.org,  Stefan Monnier <monnier <at> iro.umontreal.ca>
>> Date: Fri, 28 Jul 2023 12:04:27 +0200
>> 
>> Thanks, but doesn't tar-parse-pax-extended-header mutate
>> tar-attr-vector, which is initialised with a constant vector?
>> 
>> E.g. (aset [nil] 0 nil) would normally result in:
>> Warning: ‘aset’ on constant vector (arg 1)
>> 
>> Is this a welcome change?
>
> Yes, thanks.

Thanks, installed:

; Avoid recent tar-mode.el constant mutation
6479e8758d9 2023-07-28 18:36:14 +0200
https://git.sv.gnu.org/cgit/emacs.git/commit/?id=6479e8758d9

-- 
Basil




Reply sent to Eli Zaretskii <eliz <at> gnu.org>:
You have taken responsibility. (Thu, 03 Aug 2023 08:03:02 GMT) Full text and rfc822 format available.

Notification sent to Devon Sean McCullough <emacs-hacker2017 <at> jovi.net>:
bug acknowledged by developer. (Thu, 03 Aug 2023 08:03:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: emacs-hacker2017 <at> jovi.net
Cc: monnier <at> iro.umontreal.ca, 64686-done <at> debbugs.gnu.org
Subject: Re: bug#64686: 30.0.50; Tar mode @PaxHeader bug
Date: Thu, 03 Aug 2023 11:02:43 +0300
> Cc: 64686 <at> debbugs.gnu.org, Stefan Monnier <monnier <at> iro.umontreal.ca>
> Date: Thu, 27 Jul 2023 11:38:17 +0300
> From: Eli Zaretskii <eliz <at> gnu.org>
> 
> > Date: Mon, 17 Jul 2023 14:31:39 -0400
> > From: Devon Sean McCullough <emacs-hacker2017 <at> jovi.net>
> > 
> > $ wget 
> > https://f-droid.org/repo/com.simplemobiletools.voicerecorder_36_src.tar.gz
> > $ emacs --no-init-file --no-site-file 
> > com.simplemobiletools.voicerecorder_36_src.tar.gz
> > 
> > should show something like the output of
> > 
> > $ tar -tvz < com.simplemobiletools.voicerecorder_36_src.tar.gz
> > 
> > instead of spurious ././@PaxHeader lines
> > interleaved with truncated long file names.
> 
> Thanks.  In a nutshell, tar-mode didn't support Posix-standard pax
> extended headers.  Should be fixed now on the master branch.
> 
> P.S. Thanks to Stefan who found a subtle bug in the prototype of this
> fix.

No further comments, so I assume the issue can be closed now.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 31 Aug 2023 11:24:10 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 296 days ago.

Previous Next


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