iXit / Mesa-3D

Please use official https://gitlab.freedesktop.org/mesa/mesa/ !
https://github.com/iXit/Mesa-3D/wiki
66 stars 13 forks source link

err:gdi:GDI_CheckNotLock BUG: holding GDI lock #102

Closed ChristophHaag closed 8 years ago

ChristophHaag commented 9 years ago

I believe this happens only with thread_submit=true, but I am not completely sure. It's very random when it happens, sometimes after a few minutes, sometimes after more than an hour.

I've got not much more information about it right now. I might get around gathering some debug output at some point in the future. Just putting it here so maybe others with the same issue can google it and maybe add more information.

I have seen this so far with: Skyrim: Freezes when it happens Heroes of the Storm: Crashes when it happens

00:02.0 VGA compatible controller: Intel Corporation 3rd Gen Core processor Graphics Controller (rev 09) 01:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Wimbledon XT [Radeon HD 7970M]

With mesa git, dri3 and prime.

okias commented 9 years ago

Can you retest with current git?

axeldavy commented 9 years ago

Same happens with Fallout New Vegas

siro20 commented 9 years ago

https://www.winehq.org/docs/winedev-guide/threading

axeldavy commented 9 years ago

The fix is to use wine functions to spawn the thread.

ChristophHaag commented 8 years ago

Huh, I just got it with the simple dx9_initialization.exe sample:

DRI_PRIME=1 wine dx9_initialization.exe
fixme:module:load_dll Loader redirect from L"d3d9.dll" to L"d3d9-nine.dll"
fixme:win:EnumDisplayDevicesW ((null),0,0x32f6b4,0x00000000), stub!
ATTENTION: default value of option thread_submit overridden by environment.
fixme:win:EnumDisplayDevicesW (L"\\\\.\\DISPLAY1",0,0x32f6b4,0x00000000), stub!
fixme:win:EnumDisplayDevicesW (L"\\\\.\\DISPLAY1",1,0x32f6b4,0x00000000), stub!
fixme:win:EnumDisplayDevicesW ((null),1,0x32f6b4,0x00000000), stub!
fixme:d3dadapter:d3dadapter9_new 
Native Direct3D 9 is active.
For more information visit https://wiki.ixit.cz/d3d9
fixme:win:EnumDisplayDevicesW (L"\\\\.\\DISPLAY1",0,0x32f654,0x00000000), stub!
fixme:d3dadapter:DRI3PresentGroup_GetMultiheadCount (0x1c7e40), stub!
fixme:d3dadapter:DRI3PresentGroup_GetMultiheadCount (0x1c7e40), stub!
err:gdi:GDI_CheckNotLock BUG: holding GDI lock
wine: Unhandled exception 0x80000003 in thread 9 at address 0x7b839c8d (thread 0009), starting debugger...
0x7b839c8d: int $3
Modules:
Module  Address                 Debug info      Name (84 modules)
PE        400000-  40d000       Export          dx9_initialization
ELF     78b3f000-7b800000       Deferred        libllvm-3.8svn.so
ELF     7b800000-7ba7a000       Dwarf           kernel32<elf>
  \-PE  7b810000-7ba7a000       \               kernel32
ELF     7bc00000-7bd12000       Deferred        ntdll<elf>
  \-PE  7bc10000-7bd12000       \               ntdll
ELF     7bf00000-7bf04000       Deferred        <wine-loader>
ELF     7d425000-7d42b000       Deferred        libtxc_dxtn.so
ELF     7d42b000-7d444000       Deferred        libresolv.so.2
ELF     7d444000-7d465000       Deferred        libudev.so.1
ELF     7d465000-7d47f000       Deferred        libgcc_s.so.1
ELF     7d5f6000-7da1d000       Deferred        d3dadapter9.so.1
ELF     7dba5000-7dbe5000       Deferred        libnettle.so.6
ELF     7dc64000-7dc6f000       Deferred        libxcursor.so.1
ELF     7dc6f000-7dc82000       Deferred        libxi.so.6
ELF     7dc83000-7dc89000       Deferred        libattr.so.1
ELF     7dc89000-7dc8e000       Deferred        libcap.so.2
ELF     7dc8e000-7dca8000       Deferred        libelf.so.1
ELF     7dca8000-7dcb2000       Deferred        libdrm_amdgpu.so.1
ELF     7dcb2000-7dcc1000       Deferred        libdrm_radeon.so.1
ELF     7dd01000-7ddab000       Deferred        winex11<elf>
  \-PE  7dd10000-7ddab000       \               winex11
ELF     7ddab000-7ddd0000       Deferred        imm32<elf>
  \-PE  7ddb0000-7ddd0000       \               imm32
