unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
From: zimoun <zimon.toutoune@gmail.com>
To: Ricardo Wurmus <rekado@elephly.net>
Cc: 28240@debbugs.gnu.org
Subject: bug#28240: bad backtrace on “guix archive -x”
Date: Fri, 28 Oct 2022 10:08:49 +0200	[thread overview]
Message-ID: <861qqs8j5a.fsf@gmail.com> (raw)
In-Reply-To: <87sfj9ijtg.fsf@elephly.net>

Hi Ricardo,

On Thu, 27 Oct 2022 at 13:30, Ricardo Wurmus <rekado@elephly.net> wrote:
> zimoun <zimon.toutoune@gmail.com> writes:
>
>>> guix archive: error: corrupt input while restoring '/tmp/ci' from #<input: file 0>
>>
>> The situation is still the same.  Well, is the “guix archive” error the
>> point of this bug report?
>
> The point is the terrible backtrace.  While this error is a little
> better it’s also not great.

About lzip, the error is catched by call-with-error-handling (guix ui),

--8<---------------cut here---------------start------------->8---
             ((nar-error? c)
              (let ((file (nar-error-file c))
                    (port (nar-error-port c)))
                (if file
                    (leave (G_ "corrupt input while restoring '~a' from ~s~%")
                           file (or (port-filename* port) port))
                    (leave (G_ "corrupt input while restoring archive from ~s~%")
                           (or (port-filename* port) port)))))
--8<---------------cut here---------------end--------------->8---


> But my primary concern is to prevent ’guix archive’ from printing a bad
> backtrace.  Doesn’t matter what we feed it.

In the case of gzip,

--8<---------------cut here---------------start------------->8---
Backtrace:
          12 (primitive-load "/home/simon/.config/guix/current/bin/guix")
In guix/ui.scm:
   2263:7 11 (run-guix . _)
  2226:10 10 (run-guix-command _ . _)
In ice-9/boot-9.scm:
  1752:10  9 (with-exception-handler _ _ #:unwind? _ #:unwind-for-type _)
In guix/status.scm:
    835:3  8 (_)
    815:4  7 (call-with-status-report _ _)
In ice-9/boot-9.scm:
  1752:10  6 (with-exception-handler _ _ #:unwind? _ #:unwind-for-type _)
In guix/store.scm:
   656:37  5 (thunk)
   1295:8  4 (call-with-build-handler #<procedure 7f6aab46c7e0 at guix/ui.scm:1171:2 (continue store things mo…> …)
In guix/serialization.scm:
   416:21  3 (fold-archive #<procedure 7f6aab8f5d20 at guix/serialization.scm:512:16 (file type content result)> …)
In unknown file:
           2 (utf8->string #vu8(0 3 236 189 13 120 92 87 121 46 58 182 147 96 13 73 228 144 244 212 64 40 59 # …))
In ice-9/boot-9.scm:
  1685:16  1 (raise-exception _ #:continuable? _)
  1685:16  0 (raise-exception _ #:continuable? _)

ice-9/boot-9.scm:1685:16: In procedure raise-exception:
Throw to key `decoding-error' with args `("scm_from_utf8_stringn" "input locale conversion error" 0 #vu8
--8<---------------cut here---------------end--------------->8---

the error is incorrectly handled.  If I read correctly, the handled
errors are,

      (guard* (c ((package-input-error? c)
                  ((package-cross-build-system-error? c)
                  ((gexp-input-error? c)
                  ((profile-not-found-error? c)
                  ((missing-generation-error? c)
                  ((unmatched-pattern-error? c)
                  ((profile-collision-error? c)
                  ((nar-error? c)
                  ((store-connection-error? c)
                  ((store-protocol-error? c)
                  ((derivation-missing-output-error? c)
                  ((file-search-error? c)
                  ((invoke-error? c)
                   ((formatted-message? c)
                   ((message-condition? c)

so this ’decoding-error’ is not handled earlier.  Well, the only catch
of ’decoding-error’ is by maybe-utf8->string from (guix status).


Cheers,
simon




      reply	other threads:[~2022-10-28  8:48 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-26 12:23 bug#28240: bad backtrace on “guix archive -x” Ricardo Wurmus
2021-02-25  0:08 ` zimoun
2022-10-26 20:29   ` zimoun
2022-10-27 11:30     ` Ricardo Wurmus
2022-10-28  8:08       ` zimoun [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=861qqs8j5a.fsf@gmail.com \
    --to=zimon.toutoune@gmail.com \
    --cc=28240@debbugs.gnu.org \
    --cc=rekado@elephly.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.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).