GNU bug report logs - #38777
26.3; tar-mode doesn't list a file / crashes on package-tar-file-info

Previous Next

Package: emacs;

Reported by: Victor Collod <victor.collod <at> epita.fr>

Date: Sat, 28 Dec 2019 19:01:02 UTC

Severity: normal

Found in version 26.3

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 38777 in the body.
You can then email your comments to 38777 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#38777; Package emacs. (Sat, 28 Dec 2019 19:01:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Victor Collod <victor.collod <at> epita.fr>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sat, 28 Dec 2019 19:01:02 GMT) Full text and rfc822 format available.

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

From: Victor Collod <victor.collod <at> epita.fr>
To: bug-gnu-emacs <at> gnu.org
Subject: 26.3; tar-mode doesn't list a file / crashes on package-tar-file-info
Date: Sat, 28 Dec 2019 19:09:40 +0100
Hello!

A few months ago, the nix port of irony stopped building for a very, very strange reason:
when the complete path of the package metadata file is 32 characters long (plus some other unknown conditions), it isn't shown in the tar-mode file list view, and running (package-tar-file-info) fails with the following stack trace:

> Debugger entered--Lisp error: (wrong-type-argument arrayp nil)
>   tar--describe-as-link(nil)
>   tar--check-descriptor(nil)
>   tar-get-file-descriptor("irony-20190703.1732/irony-pkg.el")
>   package-tar-file-info()
>   eval((package-tar-file-info) nil)
>   eval-expression((package-tar-file-info) nil nil 127)
>   funcall-interactively(eval-expression (package-tar-file-info) nil nil 127)
>   call-interactively(eval-expression record nil)
>   command-execute(eval-expression record)
>   execute-extended-command(nil "eval-expression" nil)
>   funcall-interactively(execute-extended-command nil "eval-expression" nil)
>   call-interactively(execute-extended-command nil nil)
>   command-execute(execute-extended-command)

Unfortunately, my yet to be found lisp programming skills are way too low to solve this issue.
I have tried and failed to understand what's going on. Perhaps this bug isn't a good introduction to lisp programming :/

Here is the related (worked around) NixOS issue:
https://github.com/NixOS/nixpkgs/issues/66556#issuecomment-522809883

And a link to a zip file containing the cursed tar file:
https://github.com/NixOS/nixpkgs/files/3522572/repro.zip


Configured using:
 'configure
 --prefix=/nix/store/bgv2mpq96crnldxkq79iwc31qadnq5al-emacs-26.3
 --disable-build-details --with-modules --with-x-toolkit=gtk3 --with-xft
 CFLAGS=-DMAC_OS_X_VERSION_MAX_ALLOWED=101200'

Configured features:
XPM JPEG TIFF GIF PNG RSVG SOUND DBUS GSETTINGS GLIB NOTIFY LIBSELINUX
GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB TOOLKIT_SCROLL_BARS
GTK3 X11 XDBE XIM MODULES THREADS LIBSYSTEMD

Important settings:
  value of $EMACSLOADPATH: /nix/store/62ynkkg5w0c1kxwlxdwzcvja47wmxycl-emacs-packages-deps/share/emacs/site-lisp:
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Debugger

Minor modes in effect:
  shell-dirtrack-mode: t
  global-whitespace-mode: t
  which-key-mode: t
  editorconfig-mode: t
  diff-auto-refine-mode: t
  show-paren-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  buffer-read-only: t
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t

Load-path shadows:
/home/multun/.nix-profile/share/emacs/site-lisp/git hides /run/current-system/sw/share/emacs/site-lisp/git
/home/multun/.nix-profile/share/emacs/site-lisp/git-blame hides /run/current-system/sw/share/emacs/site-lisp/git-blame
/run/current-system/sw/share/emacs/site-lisp/site-start hides /nix/store/62ynkkg5w0c1kxwlxdwzcvja47wmxycl-emacs-packages-deps/share/emacs/site-lisp/site-start
/run/current-system/sw/share/emacs/site-lisp/site-start hides /nix/store/bgv2mpq96crnldxkq79iwc31qadnq5al-emacs-26.3/share/emacs/site-lisp/site-start
/nix/store/62ynkkg5w0c1kxwlxdwzcvja47wmxycl-emacs-packages-deps/share/emacs/site-lisp/elpa/seq-2.20/seq hides /nix/store/bgv2mpq96crnldxkq79iwc31qadnq5al-emacs-26.3/share/emacs/26.3/lisp/emacs-lisp/seq
/nix/store/62ynkkg5w0c1kxwlxdwzcvja47wmxycl-emacs-packages-deps/share/emacs/site-lisp/elpa/let-alist-1.0.6/let-alist hides /nix/store/bgv2mpq96crnldxkq79iwc31qadnq5al-emacs-26.3/share/emacs/26.3/lisp/emacs-lisp/let-alist