ELF     7e061000-7e09d000       Deferred        libfontconfig.so.1
ELF     7e09d000-7e112000       Deferred        libpcre.so.1
ELF     7e112000-7e238000       Deferred        libglib-2.0.so.0
ELF     7e238000-7e2a0000       Deferred        libharfbuzz.so.0
ELF     7e2a0000-7e2dd000       Deferred        libpng16.so.16
ELF     7e2dd000-7e3a0000       Deferred        libfreetype.so.6
ELF     7e3a0000-7e40e000       Deferred        libncursesw.so.6
ELF     7e40e000-7e412000       Deferred        libxcomposite.so.1
ELF     7e412000-7e41f000       Deferred        libxrandr.so.2
ELF     7e48d000-7e60c000       Dwarf           user32<elf>
  \-PE  7e4a0000-7e60c000       \               user32
ELF     7e60c000-7e74d000       Dwarf           gdi32<elf>
  \-PE  7e620000-7e74d000       \               gdi32
ELF     7e74d000-7e7d1000       Deferred        advapi32<elf>
  \-PE  7e760000-7e7d1000       \               advapi32
ELF     7e7d1000-7e7da000       Deferred        librt.so.1
ELF     7e7da000-7e7e3000       Deferred        libffi.so.6
ELF     7e7e3000-7e7f4000       Deferred        libwayland-server.so.0
ELF     7e7f4000-7e801000       Deferred        libwayland-client.so.0
ELF     7e801000-7e811000       Deferred        libgbm.so.1
ELF     7e811000-7e822000       Deferred        libdrm.so.2
ELF     7e822000-7e829000       Deferred        libxxf86vm.so.1
ELF     7e829000-7e82f000       Deferred        libxcb-dri2.so.0
ELF     7e82f000-7e84a000       Deferred        libxcb-glx.so.0
ELF     7e84a000-7e850000       Deferred        libxfixes.so.3
ELF     7e850000-7e854000       Deferred        libxdamage.so.1
ELF     7e854000-7e8a2000       Deferred        libglapi.so.0
ELF     7e8a2000-7e8aa000       Deferred        libxcb-sync.so.1
ELF     7e8aa000-7e8af000       Deferred        libxcb-shape.so.0
ELF     7e8af000-7e8bf000       Deferred        libxcb-randr.so.0
ELF     7e8bf000-7e8e8000       Deferred        libexpat.so.1
ELF     7e8e8000-7e91b000       Deferred        libegl.so.1
ELF     7e91b000-7e9de000       Deferred        libgl.so.1
ELF     7e9de000-7eb2d000       Deferred        libx11.so.6
ELF     7eb2d000-7eb39000       Deferred        libxrender.so.1
ELF     7eb39000-7eb3d000       Deferred        libxinerama.so.1
ELF     7eb68000-7eb79000       Deferred        libbz2.so.1.0
ELF     7eb79000-7eb90000       Deferred        libz.so.1
ELF     7eb90000-7ebac000       Deferred        version<elf>
  \-PE  7eba0000-7ebac000       \               version
ELF     7ef21000-7ef34000       Deferred        libnss_files.so.2
ELF     7ef34000-7ef81000       Deferred        libm.so.6
ELF     7ef81000-7ef84000       Deferred        libxshmfence.so.1
ELF     7ef84000-7ef8f000       Deferred        libxcb-render.so.0
ELF     7ef8f000-7ef96000       Deferred        libxdmcp.so.6
ELF     7ef96000-7efab000       Deferred        libxext.so.6
ELF     7efab000-7efb4000       Deferred        libxcb-xfixes.so.0
ELF     7efb4000-7efdb000       Deferred        libxcb.so.1
ELF     7efdb000-7f000000       Deferred        d3d9-nine<elf>
  \-PE  7efe0000-7efe4000       \               d3d9
ELF     f7343000-f7348000       Deferred        libdl.so.2
ELF     f7348000-f734c000       Deferred        libxau.so.6
ELF     f734c000-f7350000       Deferred        libxcb-present.so.0
ELF     f73c0000-f73c3000       Deferred        libx11-xcb.so.1
ELF     f73c3000-f73c7000       Deferred        libxcb-dri3.so.0
ELF     f73c7000-f7581000       Deferred        libc.so.6
ELF     f7581000-f759f000       Deferred        libpthread.so.0
ELF     f759f000-f7759000       Dwarf           libwine.so.1
ELF     f775a000-f777e000       Deferred        ld-linux.so.2
ELF     f7780000-f7781000       Deferred        [vdso].so
Threads:
process  tid      prio (all id:s are in hex)
00000008 (D) Z:\home\chris\build\dx9_initialization\dx9_initialization.exe
        00000009    0 <==
0000000e services.exe
        0000001e    0
        0000001d    0
        00000014    0
        00000010    0
        0000000f    0
