[Bug 2083131] [NEW] Bash's builtin command "printf" has a grave functionality bug - fails to print the format like "%.2f .1"

Launchpad Bug Tracker 2083131 at bugs.launchpad.net
Sun Nov 3 10:12:19 UTC 2024


You have been subscribed to a public bug by Agathe Porte (gagath):

[ Impact ]

Programs relying on the builtin printf function of bash stop working
correctly when trying to format numbers with %f.

[ Test Plan ]

Run the following command, which currently returns "-nan" while it should return 52.12:
 
$ bash -c "printf %.2f 52.123"

[ Where problems could occur ]

Unknown regressions in the formatting after applying the patch.

[ Original Bug Report ]

As reported in the upstream Debian Linux:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1078556
Bash's builtin command "printf" has a grave functionality bug - fails to print the format like "%.2f .1".

# bash --version
GNU bash, version 5.2.32(1)-release (x86_64-pc-linux-gnu)
Copyright (C) 2022 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

# printf "%.2f\n" 0.1
nan

As mentioned in the above URL, upstream's configure-strtold-check patch:
https://bugs.debian.org/cgi-bin/bugreport.cgi?att=1;bug=1078556;filename=configure-strtold-check;msg=20

** Affects: bash (Ubuntu)
     Importance: Critical
         Status: Confirmed

** Affects: bash (Ubuntu Oracular)
     Importance: Critical
         Status: Confirmed

** Affects: bash (Ubuntu Plucky)
     Importance: Critical
         Status: Confirmed

** Affects: bash (Debian)
     Importance: Unknown
         Status: Confirmed


** Tags: patch
-- 
Bash's builtin command "printf" has a grave functionality bug - fails to print the format like "%.2f .1"
https://bugs.launchpad.net/bugs/2083131
You received this bug notification because you are a member of Ubuntu Sponsors, which is subscribed to the bug report.



More information about the Ubuntu-sponsors mailing list