Features:
(cl-print debug shadow sort company-oddmuse company-keywords
company-etags etags company-gtags company-dabbrev-code company-dabbrev
company-files company-capf company-cmake company-xcode company-clang
company-semantic company-eclim company-bbdb company-irony
company-template company pcase mail-extr tar-mode arc-mode archive-mode
emacsbug yaml-mode diff novice xref project vc vc-dispatcher smerge-mode
js sgml-mode dom imenu rst compile writeroom-mode visual-fill-column
dired-aux face-remap nix-mode ffap nix-repl nix-shell nix-store
nix-instantiate nix-shebang nix-format nix markdown-mode color noutline
outline python tramp-sh tramp tramp-compat tramp-loaddefs trampver
ucs-normalize shell pcomplete parse-time comint ring ansi-color
make-mode two-column iso-transl sendmail misearch multi-isearch lisp-mnt
irony-cdb-libclang irony-cdb-json pp irony-cdb-clang-complete irony-cdb
irony-completion irony-snippet flycheck-irony irony-diagnostics irony
irony-iotask flycheck cl-extra json map find-func help-mode rx subr-x
dash cc-mode cc-fonts cc-guess cc-menus cc-cmds cc-styles cc-align
cc-engine cc-vars cc-defs vc-git sh-script smie executable server
elec-pair multiple-cursors mc-hide-unmatched-lines-mode
mc-separate-operations rectangular-region-mode mc-mark-pop mc-mark-more
mc-cycle-cursors mc-edit-lines multiple-cursors-core rect clang-format
xml whitespace rainbow-delimiters which-key editorconfig notmuch hl-line
notmuch-hello wid-edit notmuch-tree notmuch-show notmuch-print
notmuch-crypto notmuch-mua notmuch-message notmuch-draft
notmuch-maildir-fcc notmuch-address notmuch-company notmuch-parser
notmuch-wash diff-mode easy-mmode coolj notmuch-query goto-addr
thingatpt icalendar diary-lib diary-loaddefs cal-menu calendar
cal-loaddefs notmuch-tag edmacro kmacro crm notmuch-lib advice
notmuch-version notmuch-compat cl message rmc puny dired dired-loaddefs
format-spec rfc822 mml mailabbrev gmm-utils mailheader mm-view mml-smime
mml-sec epa derived epg gnus-util rmail rmail-loaddefs mail-utils smime
dig mm-decode mm-bodies mm-encode mailcap mail-parse rfc2231 rfc2047
rfc2045 mm-util ietf-drums mail-prsvr time-date tsdh-dark-theme paren
cus-start cus-load finder-inf info package easymenu epg-config
url-handlers url-parse auth-source cl-seq eieio eieio-core cl-macs
eieio-loaddefs password-cache url-vars seq seq-25 byte-opt gv bytecomp
byte-compile cconv cl-loaddefs cl-lib mule-util tooltip eldoc electric
uniquify ediff-hook vc-hooks lisp-float-type mwheel term/x-win x-win
term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe
tabulated-list replace newcomment text-mode elisp-mode lisp-mode
prog-mode register page menu-bar rfn-eshadow isearch timer select
scroll-bar mouse jit-lock font-lock syntax facemenu font-core
term/tty-colors frame cl-generic 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 charscript charprop case-table epa-hook jka-cmpr-hook
help simple abbrev obarray minibuffer cl-preloaded nadvice loaddefs
button faces cus-face macroexp files text-properties overlay sha1 md5
base64 format env code-pages mule custom widget hashtable-print-readable
backquote threads dbusbind inotify dynamic-setting system-font-setting
font-render-setting move-toolbar gtk x-toolkit x multi-tty
make-network-process emacs)

Memory information:
((conses 16 813410 99456)
 (symbols 48 53733 20)
 (miscs 40 4416 6082)
 (strings 32 159751 8703)
 (string-bytes 1 4644355)
 (vectors 16 74595)
 (vector-slots 8 2364846 103216)
 (floats 8 328 893)
 (intervals 56 71244 222)
 (buffers 992 99))

