https://bugs.winehq.org/show_bug.cgi?id=50885
Bug ID: 50885 Summary: PdfSharp creates invalid PDF files Product: Wine Version: 6.5 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: -unknown Assignee: wine-bugs@winehq.org Reporter: lauri.kentta@gmail.com Distribution: ---
Created attachment 69696 --> https://bugs.winehq.org/attachment.cgi?id=69696 Minimal example with PdfSharp
PdfSharp (PDF library for .NET) creates invalid PDF files on Wine. Ghostscript is able to fix the files but reports: ”Error: Unknown operator: '-..' looks like a malformed number, replacing with 0.”
I've attached a shell script which builds a minimal example with C# / PdfSharp and demonstrates the error with Ghostscript. Running with Mono (without Wine) works. Debugging further would probably need a dive into PdfSharp.
In practice, this affects Purple Pen course setting software for orienteering.
https://bugs.winehq.org/show_bug.cgi?id=50885
Nikolay Sivov bunglehead@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Ever confirmed|0 |1 Status|UNCONFIRMED |NEW
--- Comment #1 from Nikolay Sivov bunglehead@gmail.com --- Confirming.
https://bugs.winehq.org/show_bug.cgi?id=50885
--- Comment #2 from Lauri Kenttä lauri.kentta@gmail.com --- It seems to be about formatting negative zero. Here's a more minimal example (C#):
System.Console.WriteLine(-0.0); // Mono: "0", Wine: "-.."
https://bugs.winehq.org/show_bug.cgi?id=50885
--- Comment #3 from Nikolay Sivov bunglehead@gmail.com --- I think the issue is somewhere in managed number conversion. Not sure if it's normal, but this shows up in traces:
[00000024: 2.67895 12] ENTER:c System.BitConverter:DoubleToInt64Bits (double)(-0.000000) [00000024: 2.67896 12] LEAVE:c System.BitConverter:DoubleToInt64Bits (double)(lresult=0x8000000000000000
Converting +0.0 or -0.1 gives correct result.
https://bugs.winehq.org/show_bug.cgi?id=50885
--- Comment #4 from Lauri Kenttä lauri.kentta@gmail.com --- Comparing traces of -0.0 and +0.0 it looks like a bug in ecvt_s which fails to recognize negative zero and assumes that only numbers <0 are negative. Same for all similar cvt functions. I'll send a patch.
https://bugs.winehq.org/show_bug.cgi?id=50885
Nikolay Sivov bunglehead@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Component|-unknown |msvcrt
https://bugs.winehq.org/show_bug.cgi?id=50885
--- Comment #5 from Lauri Kenttä lauri.kentta@gmail.com --- Created attachment 69711 --> https://bugs.winehq.org/attachment.cgi?id=69711 ecvt_s trace with +0/-0
For reference, here's the relevant trace of ecvt_s with +0/-0. Obviously vsscanf_l gets invalid string to parse where -0 is involved.
https://bugs.winehq.org/show_bug.cgi?id=50885
Lauri Kenttä lauri.kentta@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Fixed by SHA1| |97b420224e767b24d89722ff5ef | |eca38a8ecf1e2 Resolution|--- |FIXED
--- Comment #6 from Lauri Kenttä lauri.kentta@gmail.com --- Patch committed.
https://bugs.winehq.org/show_bug.cgi?id=50885
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #7 from Alexandre Julliard julliard@winehq.org --- Closing bugs fixed in 6.6.
https://bugs.winehq.org/show_bug.cgi?id=50885
Michael Stefaniuc mstefani@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|--- |6.0.x
https://bugs.winehq.org/show_bug.cgi?id=50885
Michael Stefaniuc mstefani@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|6.0.x |---
--- Comment #8 from Michael Stefaniuc mstefani@winehq.org --- Removing the 6.0.x milestone from bug fixes included in 6.0.2.