https://bugs.winehq.org/show_bug.cgi?id=53017
Bug ID: 53017 Summary: user32:monitor killed by X Error on Debian 11 + Intel GPU Product: Wine Version: unspecified Hardware: x86-64 OS: Linux Status: NEW Severity: normal Priority: P2 Component: user32 Assignee: wine-bugs@winehq.org Reporter: fgouget@codeweavers.com Distribution: ---
user32:monitor gets killed by an X Error while running test_ChangeDisplaySettingsEx() on my Debian 11 + Intel GPU machine (see fg-deb64-*). This results in this type of failure:
monitor.c:61: GetProcAddress(user32, DisplayConfigSetDeviceInfo) failed. user32:monitor:0834 done (0) in 0s The main process has no test summary line
The lack of a summary line is what indicates that the process was summarily killed, typically by a Unix library call.
Looking into some more details it is this call which causes the X Error:
res = ChangeDisplaySettingsExA(devices[device].name, &dm3, NULL, CDS_RESET, NULL);
And adding traces in winex11.drv shows more precisely that the crash happens because bad physical size values are passed to XRRSetScreenSize():
dmFields=BITSPERPEL,PELSWIDTH,PELSHEIGHT,DISPLAYFLAGS,DISPLAYFREQUENCY,DISPLAYORIENTATION dmBitsPerPel=8 dmPelsWidth=720 dmPelsHeight=400 dmDisplayFrequency=70 dmDisplayFlags=0 dmDisplayOrientation=0 0024:trace:x11settings:apply_display_settings handler:XRandR 1.4 changing L"\\.\DISPLAY1" to position:(0,0) resolution:720x400 frequency:70Hz depth:8bits orientation:0. 0024:warn:xrandr:xrandr14_set_current_mode Cannot change screen color depth from 32bits to 8bits! 0024:trace:xrandr:set_screen_size mm_width=0 = 720 * 1 / 3840 0024:trace:xrandr:set_screen_size mm_height=0 = 400 * 2 / 2160 0024:trace:xrandr:xrandr14_set_current_mode 1638 X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 7 (RRSetScreenSize) Value in failed request: 0x0 Serial number of failed request: 209 Current serial number in output stream: 210
So there are two questions: * Should set_screen_size() have defensive code that prevents using 0 as the physical sizes? Using 1 instead seems to avoid the crashes. * Why do DisplayWidthMM() and DisplayHeightMM() return bad values? Weirder, I just got a bunch of runs with correct Display*MM() values and now that I removed traces it's bad again. Memory corruption?
Note that xrandr knows the right physical dimensions for my screen:
$ xrandr Screen 0: minimum 320 x 200, current 3840 x 2160, maximum 16384 x 16384 VGA-1 disconnected (normal left inverted right x axis y axis) HDMI-1 disconnected (normal left inverted right x axis y axis) DP-1 connected primary 3840x2160+0+0 (normal left inverted right x axis y axis) 698mm x 393mm 3840x2160 60.00*+ 30.00 25.00 24.00 29.97 23.98 29.98 2560x1600 59.94 2560x1440 59.95 1920x1080 60.00 60.00 50.00 59.94 30.00 25.00 24.00 29.97 23.98 1920x1080i 60.00 50.00 59.94 1680x1050 59.95 1600x900 60.00 1280x1024 75.02 60.02 1280x800 59.81 1152x864 75.00 1280x720 60.00 50.00 59.94 1024x768 75.03 60.00 832x624 74.55 800x600 75.00 60.32 720x576 50.00 720x480 60.00 59.94 640x480 75.00 60.00 59.94 720x400 70.08 HDMI-2 disconnected (normal left inverted right x axis y axis) HDMI-3 disconnected (normal left inverted right x axis y axis)
https://bugs.winehq.org/show_bug.cgi?id=53017
François Gouget fgouget@codeweavers.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |source, testcase
https://bugs.winehq.org/show_bug.cgi?id=53017
--- Comment #1 from François Gouget fgouget@codeweavers.com --- Running user32:monitor with WINEDEBUG=+heap I do get a pretty suspicious looking error, right after the ChangeDisplaySettingsExA(...dm3...) call:
0138:err:heap:validate_free_block heap 00130000, block 00133A40: free block overwritten
This error also goes away if I skip the test_ChangeDisplaySettingsEx() call.
https://bugs.winehq.org/show_bug.cgi?id=53017
François Gouget fgouget@codeweavers.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |zzhang@codeweavers.com
https://bugs.winehq.org/show_bug.cgi?id=53017
--- Comment #2 from Zhiyi Zhang zzhang@codeweavers.com --- Thanks. I will take a look.
https://bugs.winehq.org/show_bug.cgi?id=53017
--- Comment #3 from Zhiyi Zhang zzhang@codeweavers.com --- The validate_free_block error seems unrelated. It's from 279a6b1e4848a747cb272791df55c301b3c5c4d3 is the first bad commit commit 279a6b1e4848a747cb272791df55c301b3c5c4d3 Author: Rémi Bernon rbernon@codeweavers.com Date: Tue May 3 19:43:12 2022 +0200
ntdll: Simplify validate_free_block.
Signed-off-by: Rémi Bernon rbernon@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
dlls/ntdll/heap.c | 162 +++++++++++++++++------------------------------------- 1 file changed, 51 insertions(+), 111 deletions(-)
With this commit, even wine notepad will generate a bunch of errors. Maybe recent heap patches also affected monitor tests.
François, Could you try with older Wine and see if you can get the same X error? Unfortunately, I can't reproduce this issue on my AMD machine and I don't have a Intel GPU. Could you add FIXME("%d %d %d %d %d %d %d %d\n", width, height, mm_width, mm_height, DisplayWidthMM( gdi_display, screen ), DisplayHeightMM( gdi_display, screen ), DisplayWidth( gdi_display, screen ), DisplayHeight( gdi_display, screen )); before the pXRRSetScreenSize() call and see if there is anything unusual? For example, The return value of DisplayWidthMM() keeps becoming smaller.
https://bugs.winehq.org/show_bug.cgi?id=53017
Zhiyi Zhang zzhang@codeweavers.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |rbernon@codeweavers.com
https://bugs.winehq.org/show_bug.cgi?id=53017
--- Comment #4 from Rémi Bernon rbernon@codeweavers.com --- Yeah that's a false positive, looks like I broke free checking. I'll send a patch to fix it today.
https://bugs.winehq.org/show_bug.cgi?id=53017
François Gouget fgouget@codeweavers.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Assignee|wine-bugs@winehq.org |fgouget@codeweavers.com