-- 
Victor Collod




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#38777; Package emacs. (Sat, 28 Dec 2019 19:55:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Victor Collod <victor.collod <at> epita.fr>
Cc: 38777 <at> debbugs.gnu.org
Subject: Re: bug#38777: 26.3;
 tar-mode doesn't list a file / crashes on package-tar-file-info
Date: Sat, 28 Dec 2019 21:54:35 +0200
> Date: Sat, 28 Dec 2019 19:09:40 +0100
> From: Victor Collod <victor.collod <at> epita.fr>
> 
> A few months ago, the nix port of irony stopped building for a very, very strange reason:
> when the complete path of the package metadata file is 32 characters long (plus some other unknown conditions), it isn't shown in the tar-mode file list view, and running (package-tar-file-info) fails with the following stack trace:
> 
> > Debugger entered--Lisp error: (wrong-type-argument arrayp nil)
> >   tar--describe-as-link(nil)
> >   tar--check-descriptor(nil)
> >   tar-get-file-descriptor("irony-20190703.1732/irony-pkg.el")
> >   package-tar-file-info()
> >   eval((package-tar-file-info) nil)
> >   eval-expression((package-tar-file-info) nil nil 127)
> >   funcall-interactively(eval-expression (package-tar-file-info) nil nil 127)
> >   call-interactively(eval-expression record nil)
> >   command-execute(eval-expression record)
> >   execute-extended-command(nil "eval-expression" nil)
> >   funcall-interactively(execute-extended-command nil "eval-expression" nil)
> >   call-interactively(execute-extended-command nil nil)
> >   command-execute(execute-extended-command)
> 
> Unfortunately, my yet to be found lisp programming skills are way too low to solve this issue.
> I have tried and failed to understand what's going on. Perhaps this bug isn't a good introduction to lisp programming :/
> 
> Here is the related (worked around) NixOS issue:
> https://github.com/NixOS/nixpkgs/issues/66556#issuecomment-522809883
> 
> And a link to a zip file containing the cursed tar file:
> https://github.com/NixOS/nixpkgs/files/3522572/repro.zip

Looks like invalid tar file?  It uses the magic string of "ustar "
(two trailing blanks), whereas we only recognize at most one.  So the
first entry with a file name longer than 100 bytes confuses
tar-mode.el.

Does anyone know if this is valid in tar files?  If so,
tar-header-block-tokenize will have to be updated.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#38777; Package emacs. (Sat, 28 Dec 2019 20:53:02 GMT) Full text and rfc822 format available.

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

From: Andreas Schwab <schwab <at> linux-m68k.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Victor Collod <victor.collod <at> epita.fr>, 38777 <at> debbugs.gnu.org
Subject: Re: bug#38777: 26.3;
 tar-mode doesn't list a file / crashes on package-tar-file-info
Date: Sat, 28 Dec 2019 21:52:35 +0100
On Dez 28 2019, Eli Zaretskii wrote:

> Looks like invalid tar file?  It uses the magic string of "ustar "
> (two trailing blanks), whereas we only recognize at most one.

That's the oldgnu format.

Andreas.

-- 
Andreas Schwab, schwab <at> linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."




Reply sent to Eli Zaretskii <eliz <at> gnu.org>:
You have taken responsibility. (Mon, 30 Dec 2019 16:21:01 GMT) Full text and rfc822 format available.

Notification sent to Victor Collod <victor.collod <at> epita.fr>:
bug acknowledged by developer. (Mon, 30 Dec 2019 16:21:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Andreas Schwab <schwab <at> linux-m68k.org>
Cc: victor.collod <at> epita.fr, 38777-done <at> debbugs.gnu.org
Subject: Re: bug#38777: 26.3;
 tar-mode doesn't list a file / crashes on package-tar-file-info
Date: Mon, 30 Dec 2019 18:20:06 +0200
> From: Andreas Schwab <schwab <at> linux-m68k.org>
> Cc: Victor Collod <victor.collod <at> epita.fr>,  38777 <at> debbugs.gnu.org
> Date: Sat, 28 Dec 2019 21:52:35 +0100
> 
> On Dez 28 2019, Eli Zaretskii wrote:
> 
> > Looks like invalid tar file?  It uses the magic string of "ustar "
> > (two trailing blanks), whereas we only recognize at most one.
> 
> That's the oldgnu format.

Thanks.

I found the problem in tar-mode.el when reading oldgnu format, and
fixed it on the emacs-27 branch.  I'm therefore closing the bug.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 28 Jan 2020 12:24:08 GMT) Full text and rfc822 format available.

This bug report was last modified 4 years and 61 days ago.

Previous Next


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