00000012 winedevice.exe
        0000001c    0
        00000019    0
        00000018    0
        00000013    0
0000001a plugplay.exe
        00000020    0
        0000001f    0
        0000001b    0
00000021 explorer.exe
        00000026    0
        00000025    0
        00000024    0
        00000023    0
        00000022    0
System information:
    Wine build: wine-1.8-46-g7a2d815
    Platform: i386
    Version: Windows XP
    Host system: Linux
    Host version: 4.3.3-1-zen
ghost commented 8 years ago

Continues to crash on wine 1.9.7 from the Ubuntu PPA.

axeldavy commented 8 years ago

This is a bug we fixed several months ago. the ppa probably doesn't have the fix yet.

As of upstream, the bug is fixed, so closing.

sarnex commented 8 years ago

My PPA was updated a few weeks ago with latest ixit/wine patch. What Ubuntu version?

ChristophHaag commented 8 years ago

Fixed in wine or in nine?

I'm using wine staging with nine patch 1.9.8 from here: https://github.com/mradermaxlol/pontostroy-wine/ and mesa git with nine/master merged.

Played a couple of minutes of skyrim and it still freezes with

err:gdi:GDI_CheckNotLock BUG: holding GDI lock
siro20 commented 8 years ago

It's fixed in mesa and wine. Please note that you need to compile and install mesa first to get latest headers. After that make a clean wine build to use the new headers. You have to use presentation interface 1.2 to get rid of this bug. Please note that the interface is backward compatible and doesn't output any info, warning or error (yet). If you are on presentation interface 1.2 and using thread_submit=true and still have this bug, please open another bug report with as much as information as possible. I've tested thread_submit=true and all applications works for hours without throwing "err:gdi:GDI_CheckNotLock BUG: holding GDI lock".

ChristophHaag commented 8 years ago

Thanks for the explanation. Looks like this repo doesn't have an updated version of nine: https://github.com/mradermaxlol/pontostroy-wine/blob/3baebbd89f850f160db3b4ed56f6c616d6c385ba/dlls/d3d9-nine/present.c#L45-L50

mradermaxlol commented 8 years ago

@ChristophHaag it's strange, as the patchset @pontostroy is applying tends to be fresh. I'll try to contact him and tell about the thing.

ChristophHaag commented 8 years ago

I have googled a bit, but it doesn't look like anyone has updated the nine patch for wine-staging since https://bugs.wine-staging.com/show_bug.cgi?id=40#c40.

The problem is that the changes from ixit/wine only cleanly apply to wine master, but not to wine-staging, so someone always had to manually update what they had there to integrate it into wine-staging.

I'm using upstream wine git + nine now and it works fine. Still, having it updated in wine-staging would be nice.

sarnex commented 8 years ago

@ChristophHaag I run a repo with those patches that's used for the gentoo wine ebuild. Apply all of staging, then staging-helper and d3d9.patch from https://github.com/sarnex/wine-d3d9-patches

mradermaxlol commented 8 years ago

@ChristofHang could you then try to build vanilla + Nine and report?

mradermaxlol commented 8 years ago

@sarnex hmm, that looks like a possible solution. Basically, all those patches gotta be applied upon Wine-staging source, right? If yes, I'll update the source and support it with your patches included.

ChristophHaag commented 8 years ago

@mradermaxlol With "works fine" I wanted to say that I do not encounter this issue with vanilla wine + nine.

@sarnex Thanks a lot! Maybe you could add a short description so people can find it with google.

So I guess d3d9-helper.patch is for patching vanilla wine and staging-helper.patch is for patching wine-staging and wine-d3d9.patch is for both? For some reason these patches only apply with patch, giit apply says at least one of them is corrupted and applying fails..? Well...

Here's a modified the wine-gaming-nine PKGBUILD that builds and seems to run fine with nine: https://gist.github.com/ChristophHaag/7b44c64cfd3b6ae420635c97516a783e

sarnex commented 8 years ago

@mradermaxlol yes all staging patches must be already applied. see readme for details @ChristophHaag no problem, i've added a description and readme. d3d9-helper is for vanilla wine, staging-helper is for wine staging. wine-d3d9 applies on both after the corresponding helper has been applied

For maintainers, this repo is tagged so they can be used with releases. I update after staging releases.

mradermaxlol commented 8 years ago

@ChristophHaag I've made a repo which is likely using good source from @sarnex - it's here. I've also made a note to inform pontostroy's source users.

ghost commented 8 years ago

@sarnex: Ubuntu 16.04 (Xenial Xerus). I have not been able to reproduce it in the last week after updating.

sarnex commented 8 years ago

Ok, cool. Maybe I made a mistake with the PPA that's fixed now.