unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
From: Bengt Richter <bokr@bokr.com>
To: Ricardo Wurmus <rekado@elephly.net>
Cc: 42601@debbugs.gnu.org
Subject: bug#42601: Guix install bug: error: Unbound variable: ~S
Date: Fri, 31 Jul 2020 10:04:10 +0200	[thread overview]
Message-ID: <20200731080410.GA3470@LionPure> (raw)
In-Reply-To: <87pn8ege77.fsf@elephly.net>

Hi,

On +2020-07-30 00:15:56 +0200, Ricardo Wurmus wrote:
> 
> Jan Wielkiewicz <tona_kosmicznego_smiecia@interia.pl> writes:
> 
> > Dnia 2020-07-29, o godz. 22:17:01
> > Ricardo Wurmus <rekado@elephly.net> napisał(a):
> >
> >> 
> >> “avr-toolchain” is a procedure, not a package.  Use
> >> “avr-toolchain-4.9” or “avr-toolchain-5”.
> >> 
> >
> > Success!
> >
> > What about the strange message though?
> > "incorrect package definition" would be better.
> 
> “Unbound variable: ~S” looks like a format string with a placeholder
> that didn’t get replaced with an actual value.  It would be marginally
> better if it said “Unbound variable: avr-toolchain”.

I suspect there are also bugs lurking in the exception-reporting chain between
a (throw 'exception args ...) and the ultimate format statement that produces
a message with "~S" in it. Perhaps one got fixed or avoided in the upgrade?

It seems like something must receive a malformed (key . args) pair
where the args don't match the standard(?) tuple expected for the key.

I'd look for dynamic format string generation splitting arg strings
and mistakenly recomposing a format string and args for it, such that
"~S" got placed in the arg list instead of string-appended into the
proper final format.

Just a hunch. IIRC I've seen mangling the final format string and its args
wind up with a mismatch in number of args and interpolation "~s" elements
and if not papered over, that gets reported as a formatting error (which it is,
but which hides the real error).

> 
> We should, I think, take advantage of the fact that the type of inputs
> is known: it can only be an origin or a package value.  Perhaps we can
> catch unbound variables in inputs and print a more valuable error
> message.

I think you are right.
And all implicit meta-data should be seen as potential security vulnerabilities IMO :)
Who do you trust to do a reinterpret-cast for you?

> 
> -- 
> Ricardo
> 
> 
> 

-- 
Regards,
Bengt Richter




  parent reply	other threads:[~2020-07-31  8:05 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-29 16:09 bug#42601: Guix install bug: error: Unbound variable: ~S Jan Wielkiewicz
2020-07-29 16:16 ` Jan Wielkiewicz
2020-07-29 17:00   ` Leo Famulari
2020-07-29 17:18     ` Jan Wielkiewicz
2020-07-29 17:57   ` Ricardo Wurmus
2020-07-29 19:36     ` Jan Wielkiewicz
2020-07-29 19:44     ` Jan Wielkiewicz
2020-07-29 20:17       ` Ricardo Wurmus
2020-07-29 22:12         ` Jan Wielkiewicz
2020-07-29 22:15           ` Ricardo Wurmus
2020-07-29 22:33             ` Leo Famulari
2020-07-31  8:04             ` Bengt Richter [this message]
2020-08-03 18:39               ` maxim.cournoyer
2020-08-05 20:33                 ` Ludovic Courtès
2020-08-05 23:53                   ` Jan Wielkiewicz
2020-08-23 16:24                     ` Ludovic Courtès
2020-08-09 22:25 ` Jan Wielkiewicz
2022-06-11 21:27 ` bug#42601: Sharlatan Hellseher

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=20200731080410.GA3470@LionPure \
    --to=bokr@bokr.com \
    --cc=42601@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).