public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug localedata/12394] New: thousands grouping bug when rounding requires an extra leading digit
@ 2011-01-12 16:15 ajschorr at alumni dot princeton.edu
  2011-01-12 16:18 ` [Bug localedata/12394] " ajschorr at alumni dot princeton.edu
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: ajschorr at alumni dot princeton.edu @ 2011-01-12 16:15 UTC (permalink / raw)
  To: glibc-bugs

http://sourceware.org/bugzilla/show_bug.cgi?id=12394

           Summary: thousands grouping bug when rounding requires an extra
                    leading digit
           Product: glibc
           Version: 2.12
            Status: NEW
          Severity: normal
          Priority: P2
         Component: localedata
        AssignedTo: libc-locales@sources.redhat.com
        ReportedBy: ajschorr@alumni.princeton.edu


Created attachment 5191
  --> http://sourceware.org/bugzilla/attachment.cgi?id=5191
C code to demonstrate the bug

The attached program printthou.c gives buggy results:

bash-4.1$ echo 999.999 999999.999 | printthou
1000.00
,000,000.00

The program is using printf with the format "%'.2f".  As you can
see, those inputs expose bugs in the logic.

These inputs give the expected results:

bash-4.1$ echo 1000 1000000 | printthou
1,000.00
1,000,000.00

Regards,
Andy

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug localedata/12394] thousands grouping bug when rounding requires an extra leading digit
  2011-01-12 16:15 [Bug localedata/12394] New: thousands grouping bug when rounding requires an extra leading digit ajschorr at alumni dot princeton.edu
@ 2011-01-12 16:18 ` ajschorr at alumni dot princeton.edu
  2011-01-12 16:48 ` eblake at redhat dot com
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: ajschorr at alumni dot princeton.edu @ 2011-01-12 16:18 UTC (permalink / raw)
  To: glibc-bugs

http://sourceware.org/bugzilla/show_bug.cgi?id=12394

--- Comment #1 from Andrew J. Schorr <ajschorr at alumni dot princeton.edu> 2011-01-12 16:17:45 UTC ---
Oops, I should mention that I see the problem with LC_NUMERIC="en_US.UTF-8".
It works fine in C locale:

bash-4.1$ echo 999.999 999999.999 | LC_NUMERIC=C printthou
1000.00
1000000.00
bash-4.1$ echo 999.999 999999.999 | LC_NUMERIC=en_US.UTF-8 printthou
1000.00
,000,000.00

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug localedata/12394] thousands grouping bug when rounding requires an extra leading digit
  2011-01-12 16:15 [Bug localedata/12394] New: thousands grouping bug when rounding requires an extra leading digit ajschorr at alumni dot princeton.edu
  2011-01-12 16:18 ` [Bug localedata/12394] " ajschorr at alumni dot princeton.edu
@ 2011-01-12 16:48 ` eblake at redhat dot com
  2011-01-12 22:14 ` bruno at clisp dot org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: eblake at redhat dot com @ 2011-01-12 16:48 UTC (permalink / raw)
  To: glibc-bugs

http://sourceware.org/bugzilla/show_bug.cgi?id=12394

Eric Blake <eblake at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |eblake at redhat dot com

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug localedata/12394] thousands grouping bug when rounding requires an extra leading digit
  2011-01-12 16:15 [Bug localedata/12394] New: thousands grouping bug when rounding requires an extra leading digit ajschorr at alumni dot princeton.edu
  2011-01-12 16:18 ` [Bug localedata/12394] " ajschorr at alumni dot princeton.edu
  2011-01-12 16:48 ` eblake at redhat dot com
@ 2011-01-12 22:14 ` bruno at clisp dot org
  2011-01-12 22:17 ` [Bug libc/12394] " bruno at clisp dot org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: bruno at clisp dot org @ 2011-01-12 22:14 UTC (permalink / raw)
  To: glibc-bugs

http://sourceware.org/bugzilla/show_bug.cgi?id=12394

--- Comment #2 from Bruno Haible <bruno at clisp dot org> 2011-01-12 22:14:31 UTC ---
Created attachment 5192
  --> http://sourceware.org/bugzilla/attachment.cgi?id=5192
test case for the bugs with %f and %g

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug libc/12394] thousands grouping bug when rounding requires an extra leading digit
  2011-01-12 16:15 [Bug localedata/12394] New: thousands grouping bug when rounding requires an extra leading digit ajschorr at alumni dot princeton.edu
                   ` (2 preceding siblings ...)
  2011-01-12 22:14 ` bruno at clisp dot org
