bad backtrace on “guix archive -x”

  • Open
  • quality assurance status badge
Details
2 participants
  • Ricardo Wurmus
  • zimoun
Owner
unassigned
Submitted by
Ricardo Wurmus
Severity
normal
R
R
Ricardo Wurmus wrote on 26 Aug 2017 14:23
bad backtrace on “guix archive -x ”
(name . 'bug-guix@gnu.org')(address . bug-guix@gnu.org)
87a82mv7py.fsf@elephly.net
Here’s what I did:

Toggle snippet (22 lines)
wget -q -O - https://mirror.hydra.gnu.org/guix/nar/gzip/ykpfif2wzabhnn0a88sw3f96paa33k2z-r-minimal-3.4.0 | guix archive -x /tmp/hydra
Backtrace:
6 (primitive-load "/gnu/store/gkv8zl774h2qpa89mrf6d74fry3…")
In guix/ui.scm:
1352:12 5 (run-guix-command _ . _)
In ice-9/boot-9.scm:
837:9 4 (catch _ _ #<procedure 7f731bea09a8 at guix/ui.scm:450…> …)
837:9 3 (catch _ _ #<procedure 7f731bea09c0 at guix/ui.scm:538…> …)
In guix/scripts/archive.scm:
345:28 2 (_)
In guix/serialization.scm:
316:21 1 (restore-file #<input: file 0> "/tmp/hydra")
In unknown file:
0 (utf8->string #vu8(0 3 236 189 11 116 92 213 149 32 # …))

ERROR: In procedure utf8->string:
ERROR: Throw to key `decoding-error' with args `("scm_from_utf8_stringn" "input locale conversion error" 0 #vu8(2 3 236 189 11 116 92 213 149 32 122 37 99 35 93 140 100 136 1 135 132 230 32 4 37 9 85 233 227 15 178 141 140 74 82 217 85 65 150 148 146 100 96 97 35 223 170 186 85 186 168 126 169 91 165 143 177 19 51 134 4 45 183 50 76 122 186 87 207 116 214 123 204 91 157 76 122 77 86 154 158 204 155 16 186 131 237 5 193 73 175 204 132 204 234 78 210 157 188 78 79 186 211 145 67 62 116 39 33 36 233 224 183 247 62 159 251 169 42 27 99 32 153 181 82 96 221 123 207 103 159 115 246 217 103 239 125 246 217 231 156 171 53 254 203 91 75 65 163 148 156 179 22 204 96 31 124 55 136 240 14 241 188 66 60 203 203 69 19 159 205 226 59 101 149 204 100 185 80 90 22 223 235 197 211 204 151 41 172 30 156 188 145 35 56 235 196 119 194 202 123 227 11 41 138 127 187 234 33 227 227 254 248 215 89 143 43 197 119 201 204 84 178 70 73 211 101 249 75 102 178 82 54 18 89 83 243 252 154 196 51 89 200 151 161 142 246 31 183 243 239 91 111 233 201 228 43 61 54 52 197 236 153 191 179 183 127 231 252 246 5 99 199 64 118 222 40 38 142 36 151 147 169 35 15 221 153 219 158 120 40 177 45 49 16 76 24 246 92 112 91 104 91 168 175 191 7 48 216 131 223 250 173 108 106 206 204 102 2
[pages upon pages of numbers]

The problem here is that I didn’t gunzip the file, but I guess it could
have told me that instead of giving me all these numbers.

--
Ricardo

GPG: BCA6 89B6 3655 3801 C3C6 2150 197A 5888 235F ACAC
Z
Z
zimoun wrote on 25 Feb 2021 01:08
Re: bug#28240: bad backtrace on “guix archive -x”
(name . Ricardo Wurmus)(address . rekado@elephly.net)(address . 28240@debbugs.gnu.org)
86czwpknzk.fsf@gmail.com
Hi Ricardo,


On Sat, 26 Aug 2017 at 14:23, Ricardo Wurmus <rekado@elephly.net> wrote:

Toggle quote (3 lines)
> Backtrace:

This example is not relevant anymore. Instead,

Toggle snippet (3 lines)
wget -O - https://ci.guix.gnu.org/nar/gzip/bhdixzi1c7x4jyh93zx5aqgwzzw3i182-r-minimal-4.0.4 | guix archive -x /tmp/ci

still returns the ugly backtrace with…

[...]

Toggle quote (5 lines)
> ERROR: Throw to key `decoding-error' with args `("scm_from_utf8_stringn" "input locale conversion error" 0 #vu8(2 3 236 189 11 116 92 213 149 32 122 37 99 35 93 140 100 136 1 135 132 230 32 4 37 9 85 233 227 15 178 141 140 74 82 217 85 65 150 148 146 100 96 97 35 223 170 186 85 186 168 126 169 91 165 143 177 19 51 134 4 45 183 50 76 122 186 87 207 116 214 123 204 91 157 76 122 77 86 154 158 204 155 16 186 131 237 5 193 73 175 204 132 204 234 78 210 157 188 78 79 186 211 145 67 62 116 39 33 36 233 224 183 247 62 159 251 169 42 27 99 32 153 181 82 96 221 123 207 103 159 115 246 217 103 239 125 246 217 231 156 171 53 254 203 91 75 65 163 148 156 179 22 204 96 31 124 55 136 240 14 241 188 66 60 203 203 69 19 159 205 226 59 101 149 204 100 185 80 90 22 223 235 197 211 204 151 41 172 30 156 188 145 35 56 235 196 119 194 202 123 227 11 41 138 127 187 234 33 227 227 254 248 215 89 143 43 197 119 201 204 84 178 70 73 211 101 249 75 102 178 82 54 18 89 83 243 252 154 196 51 89 200 151 161 142 246 31 183 243 239 91 111 233 201 228 43 61 54 52 197 236 153 191 179 183 127 231 252 246 5 99 199 64 118 222 40 38 142 36 151 147 169 35 15 221 153 219 158 120 40 177 45 49 16 76 24 246 92 112 91 104 91 168 175 191 7 48 216 131 223 250 173 108 106 206 204 102 2
> …
> [pages upon pages of numbers]
> …

…pages of numbers.


Moreover, the lzip returns something more comprehensive.

Toggle snippet (16 lines)
$ wget -O - https://ci.guix.gnu.org/nar/lzip/…-r-minimal-4.0.4 | guix archive -x /tmp/ci
--2021-02-25 01:02:04-- https://ci.guix.gnu.org/nar/lzip/…-r-minimal-4.0.4
Resolving ci.guix.gnu.org (ci.guix.gnu.org)... 141.80.181.40
Connecting to ci.guix.gnu.org (ci.guix.gnu.org)|141.80.181.40|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 24343298 (23M) [application/octet-stream]
Saving to: ‘STDOUT’

- 100%[=====================================>] 23.21M 486KB/s in 56s

2021-02-25 01:03:01 (424 KB/s) - written to stdout [24343298/24343298]

guix archive: error: corrupt input while restoring '/tmp/ci' from #<input: file 0>


All the best,
simon
Z
Z
zimoun wrote on 26 Oct 2022 22:29
(name . Ricardo Wurmus)(address . rekado@elephly.net)(address . 28240@debbugs.gnu.org)
86k04mba6w.fsf@gmail.com
Hi,

On Thu, 25 Feb 2021 at 01:08, zimoun <zimon.toutoune@gmail.com> wrote:

Toggle quote (37 lines)
> On Sat, 26 Aug 2017 at 14:23, Ricardo Wurmus <rekado@elephly.net> wrote:
>
>> wget -q -O - https://mirror.hydra.gnu.org/guix/nar/gzip/ykpfif2wzabhnn0a88sw3f96paa33k2z-r-minimal-3.4.0 | guix archive -x /tmp/hydra
>> Backtrace:
>
> This example is not relevant anymore. Instead,
>
> wget -O - https://ci.guix.gnu.org/nar/gzip/bhdixzi1c7x4jyh93zx5aqgwzzw3i182-r-minimal-4.0.4 | guix archive -x /tmp/ci
>
>
> still returns the ugly backtrace with…
>
> [...]
>
>> ERROR: Throw to key `decoding-error' with args `("scm_from_utf8_stringn"
>> "input locale conversion error" 0 #vu8(2 3 236 189 11 116 92 213 149 32 122
>> 37 99 35 93 140 100 136 1 135 132 230 32 4 37 9 85 233 227 15 178 141 140 74
>> 82 217 85 65 150 148 146 100 96 97 35 223 170 186 85 186 168 126 169 91 165
>> 143 177 19 51 134 4 45 183 50 76 122 186 87 207 116 214 123 204 91 157 76
>> 122 77 86 154 158 204 155 16 186 131 237 5 193 73 175 204 132 204 234 78 210
>> 157 188 78 79 186 211 145 67 62 116 39 33 36 233 224 183 247 62 159 251 169
>> 42 27 99 32 153 181 82 96 221 123 207 103 159 115 246 217 103 239 125 246
>> 217 231 156 171 53 254 203 91 75 65 163 148 156 179 22 204 96 31 124 55 136
>> 240 14 241 188 66 60 203 203 69 19 159 205 226 59 101 149 204 100 185 80 90
>> 22 223 235 197 211 204 151 41 172 30 156 188 145 35 56 235 196 119 194 202
>> 123 227 11 41 138 127 187 234 33 227 227 254 248 215 89 143 43 197 119 201
>> 204 84 178 70 73 211 101 249 75 102 178 82 54 18 89 83 243 252 154 196 51 89
>> 200 151 161 142 246 31 183 243 239 91 111 233 201 228 43 61 54 52 197 236
>> 153 191 179 183 127 231 252 246 5 99 199 64 118 222 40 38 142 36 151 147 169
>> 35 15 221 153 219 158 120 40 177 45 49 16 76 24 246 92 112 91 104 91 168 175
>> 191 7 48 216 131 223 250 173 108 106 206 204 102 2
>> …
>> [pages upon pages of numbers]
>> …
>
> …pages of numbers.

This is still relevant. However, is it still worth to keep it open
because of:


?


Toggle quote (17 lines)
>
> Moreover, the lzip returns something more comprehensive.
>
> $ wget -O - https://ci.guix.gnu.org/nar/lzip/…-r-minimal-4.0.4 | guix archive -x /tmp/ci
> --2021-02-25 01:02:04-- https://ci.guix.gnu.org/nar/lzip/…-r-minimal-4.0.4
> Resolving ci.guix.gnu.org (ci.guix.gnu.org)... 141.80.181.40
> Connecting to ci.guix.gnu.org (ci.guix.gnu.org)|141.80.181.40|:443... connected.
> HTTP request sent, awaiting response... 200 OK
> Length: 24343298 (23M) [application/octet-stream]
> Saving to: ‘STDOUT’
>
> - 100%[=====================================>] 23.21M 486KB/s in 56s
>
> 2021-02-25 01:03:01 (424 KB/s) - written to stdout [24343298/24343298]
>
> 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?


Cheers,
simon
R
R
Ricardo Wurmus wrote on 27 Oct 2022 13:30
(name . zimoun)(address . zimon.toutoune@gmail.com)(address . 28240@debbugs.gnu.org)
87sfj9ijtg.fsf@elephly.net
zimoun <zimon.toutoune@gmail.com> writes:

Toggle quote (5 lines)
>> 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.

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

--
Ricardo
Z
Z
zimoun wrote on 28 Oct 2022 10:08
(name . Ricardo Wurmus)(address . rekado@elephly.net)(address . 28240@debbugs.gnu.org)
861qqs8j5a.fsf@gmail.com
Hi Ricardo,

On Thu, 27 Oct 2022 at 13:30, Ricardo Wurmus <rekado@elephly.net> wrote:
Toggle quote (10 lines)
> 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),

Toggle snippet (11 lines)
((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)))))


Toggle quote (3 lines)
> 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,

Toggle snippet (27 lines)
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

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
?