[Bug 49496] New: sprintf uses locale specific decimal point when it should not.
https://bugs.winehq.org/show_bug.cgi?id=49496 Bug ID: 49496 Summary: sprintf uses locale specific decimal point when it should not. Product: Wine Version: 5.11 Hardware: x86 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: -unknown Assignee: wine-bugs(a)winehq.org Reporter: bernhardu(a)mailbox.org Distribution: --- This manifested first in Microsoft Word 2007 printing empty pages with wine-5.11. I could track this down to wineeps.drv using my locales "de_DE.UTF-8" decimalpoint ',' instead of the expected '.' from the "C" locale: - /FontBBox [-0.476074 -0.193848 1.213867 0.952148] def + /FontBBox [-0,476074 -0,193848 1,213867 0,952148] def This line is produced in wineps.drv\type42.c:207, which is surrounded by setlocale calls to use "C". But these do call into MSVCRT_setlocale, which seems not forward this into glibc. And in the end the "%f" format is forwarded to glibc's __sprintf. A git bisect led to this commit: b86dc3926bfe5cd92400aa96c89b0255eba1d447 is the first bad commit commit b86dc3926bfe5cd92400aa96c89b0255eba1d447 Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu Jun 11 11:38:16 2020 +0200 ntdll: Move the locales initialization to the Unix library. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> This, I guess, is also visible in the tests of ucrtbase:printf since that day, where some machines seem to use french locale: https://test.winehq.org/data/tests/ucrtbase:printf.html -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=49496 Piotr Caban <piotr.caban(a)gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |piotr.caban(a)gmail.com --- Comment #1 from Piotr Caban <piotr.caban(a)gmail.com> --- FYI I'm working on changing the msvcrt printf implementation so it doesn't use sprintf from glibc for outputing floating point numbers. It still needs quite a lot of work. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=49496 Austin English <austinenglish(a)gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |regression Regression SHA1| |b86dc3926bfe5cd92400aa96c89 | |b0255eba1d447 -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=49496 --- Comment #2 from Bernhard Übelacker <bernhardu(a)mailbox.org> --- Did not test it yet, but I guess commit 031c744a1fb9 might fix this issue, until sprintf from glibc is no longer used. And then this bug might be also a duplicate of #49489. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=49496 Bernhard Übelacker <bernhardu(a)mailbox.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED Status|UNCONFIRMED |RESOLVED Fixed by SHA1| |031c744a1fb9b94f7a4634eae5f | |56845b586554d --- Comment #3 from Bernhard Übelacker <bernhardu(a)mailbox.org> --- Found this could be reproduced also with just printing in notepad. Additionally can confirm that 031c744a1fb9 indeed fixed the issue, therefore marking as resolved. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=49496 --- Comment #4 from Rafał Mużyło <galtgendo(a)o2.pl> --- ...ah, shrub, it isn't resolved yet. If you'd read julliard's post on the list, you'd know that the workaround was green-lighted only because the proper solution was taking too much time. Only once that is written and goes in we'll be in position to know how many regressions it will trigger. Also, besides printf, its quite likely also scanf will need to be addressed. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=49496 --- Comment #5 from Bernhard Übelacker <bernhardu(a)mailbox.org> --- I opened this bug report as regression caused by commit b86dc3926bfe5 which got mitigated by commit 031c744a1fb9. Therefore I marked this report as fixed and I guess it will be up to Piotr to decide if he needs/wants this report stay open? -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=49496 --- Comment #6 from Piotr Caban <piotr.caban(a)gmail.com> --- (In reply to Rafał Mużyło from comment #4)
Also, besides printf, its quite likely also scanf will need to be addressed. Scanf is already not depending on glibc locale.
-- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=49496 Alexandre Julliard <julliard(a)winehq.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED --- Comment #7 from Alexandre Julliard <julliard(a)winehq.org> --- Closing bugs fixed in 5.13. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
participants (1)
-
WineHQ Bugzilla