[Bug 57817] New: mvscp90 ::std::ifstream::seekg(0) crashes
https://bugs.winehq.org/show_bug.cgi?id=57817 Bug ID: 57817 Summary: mvscp90 ::std::ifstream::seekg(0) crashes Product: Wine Version: 10.1 Hardware: x86-64 OS: FreeBSD Status: NEW Keywords: source, testcase Severity: normal Priority: P2 Component: msvcp Assignee: wine-bugs(a)winehq.org Reporter: damjan.jov(a)gmail.com Wine can be crashed as easily as calling seekg(0) on an ::std::ifstream when linked with MSVCP90.DLL. Sample crash code, compile it so it uses MSVCP90.DLL and run with any "test.txt" in the current directory: ---snip--- #include <iostream> // std::cout #include <fstream> // std::ifstream int main (int argc, char **argv) { ::std::ifstream is ("test.txt", ::std::ifstream::binary); if (is) { // crashes: is.seekg(0); // doesn't crash: //is.seekg(0, ::std::ios::beg); return 0; } else return 1; } ---snip--- On Windows it works, and on Wine with native MSVCP90.DLL and MSVCRT90.DLL it works, but on Wine with builtin DLLs: 056c:Call msvcp90.?seekg@?$basic_istream(a)DU?$char_traits(a)D@std@@@std@@QAEAAV12(a)V?$fpos(a)H@2@@Z(0031fe38,00000000,0031fe38,000000000,00000000,00000001) ret=1b001086 056c:Call msvcr90.memcpy(0031fd68,00000000,00000018) ret=7a023138 056c:trace:seh:dispatch_exception code=c0000005 (EXCEPTION_ACCESS_VIOLATION) flags=0 addr=79F7F538 What's interesting is how calling is.seekg(0, ::std::ios::beg) instead works perfectly on Wine with builtin DLLs. -- 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=57817 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> --- Is Wine compiled with Clang by any chance? I didn't look on disassembly yet but it looks like Clang miscompiles basic_istream_char_seekg_fpos function (there seems to be something wrong with fpos_mbstatet parameter handling). -- 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=57817 Jacek Caban <jacek(a)codeweavers.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jacek(a)codeweavers.com -- 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=57817 --- Comment #2 from Damjan Jovanovic <damjan.jov(a)gmail.com> --- (In reply to Piotr Caban from comment #1)
Is Wine compiled with Clang by any chance?
Yes, my i386/PE Wine is built with Clang 18.1.8.
I didn't look on disassembly yet but it looks like Clang miscompiles basic_istream_char_seekg_fpos function (there seems to be something wrong with fpos_mbstatet parameter handling).
A compiler bug? Wow. -- 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=57817 --- Comment #3 from Piotr Caban <piotr.caban(a)gmail.com> --- (In reply to Damjan Jovanovic from comment #2)
A compiler bug? Wow.
It's a wine bug, see https://gitlab.winehq.org/wine/wine/-/merge_requests/7312 for more details. -- 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=57817 Damjan Jovanovic <damjan.jov(a)gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED Status|NEW |RESOLVED Fixed by SHA1| |c055c838fbfdbbc5f2db1c9b1a2 | |8a956f35f6423 --- Comment #4 from Damjan Jovanovic <damjan.jov(a)gmail.com> --- PR merged, my test applications now works, resolving FIXED. Thank you so much! -- 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=57817 Alexandre Julliard <julliard(a)winehq.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED --- Comment #5 from Alexandre Julliard <julliard(a)winehq.org> --- Closing bugs fixed in 10.2. -- 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