NetBSD Problem Report #59807

From www@netbsd.org  Sun Nov 30 03:25:48 2025
Return-Path: <www@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256
	 client-signature RSA-PSS (2048 bits) client-digest SHA256)
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id A24BC1A9239
	for <gnats-bugs@gnats.NetBSD.org>; Sun, 30 Nov 2025 03:25:48 +0000 (UTC)
Message-Id: <20251130032547.6A9991A923A@mollari.NetBSD.org>
Date: Sun, 30 Nov 2025 03:25:47 +0000 (UTC)
From: jlduran@gmail.com
Reply-To: jlduran@gmail.com
To: gnats-bugs@NetBSD.org
Subject: strfmon: Bring back for the third (and hopefully definitive) time sign_posn = 1 when undefined
X-Send-Pr-Version: www-1.0

>Number:         59807
>Category:       lib
>Synopsis:       strfmon: Bring back for the third (and hopefully definitive) time sign_posn = 1 when undefined
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    lib-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Nov 30 03:30:00 +0000 2025
>Last-Modified:  Sun Nov 30 04:10:01 +0000 2025
>Originator:     Jose Luis Duran
>Release:        trunk
>Organization:
FreeBSD
>Environment:
>Description:
If the locale's positive_sign and negative_sign values would both be
returned by localeconv() as empty strings, strfmon() shall behave as if
the negative_sign value was the string "-".

This occurs with the C locale.  The implementation previously assigned
"0" to sign_posn (parentheses around the entire string); now it assigns
it to "1" (sign before the string) when it is undefined (CHAR_MAX).

This was recommended by GNU C:
https://ftp.gnu.org/old-gnu/Manuals/glibc-2.2.3/html_node/libc_111.html
It was first added in strfmon.c,v 1.12.
Then removed in strfmon,v 1.17.
Then added back in strfmon.c,v 1.18
Then removed again in strfmon.c,v 1.20, this time requested by me.
Now I kindly request to bring it back again, this time with an Austin Group Defect to justify it:
https://www.austingroupbugs.net/view.php?id=1199

While fixing it, I also added the extra error [EINVAL] condition.
>How-To-Repeat:
See the updated tests below.

>Fix:
https://github.com/freebsd/freebsd-src/commit/cf85e7034ad5640b18a3b68d6b291b7bf89bfc80

EINVAL extra check:
https://github.com/freebsd/freebsd-src/commit/1fd018972a18b682521bb8f004dfd162327e5db2


>Audit-Trail:
From: Jose Luis Duran <jlduran@gmail.com>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: lib/59807: strfmon: Bring back for the third (and hopefully
 definitive) time sign_posn = 1 when undefined
Date: Sun, 30 Nov 2025 01:09:00 -0300

 On Sun, Nov 30, 2025 at 12:30=E2=80=AFAM <gnats-admin@netbsd.org> wrote:
 >
 > Thank you very much for your problem report.
 > It has the internal identification `lib/59807'.
 > The individual assigned to look at your
 > report is: lib-bug-people.
 >
 > >Category:       lib
 > >Responsible:    lib-bug-people
 > >Synopsis:       strfmon: Bring back for the third (and hopefully definit=
 ive) time sign_posn =3D 1 when undefined
 > >Arrival-Date:   Sun Nov 30 03:30:00 +0000 2025
 >
 I apologize for the confusion. The bug report is valid. It's history
 is not. The variable in the history is sep_by_space, the bug fixes
 sign_posn.
 Regards,

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.