@ 2011-01-12 22:17 ` bruno at clisp dot org
  2011-01-13  0:43 ` drepper.fsp at gmail dot com
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: bruno at clisp dot org @ 2011-01-12 22:17 UTC (permalink / raw)
  To: glibc-bugs

http://sourceware.org/bugzilla/show_bug.cgi?id=12394

Bruno Haible <bruno at clisp dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bruno at clisp dot org
          Component|localedata                  |libc
         AssignedTo|libc-locales at sources dot |drepper.fsp at gmail dot
                   |redhat.com                  |com

--- Comment #3 from Bruno Haible <bruno at clisp dot org> 2011-01-12 22:16:47 UTC ---
The bug affects not only the %f directive, but also the %g directive,
and can lead to a segmentation fault in the latter case.

Find attached the test case. How to reproduce:
$ gcc -Wall bug12394.c
$ ./a.out 
Segmentation fault (core dumped)
$ gdb a.out core
(gdb) where
#0  0x00007f70364aeaa4 in __printf_fp () from /lib64/libc.so.6
#1  0x00007f70364a9b4d in vfprintf () from /lib64/libc.so.6
#2  0x00007f70364cbee9 in vsprintf () from /lib64/libc.so.6
#3  0x00007f70364b2118 in sprintf () from /lib64/libc.so.6
#4  0x0000000000400819 in main ()

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug libc/12394] thousands grouping bug when rounding requires an extra leading digit
  2011-01-12 16:15 [Bug localedata/12394] New: thousands grouping bug when rounding requires an extra leading digit ajschorr at alumni dot princeton.edu
                   ` (3 preceding siblings ...)
  2011-01-12 22:17 ` [Bug libc/12394] " bruno at clisp dot org
@ 2011-01-13  0:43 ` drepper.fsp at gmail dot com
  2011-01-13  1:39 ` drepper.fsp at gmail dot com
  2014-06-27 12:30 ` fweimer at redhat dot com
  6 siblings, 0 replies; 8+ messages in thread
From: drepper.fsp at gmail dot com @ 2011-01-13  0:43 UTC (permalink / raw)
  To: glibc-bugs

http://sourceware.org/bugzilla/show_bug.cgi?id=12394

Ulrich Drepper <drepper.fsp at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Attachment #5192|text/x-csrc                 |text/plain
          mime type|                            |

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug libc/12394] thousands grouping bug when rounding requires an extra leading digit
  2011-01-12 16:15 [Bug localedata/12394] New: thousands grouping bug when rounding requires an extra leading digit ajschorr at alumni dot princeton.edu
                   ` (4 preceding siblings ...)
  2011-01-13  0:43 ` drepper.fsp at gmail dot com
@ 2011-01-13  1:39 ` drepper.fsp at gmail dot com
  2014-06-27 12:30 ` fweimer at redhat dot com
  6 siblings, 0 replies; 8+ messages in thread
From: drepper.fsp at gmail dot com @ 2011-01-13  1:39 UTC (permalink / raw)
  To: glibc-bugs

http://sourceware.org/bugzilla/show_bug.cgi?id=12394

Ulrich Drepper <drepper.fsp at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED

--- Comment #4 from Ulrich Drepper <drepper.fsp at gmail dot com> 2011-01-13 01:39:36 UTC ---
Fixed in git.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug libc/12394] thousands grouping bug when rounding requires an extra leading digit
  2011-01-12 16:15 [Bug localedata/12394] New: thousands grouping bug when rounding requires an extra leading digit ajschorr at alumni dot princeton.edu
                   ` (5 preceding siblings ...)
  2011-01-13  1:39 ` drepper.fsp at gmail dot com
@ 2014-06-27 12:30 ` fweimer at redhat dot com
  6 siblings, 0 replies; 8+ messages in thread
From: fweimer at redhat dot com @ 2014-06-27 12:30 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=12394

Florian Weimer <fweimer at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
              Flags|                            |security-

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2014-06-27 12:30 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-12 16:15 [Bug localedata/12394] New: thousands grouping bug when rounding requires an extra leading digit ajschorr at alumni dot princeton.edu
2011-01-12 16:18 ` [Bug localedata/12394] " ajschorr at alumni dot princeton.edu
2011-01-12 16:48 ` eblake at redhat dot com
2011-01-12 22:14 ` bruno at clisp dot org
2011-01-12 22:17 ` [Bug libc/12394] " bruno at clisp dot org
2011-01-13  0:43 ` drepper.fsp at gmail dot com
2011-01-13  1:39 ` drepper.fsp at gmail dot com
2014-06-27 12:30 ` fweimer at redhat dot com

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).