microsoft / wslg

Enabling the Windows Subsystem for Linux to include support for Wayland and X server related scenarios
MIT License
9.9k stars 296 forks source link

Segmentation Fault in /usr/lib/wsl/lib/libd3d12core.so #1229

Open MaxCrazy1101 opened 2 months ago

MaxCrazy1101 commented 2 months ago

Windows build number:

Microsoft Windows [Version 10.0.22631.3447]

Your Distribution version:

22.04

Your WSL versions:

WSL 版本: 2.1.5.0 内核版本: 5.15.146.1-2 WSLg 版本: 1.0.60 MSRDC 版本: 1.2.5105 Direct3D 版本: 1.611.1-81528511 DXCore 版本: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp Windows 版本: 10.0.22631.3447

Steps to reproduce:

https://github.com/stevenlovegrove/Pangolin/issues/908 WslLogs-2024-04-13_20-23-00.zip

WSL logs:

Segmentation Fault

WSL dumps:

cs@XDUPC:~/3rd_lib/x11_egl/build/examples/HelloPangolin$ gdb ./HelloPangolin /mnt/wslg/dumps/core.HelloPangolin.1328
GNU gdb (Ubuntu 12.1-0ubuntu1~22.04) 12.1
Copyright (C) 2022 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./HelloPangolin...

warning: Can't open file /dev/zero (deleted) during file-backed mapping note processing

warning: Can't open file /memfd:mesa-shared (deleted) during file-backed mapping note processing

warning: Can't open file /memfd:wayland-cursor (deleted) during file-backed mapping note processing
[New LWP 1328]
[New LWP 1331]
[New LWP 1342]
[New LWP 1335]
[New LWP 1337]
[New LWP 1336]
[New LWP 1334]
[New LWP 1341]
[New LWP 1344]
[New LWP 1348]
[New LWP 1347]
[New LWP 1349]
[New LWP 1346]
[New LWP 1333]
[New LWP 1338]
[New LWP 1345]
[New LWP 1343]
[New LWP 1339]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
--Type <RET> for more, q to quit, c to continue without paging--c
Core was generated by `./HelloPangolin'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x00007f1d91c46b4c in ?? () from /usr/lib/wsl/lib/libd3d12core.so
[Current thread is 1 (Thread 0x7f1d9d307c80 (LWP 1328))]
(gdb) bt
#0  0x00007f1d91c46b4c in ?? () from /usr/lib/wsl/lib/libd3d12core.so
#1  0x00007f1d91c46eb5 in ?? () from /usr/lib/wsl/lib/libd3d12core.so
#2  0x00007f1d91c471df in ?? () from /usr/lib/wsl/lib/libd3d12core.so
#3  0x00007f1d9bcc403a in ?? () from /usr/lib/x86_64-linux-gnu/dri/swrast_dri.so
#4  0x00007f1d9bcee383 in ?? () from /usr/lib/x86_64-linux-gnu/dri/swrast_dri.so
#5  0x00007f1d9bcac92d in ?? () from /usr/lib/x86_64-linux-gnu/dri/swrast_dri.so
#6  0x00007f1d9bcc793d in ?? () from /usr/lib/x86_64-linux-gnu/dri/swrast_dri.so
#7  0x00007f1d9bc9db4e in ?? () from /usr/lib/x86_64-linux-gnu/dri/swrast_dri.so
#8  0x00007f1d9b1a6b5e in ?? () from /usr/lib/x86_64-linux-gnu/dri/swrast_dri.so
#9  0x00007f1d9d2c48cf in ?? () from /lib/x86_64-linux-gnu/libEGL_mesa.so.0
#10 0x00007f1d9d2bbdf5 in ?? () from /lib/x86_64-linux-gnu/libEGL_mesa.so.0
#11 0x00007f1d9d2afaf5 in ?? () from /lib/x86_64-linux-gnu/libEGL_mesa.so.0
#12 0x00007f1d9dc69ba6 in pangolin::wayland::DecorationSurface::draw (this=0x5595dd815290)
    at /home/cs/3rd_lib/x11_egl/components/pango_windowing/src/display_wayland.cpp:224
#13 0x00007f1d9dc6a4b1 in pangolin::wayland::Decoration::draw (this=0x5595dd918f70)
    at /home/cs/3rd_lib/x11_egl/components/pango_windowing/src/display_wayland.cpp:291
#14 0x00007f1d9dc660e6 in pangolin::wayland::WaylandWindow::SwapBuffers (this=0x5595dda8ed40)
    at /home/cs/3rd_lib/x11_egl/components/pango_windowing/src/display_wayland.cpp:1020
#15 0x00007f1d9e5252c2 in pangolin::PangolinGl::FinishFrame (this=0x5595dd57c800)
    at /home/cs/3rd_lib/x11_egl/components/pango_display/src/pangolin_gl.cpp:74
#16 0x00007f1d9e4ed745 in pangolin::FinishFrame ()
    at /home/cs/3rd_lib/x11_egl/components/pango_display/src/display.cpp:257
#17 0x00005595dc466889 in main () at /home/cs/3rd_lib/x11_egl/examples/HelloPangolin/main.cpp:33
(gdb)

Expected behavior:

No response

Actual behavior:

when i use WAYLAND_DISPLAY=0 It works but if i quit the program, Segmentation Fault also shows. It did't fault in /usr/lib/wsl/lib/libd3d12core.so

WSL2 is not a supported scenario and it looks like the issue is in /usr/lib/wsl/lib/libd3d12core.so. You better report the issue to the wslg project.

without WAYLAND_DISPLAY=0 the example will fault in /usr/lib/wsl/lib/libd3d12core.so and didn't work properly