https://bugs.winehq.org/show_bug.cgi?id=55215
Bug ID: 55215 Summary: user32:text - test_DrawTextCalcRect() crashes on Windows Product: Wine Version: unspecified Hardware: x86-64 OS: Windows Status: NEW Severity: normal Priority: P2 Component: user32 Assignee: wine-bugs@winehq.org Reporter: fgouget@codeweavers.com
user32:text - test_DrawTextCalcRect() crashes on Windows:
text.c:537: this is the last test seen before the exception 0500:text: unhandled exception c0000005 at 77CF9F08
See https://test.winehq.org/data/patterns.html#user32:text
The crash most likely happens on this line due to the invalid LPRECT pointer: textheight = DrawTextExA((HDC)0xdeadbeef, emptystring, 100000, (LPRECT)0xdeadbeef, 0, 0);
Which was introduced by this commit:
commit 35c8f15bc67f7602438fe0c39a69ff6ddf6b8297 Author: Fabian Maurer dark.shadow4@web.de AuthorDate: Mon Jun 12 22:02:45 2023 +0200 Commit: Alexandre Julliard julliard@winehq.org CommitDate: Wed Jul 5 21:06:38 2023 +0200
user32: Ignore invalid parameters in DrawTextEx when HDC is invalid.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=47089 Signed-off-by: Fabian Maurer dark.shadow4@web.de
Note that this crash is specific to the official winetest.exe builds, probably due to some memory layout difference. Regardless it means the test is incorrect.
Also this crash was detected by the TestBot so MR!3049 should not have been merged. https://gitlab.winehq.org/wine/wine/-/merge_requests/3049
https://bugs.winehq.org/show_bug.cgi?id=55215
François Gouget fgouget@codeweavers.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |regression, source, | |testcase Regression SHA1| |35c8f15bc67f7602438fe0c39a6 | |9ff6ddf6b8297
https://bugs.winehq.org/show_bug.cgi?id=55215
--- Comment #1 from François Gouget fgouget@codeweavers.com --- Also this is specific to the 32-bit tests. Maybe the crash happens in Windows' 32 to 64-bit conversion layer.
https://bugs.winehq.org/show_bug.cgi?id=55215
Fabian Maurer dark.shadow4@web.de changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |dark.shadow4@web.de
--- Comment #2 from Fabian Maurer dark.shadow4@web.de --- Sorry for that, I submitted a MR: https://gitlab.winehq.org/wine/wine/-/merge_requests/3276
As the other test inside the if(0) shows, windows doesn't like an invalid string pointer on DrawTextA. It is to assume that it just overruns the stack variable, and it just used to work.
I rerun the user32_test.exe from wine-8.12 manually right now: https://testbot.winehq.org/JobDetails.pl?Key=134623
Since running user32_test worked, I assumed the test was okay. But then again, undefined behavior is undefined.
https://bugs.winehq.org/show_bug.cgi?id=55215
--- Comment #3 from Fabian Maurer dark.shadow4@web.de --- Can you please test if that fixes it? I'm not sure how to reproduce the crash.
https://bugs.winehq.org/show_bug.cgi?id=55215
--- Comment #4 from François Gouget fgouget@codeweavers.com --- Unfortunately, as far as I can tell, this only fails with the official test builds not my builds. So there is no alternative to waiting for the results from the official builds.
https://bugs.winehq.org/show_bug.cgi?id=55215
--- Comment #5 from Fabian Maurer dark.shadow4@web.de --- Will those run for a MR? Because it seems to have just run the normal user32_test, which doesn't help us here.
https://bugs.winehq.org/show_bug.cgi?id=55215
--- Comment #6 from Fabian Maurer dark.shadow4@web.de --- Should be fixed now. The latest run of tests where good, at least.
https://bugs.winehq.org/show_bug.cgi?id=55215
François Gouget fgouget@codeweavers.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Fixed by SHA1| |029bac07e9758b709648d3cbada | |c94b8508379a0 Status|NEW |RESOLVED Resolution|--- |FIXED
--- Comment #7 from François Gouget fgouget@codeweavers.com --- Yes, this got fixed by:
commit 029bac07e9758b709648d3cbadac94b8508379a0 Author: Fabian Maurer dark.shadow4@web.de Date: Sun Jul 9 21:27:36 2023 +0200
user32/tests: Remove DrawTextEx tests that overrun stack variable.
Fixes regression introduced by 35c8f15bc67f7602438fe0c39a69ff6ddf6b8297
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=55215
https://bugs.winehq.org/show_bug.cgi?id=55215
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #8 from Alexandre Julliard julliard@winehq.org --- Closing bugs fixed in 8.21.