[Bug 59329] New: Erratic behavior of std::rethrow_exception() with DLL runtime
http://bugs.winehq.org/show_bug.cgi?id=59329 Bug ID: 59329 Summary: Erratic behavior of std::rethrow_exception() with DLL runtime Product: Wine Version: 11.1 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: major Priority: P2 Component: ucrtbase Assignee: wine-bugs@list.winehq.org Reporter: p@perkele.cc Distribution: --- Created attachment 80262 --> http://bugs.winehq.org/attachment.cgi?id=80262 Minimal repro code I have observed various erratic behaviors after use of std::rethrow_exception() in my programs - either crashing or incorrect exception caught. Using DLL or static runtime seems to be a factor - using static runtime instead results in correct behavior for me. Compile and run attached program to test - verified with all Visual Studio versions from 2017 up. Live repro using mainstream software: Install any recent version of foobar2000, switch audio output to any of [exclusive] options, try playing anything - should say "Exclusive mode not allowed", says "Unknown exception" instead. Confirmed on: Fedora 43 / x86_64 / Wine 11.1 macOS 26.2 / ARM host running emulated x86_64 code / Wine 11.0 -- 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.
http://bugs.winehq.org/show_bug.cgi?id=59329 --- Comment #1 from Piotr Pawłowski <p@perkele.cc> --- Created attachment 80263 --> http://bugs.winehq.org/attachment.cgi?id=80263 Minimal repro exe -- 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.
http://bugs.winehq.org/show_bug.cgi?id=59329 --- Comment #2 from Piotr Pawłowski <p@perkele.cc> --- Forcibly loading Microsoft msvcp140.dll seems to fix it: WINEDLLOVERRIDES="MSVCP140=n" wine ThrowTest.exe (place relevant DLL alongside exe) -- 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.
http://bugs.winehq.org/show_bug.cgi?id=59329 Zeb Figura <z.figura12@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |download, source, testcase Severity|major |normal Component|ucrtbase |msvcp -- 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.
http://bugs.winehq.org/show_bug.cgi?id=59329 regis <paregistrase@yahoo.es> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |paregistrase@yahoo.es -- 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.
http://bugs.winehq.org/show_bug.cgi?id=59329 --- Comment #3 from Piotr Pawłowski <p@perkele.cc> --- In sample program, moving std::exception_ptr variable OUT of the scope makes bad behavior go away, when the std::exception_ptr outlives all access to the exception object. So std::exception_ptr destructor is prematurely destroying the exception and catch() is use-after-free. -- 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.
http://bugs.winehq.org/show_bug.cgi?id=59329 Piotr Pawłowski <p@perkele.cc> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|Erratic behavior of |C++ catch() use-after-free |std::rethrow_exception() |with |with DLL runtime |std::rethrow_exception() -- 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.
http://bugs.winehq.org/show_bug.cgi?id=59329 Piotr Pawłowski <p@perkele.cc> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #80262|0 |1 is obsolete| | Attachment #80263|0 |1 is obsolete| | --- Comment #4 from Piotr Pawłowski <p@perkele.cc> --- Created attachment 80315 --> http://bugs.winehq.org/attachment.cgi?id=80315 Improved repro Improved repro code attached. Removed std::cout use for nicer msvcp logs. Made log exception constructor & destructor calls. Detailed logs (Windows vs Wine) coming up. -- 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.
http://bugs.winehq.org/show_bug.cgi?id=59329 --- Comment #5 from Piotr Pawłowski <p@perkele.cc> --- Created attachment 80316 --> http://bugs.winehq.org/attachment.cgi?id=80316 Log: Wine -- 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.
http://bugs.winehq.org/show_bug.cgi?id=59329 --- Comment #6 from Piotr Pawłowski <p@perkele.cc> --- Created attachment 80317 --> http://bugs.winehq.org/attachment.cgi?id=80317 Log: Wine, detailed -- 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.
http://bugs.winehq.org/show_bug.cgi?id=59329 --- Comment #7 from Piotr Pawłowski <p@perkele.cc> --- Created attachment 80318 --> http://bugs.winehq.org/attachment.cgi?id=80318 Log: Windows -- 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.
http://bugs.winehq.org/show_bug.cgi?id=59329 --- Comment #8 from Piotr Pawłowski <p@perkele.cc> --- MR: https://gitlab.winehq.org/wine/wine/-/merge_requests/10068 -- 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.
http://bugs.winehq.org/show_bug.cgi?id=59329 Piotr Pawłowski <p@perkele.cc> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED Status|UNCONFIRMED |RESOLVED --- Comment #9 from Piotr Pawłowski <p@perkele.cc> --- Fixed in 11.3 -- 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.
http://bugs.winehq.org/show_bug.cgi?id=59329 Nikolay Sivov <bunglehead@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Fixed by SHA1| |4ff9bb5bd38ed5d3692e5c9ee63 | |022f5b2ea65dc -- 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