https://bugs.winehq.org/show_bug.cgi?id=37908
Bug ID: 37908 Summary: Saving a GLFont .glf file causes crash Product: Wine Version: 1.7.33 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: -unknown Assignee: wine-bugs@winehq.org Reporter: shomari.sharpe@gmail.com Distribution: ---
Created attachment 50490 --> https://bugs.winehq.org/attachment.cgi?id=50490 Wine Crash Log
GL Font is an application that generates a binary file storing font glyphs as well as their texture coordinates for opengl. Under wine the program crashes once the save button is clicked in the program.
https://students.cs.byu.edu/~bfish/glfontdl.php
https://bugs.winehq.org/show_bug.cgi?id=37908
Bruno Jesus 00cpxxx@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |download URL| |https://students.cs.byu.edu | |/~bfish/glfontdl.php Summary|Saving a GLFont .glf file |GLFont crashes saving a |causes crash |.glf file (needs | |msvcp70.dll.?open@?$basic_o | |fstream@DU?$char_traits@D@s | |td@@@std@@QAEXPBDH@Z)
https://bugs.winehq.org/show_bug.cgi?id=37908
Maarten anonymous.maarten@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |anonymous.maarten@gmail.com
--- Comment #1 from Maarten anonymous.maarten@gmail.com --- Created attachment 50531 --> https://bugs.winehq.org/attachment.cgi?id=50531 Add basic_ofstream_char_open to the spec file of msvcp70.dll
I tried to add the missing specifications for the open function to the msvcp70 spec file.
This patch is probably wrong, as it causes another bug. See my next comment (and attachment).
https://bugs.winehq.org/show_bug.cgi?id=37908
--- Comment #2 from Maarten anonymous.maarten@gmail.com --- Created attachment 50532 --> https://bugs.winehq.org/attachment.cgi?id=50532 WINEDEBUG=msvcp wine glfont.exe >output.txt 2>&1
Running the glfont.exe program as: $ WINEDEBUG=msvcp wine glfont.exe and saving a glf file, gives the following console output:
(snip) trace:msvcp:ios_base_fail (0x32f6a0) trace:msvcp:basic_ostream_char_write (0x32f63c #0018 18) trace:msvcp:basic_ios_char_rdbuf_get (0x32f6a0)
(snip)
trace:msvcp:basic_streambuf_char__Pnavail (0x32f640) wine: Unhandled page fault on read access to 0x00000018 at address 0x7e03c2cd (thread 0009), starting debugger... (snip)
The basic_ostream_char_write program recevies an invalid str pointer (#0018).
Can someone look into this?
$ sha1sum glfont.exe 859274a0b69cc2068b6e7b32137e60a89d1b0dc4 glfont.exe $ du -h glfont.exe 20K glfont.exe $ wine --version wine-1.7.34-74-gcf92569
https://bugs.winehq.org/show_bug.cgi?id=37908
Qian Hong fracting@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |fracting@gmail.com
--- Comment #3 from Qian Hong fracting@gmail.com --- (In reply to Maarten from comment #2)
Created attachment 50532 [details] WINEDEBUG=msvcp wine glfont.exe >output.txt 2>&1
Hi Maarten, you are right that the patch is wrong. Note that the msvcp70 version of std::basic_ofstream<char,struct std::char_traits<char> >::open has only 2 arguments (in term of C++), while the msvcp90 version has 3 arguments (in term of C++). You can use http://demangler.com/ to demangle the symbols.
You might need to have a look at the msvcp60 version, which has only 2 arguments as well. Then you might need some #ifdef in dlls/msvcp90/ios.c . Finally you might want to write some test to confirm the implementation.
https://bugs.winehq.org/show_bug.cgi?id=37908
Qian Hong fracting@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |christopherwuy@gmail.com
https://bugs.winehq.org/show_bug.cgi?id=37908
Maarten anonymous.maarten@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Attachment #50531|0 |1 is obsolete| |
--- Comment #4 from Maarten anonymous.maarten@gmail.com --- Created attachment 50537 --> https://bugs.winehq.org/attachment.cgi?id=50537 v2: add basic_ofstream_char_open to the spec file of msvcp70.dll +tests
Thanks for the suggestions, Qian.
The patch included here, lets "glfont.exe" work.
I noticed the ios.c tests are lacking tests concerning writing to files. I also added a rudimentary tests.
I included <uninstd.h> in the ios-test. Is that ok? I used the access function to test for existence of the written file. I hardcoded F_OK to 0 since Windows does not have a define apparently.
Please review!
https://bugs.winehq.org/show_bug.cgi?id=37908
--- Comment #5 from Qian Hong fracting@gmail.com --- (In reply to Maarten from comment #4)
Created attachment 50537 [details] v2: add basic_ofstream_char_open to the spec file of msvcp70.dll +tests
Hi Maarten,
Please read http://wiki.winehq.org/SubmittingPatches and submitting patch to wine-patches, some one more experienced than me like Piotr Caban might comment on your patch. Thanks for the work.
https://bugs.winehq.org/show_bug.cgi?id=37908
--- Comment #6 from Qian Hong fracting@gmail.com --- Hi Maarten, could you send your patch to wine-patches?
Thanks!
https://bugs.winehq.org/show_bug.cgi?id=37908
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Component|-unknown |msvcp
https://bugs.winehq.org/show_bug.cgi?id=37908
Piotr Caban piotr.caban@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Fixed by SHA1| |b02934096d36a3c1e7f79fa7307 | |1b44e6bbb2c26 Status|UNCONFIRMED |RESOLVED CC| |piotr.caban@gmail.com Resolution|--- |FIXED
--- Comment #7 from Piotr Caban piotr.caban@gmail.com --- The function was implemented in wine almost a year ago. Marking as fixed.
https://bugs.winehq.org/show_bug.cgi?id=37908
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #8 from Alexandre Julliard julliard@winehq.org --- Closing bugs fixed in 1.9.2.