wslg: GUI app exit with segmentfault in NVIDIA GPU driver
Version
Microsoft Windows [版本 10.0.22598.1]
WSL Version
- WSL 2
- WSL 1
Kernel Version
5.10.102.1
Distro Version
Debian 11
Other Software
默认分发: Debian 默认版本: 2 WSL 版本: 0.58.1.0 内核版本: 5.10.102.1 WSLg 版本: 1.0.33 MSRDC 版本: 1.2.2924 Direct3D 版本: 1.601.0 Windows 版本: 10.0.22598.1
Repro Steps
run wsl
from cmd.
run glxinfo -B
from wsl.
run qtcreator
from wsl.
Expected Behavior
glxinfo exits normally. And other GUI/qt app should work normally.
Actual Behavior
~$ glxinfo -B
name of display: :0
display: :0 screen: 0
direct rendering: Yes
Extended renderer info (GLX_MESA_query_renderer):
Vendor: Microsoft Corporation (0xffffffff)
Device: D3D12 (NVIDIA GeForce GTX 1650) (0xffffffff)
Version: 22.0.1
Accelerated: yes
Video memory: 20024MB
Unified memory: no
Preferred profile: core (0x1)
Max core profile version: 3.3
Max compat profile version: 3.3
Max GLES1 profile version: 1.1
Max GLES[23] profile version: 3.1
OpenGL vendor string: Microsoft Corporation
OpenGL renderer string: D3D12 (NVIDIA GeForce GTX 1650)
OpenGL core profile version string: 3.3 (Core Profile) Mesa 22.0.1 - kisak-mesa PPA
OpenGL core profile shading language version string: 3.30
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL version string: 3.3 (Compatibility Profile) Mesa 22.0.1 - kisak-mesa PPA
OpenGL shading language version string: 3.30
OpenGL context flags: (none)
OpenGL profile mask: compatibility profile
OpenGL ES profile version string: OpenGL ES 3.1 Mesa 22.0.1 - kisak-mesa PPA
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.10
Segmentation fault
run qtcreator
, close app, and get
~$ qtcreator
Segmentation fault
Diagnostic Logs
everything goes well before doing wsl --update
, and after windows update(Windows 11 Insider Preview 22598.1 (ni_release)
).
dmeg:
qtcreator[341]: segfault at 7f9e2c5e4000 ip 00007f9e18405aca sp 00007f9e264e5db0 error 4 in libnvwgf2umx.so[7f9e17aba000+1415000]
[ 235.082142] Code: 01 be 00 00 00 00 31 d2 45 31 f6 eb 1d 90 90 90 8b 45 10 48 8b 54 24 10 48 83 c2 01 89 c1 83 c6 01 48 39 ca 0f 83 56 01 00 00 <41> 8b 4c 95 00 0f b7 c9 3b 8c 95 44 04 00 00 74 dd 89 8c 95 44 04
[ 235.083786] potentially unexpected fatal signal 11.
[ 235.084190] CPU: 3 PID: 341 Comm: qtcreator Not tainted 5.10.102.1-microsoft-standard-WSL2 microsoft/WSL#1
[ 235.084897] RIP: 0033:0x7f9e18405aca
[ 235.085212] Code: 01 be 00 00 00 00 31 d2 45 31 f6 eb 1d 90 90 90 8b 45 10 48 8b 54 24 10 48 83 c2 01 89 c1 83 c6 01 48 39 ca 0f 83 56 01 00 00 <41> 8b 4c 95 00 0f b7 c9 3b 8c 95 44 04 00 00 74 dd 89 8c 95 44 04
[ 235.086602] RSP: 002b:00007f9e264e5db0 EFLAGS: 00010246
[ 235.087094] RAX: 000000000000000e RBX: 000000000135f000 RCX: 00000000013ca020
[ 235.087889] RDX: 0000000000000000 RSI: 0000000000000000 RDI: 000000000135f000
[ 235.088617] RBP: 00000000013c8be0 R08: 0000000000000000 R09: 00007ffe18a5c080
[ 235.089205] R10: 000000000000aea4 R11: 0000000000000000 R12: 00007f9e264e5e28
[ 235.089835] R13: 00007f9e2c5e4000 R14: 0000000000000000 R15: 00007f9e16ec2101
[ 235.090474] FS: 00007f9e264e6700 GS: 0000000000000000
[ 235.090978] dxgk:err: wait_for_complition failed: fffffe00
[ 235.091020] dxgk:err: wait_for_complition failed: fffffe00
[ 235.092278] dxgk:err: did not find packet to complete
About this issue
- Original URL
- State: open
- Created 2 years ago
- Reactions: 27
- Comments: 75
I have same issue, actually I got segfault when I exit any gui apps.
For what it is worth. Started having these segfaults at gl app exits (such as glxinfo) today after performing an ubuntu update. However, it only happens when selecting the Nvidia GPU. Setting either LIBGL_ALWAYS_SOFTWARE=1 or MESA_D3D12_DEFAULT_ADAPTER_NAME=Intel (my machine has an intel IGP + dedicated Quadro p1000) makes the apps exit without crash.
gdb also points to libnvwgf2umx.so causing the segfault for me.
Have tried updating the nvidia windows driver, but this does not seem to fix it.
WSL version: 1.0.3.0 Kernel version: 5.15.79.1 WSLg version: 1.0.47 MSRDC version: 1.2.3575 Direct3D version: 1.606.4 DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp Windows version: 10.0.19044.2486
Seems like segfault is back with latest wsl/wslg.
Same issue, no OpenGL required – just a simple display of an image using SDL2. On application exit there is the crash in the NVidia driver, at exactly the place shown in the
lldb
provided by @junaire.wsl --version
results:And error is literally:
I added some extra debugging to the program I was testing (just a quick&dirty bit to re-familiarize myself with SDL and get comfortable with SDL2 after a long period of doing a lot of systems work) and it reaches the final
return 0
ofmain()
(or thereabouts) and then crashes. This occurs after releasing everything that was allocated and making output about such.Note: I did add a breakpoint in
lldb
and single-step and it did not crash on that run, so this might be a timing issue where one of the threads tries a use-after-free, but… I have no clue, as I didn’t write any code for extra threads in the quick test program.You can update it with
wsl --update --pre-release
I can confirm that the crash appears to be gone for me, too, once WSL was updated to 1.3.11.
It is solved after
sudo chmod 666 /dev/dri/*
. I hope this helps. https://github.com/microsoft/WSL/issues/9523#issuecomment-1403671300Update: There is still the same error inside a Docker container in WSL2.
Update 2: Docker is working following this
https://github.com/microsoft/wslg/blob/main/samples/container/Containers.md
but with unofficial mesa drivers update. https://github.com/microsoft/WSL/issues/7507#issuecomment-950235017Have done a lot more digging and this looks to, actually, be coming up out of the event poll loop – quite literally the top call on that specific thread (apparently created just for event polling by LibSDL2 without me specifically doing it) is a call to the glibc
poll
function – see:So it looks like about 5 threads are started for handling various bits of DirectX interaction and in the one that interacts directly with the NVidia driver code we get the exception. I grabbed the above from a breakpoint (and thanks, MS, for the nice debugger integration in VSCode - first time I’ve used a GUI debugger that worked this well) and, well… that is what I’ve found. The other 4 extra threads (that do not interact with the actual
root
thread of the code) are all a lot of calls tolibpthread
and a single call tolibd3d12core.so
Basically… This looks more and more like a race condition or conflict – though I’ve been unable to replicate the “successful completion without exception after single-stepping” again.
Still present for me as well.
any progress here? I have the same problem.
Same issue
glxinfo and glxgears both run, but always end with segmentation fault. other graphics applications that require openGL fail to run altogether
i’m getting segfaults in
libnvwgf2umx.so
running Intellij IDEA.and
THREAD
details:yes, I can also confirm that both intel and nvidia working as expected, unlike previously tested[1]
[1] https://github.com/microsoft/wslg/issues/715#issuecomment-1937349068
I just applied the latest
apt upgrade
and the problem appears to be fixed now. Can anyone else confirm?Same versions as you.
Crashes with nvidia works with intel.
Two weeks. and no one is looking to this?
@andreear-23
@andreear-23 I’ve been using the latest driver release using
Geforce Experience
– thats it, entirely. Though I’m also, IIRC, using an older Ubuntu install as I’ve had it going since WSL2 first became available, so that might be it.Waiting on
wsl --update --pre-release
to finish right now (14:11 EST) after the last run saw no change and WSL still reporting itself as 1.2.5…… …
No crash on any test programs exit! Looks like this bug is truly fixed. Hurrah!
Here’s
glxinfo -B
:And
wsl --version
:No, you just need to install https://github.com/microsoft/WSL/releases/download/1.3.11/Microsoft.WSL_1.3.11.0_x64_ARM64.msixbundle
Apparently v1.3.10.0 fixed the segfault. I only tried
glxinfo -B
couple of times, and it ended successfully without segfault at the end. (off-topic: Though this version nukes systemd user sessions).Other who have extensive graphics tests ready might want to run them in v1.3.10.0
I also encountered this problem on IntelliJ IDEA right after enabling systemd. It never did for months when systemd wasn’t there.
I think I have encountered the same problem when using SDL2.
Test code:
Compile & run using
gcc test.c -lSDL2 -g && gdb a.out
gives to following result:And this works for me
wsl --version
:apt search libsdl | grep installed
:First, don’t worry about it because it seems like it didn’t actually solve it. You can create another fresh ubuntu 22.04 instance to check if wslg is really working there for your hardware.
Second, if the issue does really become solved using a newer mesa libraries, you can get those in ubuntu 20.04 too, from a ppa. Ex: https://launchpad.net/~kisak/+archive/ubuntu/kisak-mesa
Well, glxinfo looks good but what about glxgears? This is what happens to me.
This is fixed for me today with ubuntu-22.04 latest update,
glxinfo
no longer crashes.Same issue with IntelliJ crashes on my NVIDIA laptop. On my AMD desktop I don’t experience this.
WSL version: 0.64.0.0 Kernel version: 5.10.102.1 WSLg version: 1.0.40 MSRDC version: 1.2.3213 Direct3D version: 1.601.0 DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp Windows version: 10.0.22621.232
Anyone got any workarounds? I had to resort back to VcXsrv and disablw wslg 😦
I’ve made some upgrades recently:
Still crashing on exit in the very same way: