[Bug 50845] New: jscript crashes on internal assert(0) in PE build with clang
https://bugs.winehq.org/show_bug.cgi?id=50845 Bug ID: 50845 Summary: jscript crashes on internal assert(0) in PE build with clang Product: Wine Version: 6.4 Hardware: x86-64 OS: Linux Status: NEW Severity: normal Priority: P2 Component: jscript Assignee: wine-bugs(a)winehq.org Reporter: dmitry(a)baikal.ru CC: jacek(a)codeweavers.com Distribution: --- Jacek, adding you to cc:, you might be interested. This doesn't happen in an ELF build. In order to reproduce build Wine in PE with clang, and run 'make test' in dlls/jscript/tests: Assertion failed: 0, file ../wine/dlls/jscript/jsutils.c, line 245 This the result of the call hres = jsdisp_define_data_property(ctx->global, L"NaN", const_flags, jsval_number(NAN)); https://source.winehq.org/git/wine.git/blob/HEAD:/dlls/jscript/global.c#l111... during initialization, no user provided script is even gets started being interpreted. It seems that the reason is difference in 'struct _jsval_t' layout https://source.winehq.org/git/wine.git/blob/HEAD:/dlls/jscript/jsval.h#l54 between gcc and clang. $ clang --version clang version 11.0.0 Target: x86_64-unknown-linux-gnu Thread model: posix InstalledDir: /usr/bin -- 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=50845 --- Comment #1 from Dmitry Timoshkov <dmitry(a)baikal.ru> --- The problem is caused by difference in the code, generated by clang and gcc for jsdisp_define_data_property() for storing the jsval_t value: clang generates fldl + fstpl while gcc uses ordinal movl instructions. That leads to the following (with additional debug output): clang: 0024:err:jscript:init_global NAN: v = 7ff00000ffffffff => tag 0x7ff00000, jsval_type() = 0x7ff80005 1: NaN: 7ff8000000000000 => tag 0x7ff80000, jsval_type() = 0x7ff80000 2: NaN: 7ff00000ffffffff => tag 0x7ff00000, jsval_type() = 0x7ff80005 0024:err:jscript:jsdisp_define_property L"NaN", v = 7ff80000ffffffff => tag 0x7ff80000, jsval_type() = 0x7ff80000 0024:err:jscript:jsval_copy v = 7ff80000ffffffff => tag 0x7ff80000, jsval_type() = 0x7ff80000 Assertion failed: 0, file ../wine.src/dlls/jscript/jsutils.c, line 247 gcc: 0024:err:jscript:init_global NAN: v = 7ff00000ffffffff => tag 0x7ff00000, jsval_type() = 0x7ff80005 1: NaN: 7ff8000000000000 => tag 0x7ff80000, jsval_type() = 0x7ff80000 2: NaN: 7ff00000ffffffff => tag 0x7ff00000, jsval_type() = 0x7ff80005 0024:err:jscript:jsdisp_define_property L"NaN", v = 7ff00000ffffffff => tag 0x7ff00000, jsval_type() = 0x7ff80005 0024:err:jscript:jsval_copy v = 7ff00000ffffffff => tag 0x7ff00000, jsval_type() = 0x7ff80005 Adding 'ULONGLONG ull;' to struct _jsval_t definition forces clang to use movl instead of fldl + fstpl like gcc does, and fixes the problem. I'll attach the diff here. Jacek, what do you think? Is that an acceptable solution? Is there a concern that there might be more places in Wine that suffer from the same problem? -- 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=50845 --- Comment #2 from Dmitry Timoshkov <dmitry(a)baikal.ru> --- Created attachment 69665 --> https://bugs.winehq.org/attachment.cgi?id=69665 tentative ifx -- 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=50845 Dmitry Timoshkov <dmitry(a)baikal.ru> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #69665|tentative ifx |tentative fix description| | -- 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=50845 winetest(a)luukku.com changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |winetest(a)luukku.com --- Comment #3 from winetest(a)luukku.com --- https://source.winehq.org/patches/data/203239 this was merged. -- 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=50845 Dmitry Timoshkov <dmitry(a)baikal.ru> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution|--- |FIXED Fixed by SHA1| |d9a4392d6bbd50b0a9690aa20fe | |7baa199f38d96 --- Comment #4 from Dmitry Timoshkov <dmitry(a)baikal.ru> --- Confirming fixed by d9a4392d6bbd50b0a9690aa20fe7baa199f38d96. Thanks Jacek. -- 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=50845 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 6.6. -- 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=50845 Michael Stefaniuc <mstefani(a)winehq.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|--- |6.0.x -- 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=50845 Michael Stefaniuc <mstefani(a)winehq.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|6.0.x |--- --- Comment #6 from Michael Stefaniuc <mstefani(a)winehq.org> --- Removing the 6.0.x milestone from bug fixes included in 6.0.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