GNU bug report logs - #70142
[PATCH] Fix error messages containing format strings

Previous Next

Package: guile;

Reported by: Michael Käppler <xmichael-k <at> web.de>

Date: Tue, 2 Apr 2024 14:08:03 UTC

Severity: normal

Tags: patch

Done: Ludovic Courtès <ludo <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 70142 in the body.
You can then email your comments to 70142 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-guile <at> gnu.org:
bug#70142; Package guile. (Tue, 02 Apr 2024 14:08:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Michael Käppler <xmichael-k <at> web.de>:
New bug report received and forwarded. Copy sent to bug-guile <at> gnu.org. (Tue, 02 Apr 2024 14:08:04 GMT) Full text and rfc822 format available.

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

From: Michael Käppler <xmichael-k <at> web.de>
To: bug-guile <at> gnu.org
Subject: [PATCH] Fix error messages containing format strings
Date: Tue, 2 Apr 2024 09:52:34 +0200
[Message part 1 (text/plain, inline)]
Hi all,
I recently ran into the issue that some error messages in Guile are not
formatted properly.
As a simple reproducer, fire up a REPL and do

,option on-error 'foo

Which will yield

"While executing meta-command:
Bad on-error value ~a; expected one of ~a foo (debug backtrace report pass)"

The reason is that format strings occurring in the message are
escaped, see `module/ice-9/boot-9.scm`  and
`module/language/tree-il/primitives.scm`.

So a call of

`(error "Wrong argument: ~a" 42)`

is rendered as

"Wrong argument: ~a 42"
Some callers did not take this behavior into account.

Patch attached.

Michael
[0001-Fix-error-messages-containing-format-strings.patch (text/plain, attachment)]

Reply sent to Ludovic Courtès <ludo <at> gnu.org>:
You have taken responsibility. (Mon, 06 May 2024 09:44:02 GMT) Full text and rfc822 format available.

Notification sent to Michael Käppler <xmichael-k <at> web.de>:
bug acknowledged by developer. (Mon, 06 May 2024 09:44:02 GMT) Full text and rfc822 format available.

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

From: Ludovic Courtès <ludo <at> gnu.org>
To: Michael Käppler <xmichael-k <at> web.de>
Cc: 70142-done <at> debbugs.gnu.org
Subject: Re: bug#70142: [PATCH] Fix error messages containing format strings
Date: Mon, 06 May 2024 11:42:34 +0200
Hi Michael,

Michael Käppler <xmichael-k <at> web.de> skribis:

> The reason is that format strings occurring in the message are
> escaped, see `module/ice-9/boot-9.scm`  and
> `module/language/tree-il/primitives.scm`.
>
> So a call of
>
> `(error "Wrong argument: ~a" 42)`
>
> is rendered as
>
> "Wrong argument: ~a 42"
> Some callers did not take this behavior into account.

Good catch, applied.  Thanks!

Ludo’.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 03 Jun 2024 11:24:15 GMT) Full text and rfc822 format available.

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

Previous Next


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