bug#77771: coreutils 9.7 printf crashes on Solaris 11

Bruno Haible via GNU coreutils Bug Reports <[email protected]>
Newsgroups gmane.comp.gnu.core-utils.bugs
Organization GNU
Message-ID <3662750.o7rAqR3Ra6@nimes>
Running the attached script on Solaris 11.4 or Solaris 11 OpenIndiana,
in the coreutils-9.7 build tree, produces a crash:

$ sh ~/cmd
42 351 ...
4 235 ...
42 351 ...
/home/bruno/cmd: line 4: 18141: Memory fault(coredump)
Segmentation Fault (core dumped)

What triggers the crash is a %'g directive that produces a large
number of digits.

The gdb stack trace shows the location: inside function
insert_thousands_sep in /lib/64/libc.so.1.
cmd (text/plain, 1017 B)
LC_ALL=fr_FR.UTF-8 ./printf "%'.50g\\n" 42351647362715016953416125033982098102569580078125
LC_ALL=fr_FR.UTF-8 ./printf "%'.100g\\n" 4235164736271501695341612503398209810256958007812500000000000000000000000000000000000000000000000000
LC_ALL=fr_FR.UTF-8 ./printf "%'.200g\\n" 42351647362715016953416125033982098102569580078125000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
LC_ALL=fr_FR.UTF-8 ./printf "%'.500g\\n" 42351647362715016953416125033982098102569580078125000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.