Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WSL2 randomly crashes #7368

Closed
1 of 2 tasks
stralytic opened this issue Aug 30, 2021 · 45 comments
Closed
1 of 2 tasks

WSL2 randomly crashes #7368

stralytic opened this issue Aug 30, 2021 · 45 comments
Assignees

Comments

@stralytic
Copy link

Windows Build Number

Microsoft Windows [Version 10.0.22000.168]

WSL Version

  • WSL 2
  • WSL 1

Kernel Version

5.10.43

Distro Version

Ubuntu 20.04

Other Software

Docker Desktop 3.6.0 (67351)
Google Chrome Linux 92.0.4515.159

Repro Steps

Start up docker app, navigate to it from Chrome (under WSLg).

Intermittently crashes, max uptime has been 30 minutes. Entire WSL2 stack crashes. Enabling dev tools in google chrome seems to be something that will trigger the crash, although it doesn't always.

Sometimes wsl --shutdown is required to get wsl working again, sometimes it isn't.

It also seems the longer the Windows OS uptime, the more quickly the crashes occur.

Expected Behavior

Don't crash

Actual Behavior

Ubuntu terminals output this when they die:
[process exited with code 1]

Diagnostic Logs

Hyper-V worker log has the following error:

'Virtual Machine' has encountered a fatal error. The guest operating system reported that it failed with the following error codes: ErrorCode0: 0x0, ErrorCode1: 0x0, ErrorCode2: 0x0, ErrorCode3: 0x0, ErrorCode4: 0x0. PreOSId: 0. If the problem persists, contact Product Support for the guest operating system. (Virtual machine ID 60865D75-4172-41AC-875A-A0AF9BBFBC11)

Guest message:
[ 4603.261479] R10: 0000000000000000 R11: ffffffffffd71709 R12: ffffc9000030a028
[ 4603.261480] R13: 0000000000000005 R14: ffffc90012d7b000 R15: 0000000000002000
[ 4603.261482] FS: 00007f3e371ea4c0(0000) GS:ffff8887e4c40000(0000) knlGS:0000000000000000
[ 4603.261485] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 4603.261486] CR2: ffffc90ffa3a5004 CR3: 0000000201468000 CR4: 0000000000350ea0
[ 4603.261488] Call Trace:
[ 4603.261491] hmgrtable_assign_handle+0xf3/0x100
[ 4603.261493] create_local_allocations+0x3e3/0x5a0
[ 4603.261495] dxgvmb_send_create_allocation+0x391/0x3f0
[ 4603.261498] dxgk_create_allocation+0x6e3/0xcb0
[ 4603.261500] dxgk_unlocked_ioctl+0x11/0x20
[ 4603.261503] __x64_sys_ioctl+0x83/0xb0
[ 4603.261564] do_syscall_64+0x33/0x80
[ 4603.261664] entry_SYSCALL_64_after_hwframe+0x44/0xa9
[ 4603.261683] RIP: 0033:0x7f3e3849b50b
[ 4603.261686] Code: 0f 1e fa 48 8b 05 85 39 0d 00 64 c7 00 26 00 00 00 48 c7 c0 ff ff ff ff c3 66 0f 1f 44 00 00 f3 0f 1e fa b8 10 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d 55 39 0d 00 f7 d8 64 89 01 48
[ 4603.261689] RSP: 002b:00007ffcd8644768 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
[ 4603.261691] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f3e3849b50b
[ 4603.261693] RDX: 00007ffcd8644790 RSI: 00000000c0484706 RDI: 0000000000000015
[ 4603.261694] RBP: 0000000000000001 R08: 0000000000000000 R09: 0000000000000001
[ 4603.261695] R10: 0000000000008011 R11: 0000000000000246 R12: 0000152805d3c780
[ 4603.261697] R13: 0000000000000030 R14: 00007ffcd86448d0 R15: 0000152800844060
[ 4603.261699] Modules linked in:
[ 4603.261728] CR2: ffffc90ffa3a5004
[ 4603.261731] ---[ end trace 656245e8de58d82a ]---
[ 4603.261745] RIP: 0010:expand_table+0x20/0x190
[ 4603.261747] Code: 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 41 55 41 54 49 89 fc 55 53 8b 57 1c 85 d2 74 18 8b 47 14 48 c1 e0 04 48 03 47 08 <81> 78 04 00 00 00 ff 0f 85 22 5f 33 00 41 8b 44 24 18 bd 00 04 00
[ 4603.261749] RSP: 0018:ffffc90005e47ba8 EFLAGS: 00010286
[ 4603.261751] RAX: ffffc90ffa3a5000 RBX: ffffc9000030a028 RCX: 0000000040070000
[ 4603.261752] RDX: 00000000fffffede RSI: 0000000000002000 RDI: ffffc9000030a028
[ 4603.261753] RBP: 0000000000001c00 R08: 0000000000000000 R09: 0000000000000001
[ 4603.261755] R10: 0000000000000000 R11: ffffffffffd71709 R12: ffffc9000030a028
[ 4603.261756] R13: 0000000000000005 R14: ffffc90012d7b000 R15: 0000000000002000
[ 4603.261759] FS: 00007f3e371ea4c0(0000) GS:ffff8887e4c40000(0000) knlGS:0000000000000000
[ 4603.261761] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 4603.261762] CR2: ffffc90ffa3a5004 CR3: 0000000201468000 CR4: 0000000000350ea0
[ 4603.261764] Kernel panic - not syncing: Fatal exception
[ 4608.254467] hv_vmbus: Waiting for VMBus UNLOAD to complete
[ 4613.257914] hv_vmbus: Waiting for VMBus UNLOAD to complete
[ 4618.262454] hv_vmbus: Waiting for VMBus UNLOAD to complete
[ 4623.265002] hv_vmbus: Waiting for VMBus UNLOAD to complete
[ 4628.266496] hv_vmbus: Waiting for VMBus UNLOAD to complete
[ 4633.271222] hv_vmbus: Waiting for VMBus UNLOAD to complete
[ 4638.272548] hv_vmbus: Waiting for VMBus UNLOAD to complete
[ 4643.274157] hv_vmbus: Waiting for VMBus UNLOAD to complete
[ 4648.275633] hv_vmbus: Waiting for VMBus UNLOAD to complete
[ 4653.280212] hv_vmbus: Waiting for VMBus UNLOAD to complete
[ 4658.282612] hv_vmbus: Waiting for VMBus UNLOAD to complete
[ 4663.285479] hv_vmbus: Waiting for VMBus UNLOAD to complete
[ 4668.290463] hv_vmbus: Waiting for VMBus UNLOAD to complete
[ 4673.294493] hv_vmbus: Waiting for VMBus UNLOAD to complete
[ 4678.295916] hv_vmbus: Waiting for VMBus UNLOAD to complete
[ 4683.298323] hv_vmbus: Waiting for VMBus UNLOAD to complete
[ 4688.303063] hv_vmbus: Waiting for VMBus UNLOAD to complete
[ 4693.305511] hv_vmbus: Waiting for VMBus UNLOAD to complete
[ 4698.306955] hv_vmbus: Waiting for VMBus UNLOAD to complete
[ 4703.308404] hv_vmbus: Waiting for VMBus UNLOAD to complete
[ 4703.318411] hv_vmbus: Continuing even though VMBus UNLOAD did not complete
[ 4703.318415] Kernel Offset: disabled

@oguimbal
Copy link

oguimbal commented Aug 30, 2021

Same problem (does not seem related to chrome to me)

⚠️ For me, THIS PROBLEM APPEARED AFTER UPGRADING TO WINDOWS 11 PREVIEW.

👉 Symptoms: Although Ubuntu works as expected (already opened terminals are OK, already launched instanced of vscode are OK), reaching the VM through wsl.exe randomly fails after a while with error code 1. (so does every other operation I am used to perform which requires interaction between wsl & win, such as opening a new vscode in a wsl folder, ...)*

👉 Build number: Microsoft Windows [Version 10.0.22000.160]
👉 Kernel version: 5.10.43
👉 Trace attached: A trace taken while I was running wsl ls / which failed with echo %errorlevel% showing 1

This happens very randomly... see these:

image

@benhillis benhillis added the GPU label Aug 31, 2021
@benhillis
Copy link
Member

Thanks for reporting, I'll see if this is a known issue. Looks like you're using a pretty recent kernel, I'll let you know if I need more diagnostic info.

@benhillis benhillis self-assigned this Aug 31, 2021
@benhillis
Copy link
Member

I have confirmed that this issue is known and will be fixed in a future kernel release. Thanks again for reporting!

@stralytic
Copy link
Author

I have confirmed that this issue is known and will be fixed in a future kernel release. Thanks again for reporting!

Would a work around for this issue, be to use a "legacy" x11 server instead of the Wayland based WSLg?

@stralytic
Copy link
Author

I have confirmed that this issue is known and will be fixed in a future kernel release. Thanks again for reporting!

Would a work around for this issue, be to use a "legacy" x11 server instead of the Wayland based WSLg?

Can confirm no crashes in ~3 hours by using X11 server.

@oguimbal
Copy link

oguimbal commented Sep 8, 2021

Thanks @benhillis .

Do you have any idea of how long we're talking about before this fix gets shipped ?
Days ? Weeks ? Months ?

(This is too anonying to be bearable for a long time, so I would have to find another solution if the answer is "months" 😅)

@stralytic
Copy link
Author

@benhillis should this be fixed with the recent kernel 5.10.60.1 update? i haven't had the bug yet but i haven't tested extensively.

@bayeslearnerold
Copy link

Same issue here. Any updates? I do not have docker desktop but have docker.ce installed inside WSL2.

@LZong-tw
Copy link

Same issue +1

@alexbogias
Copy link

alexbogias commented Nov 14, 2021

Same here after updated to win 11. Git and phpstorm gives the following error again and again: "The Git process exited with the code 1". If I retry it might work

@stralytic
Copy link
Author

For people coming here from the jetbrains link, I believe there are two separate bugs here. My original report was a bug with wslg with chrome crashing which I think is fixed. I don't think the problem @oguimbal reported with commands randomly not working has been fixed yet. Might be worth creating a new issue as microsoft devs don't seem to be watching this one anymore.

@benhillis
Copy link
Member

To people that are still hitting this, have you updated your WSL kernel recently? wsl.exe --update

@oguimbal
Copy link

@benhillis Yes. Still happening with Kernel version 5.10.60.1

Should I create a separate issue like @stralytic suggested ?

@alexbogias
Copy link

I am trying to update the last days but there is no update on the kernel yet
image

@LZong-tw
Copy link

Already 5.10.60.1 but still happens too.

@benhillis
Copy link
Member

Ok - the Store version of WSL (0.50.2) has a new kernel (5.10.74.3) with some addition /dev/dxg bug fixes. Is anybody able to repro the crash with that kernel?

@code-eren
Copy link

Same issue, wait for an answer..so annoying, also breaks my touchpad and mouse movement and click sensitivity after upgrading to windows11..

@stralytic
Copy link
Author

My WSL kernel version is 5.10.74.3 and I haven't had any crashes recently.

@alexbogias
Copy link

How I can update?
image

@stralytic
Copy link
Author

install windows subsystem for linux from the windows store

https://www.microsoft.com/en-au/p/windows-subsystem-for-linux-preview/9p9tqf7mrm4r?activetab=pivot:overviewtab

@alexbogias
Copy link

If I install this preview... I can remove it anytime and switch to stable version without any problem ?

@alexbogias
Copy link

So far so good with the preview kernel 💯

@stralytic
Copy link
Author

Thanks for all your help @benhillis I consider this closed.

@alexbogias
Copy link

alexbogias commented Nov 22, 2021

After a lot of testing, I uninstalled WSL preview. It was very buggy with my PHPStorm WSL projects.
Making phpstorm unable to even start and writing like crazy the idea.log with this:
tellij.wsl.fs.WslContentLoader - Remote call <fleet.api.FsApi#readFile> has failed: invalid type: string "/", expected internally tagged enum Root

@craigloewen-msft
Copy link
Member

@alexbogias was this using PHPStorm on Windows and using their WSL tooling?

@alexbogias
Copy link

alexbogias commented Nov 22, 2021

@craigloewen-msft was this using PHPStorm on Windows and using their WSL tooling?

Thats true phpstorm on host with a project path of //wsl$/home/alex...

I never tried running phpstorm inside wslg. I suppose would work better but I don't have all of my projects there :(

Do you have a better workaround?

@craigloewen-msft
Copy link
Member

As of right now our recommendation for best performance would be to run PHPStorm through WSLg (As Linux programs accessing Linux files gives you the best file system performance).

I'll also try and repro this issue with the use case you mentioned.

@ihor-sviziev
Copy link

@craigloewen-msft,
I'm having the same issues randomly on Win 11 and had the same problems on Win 10.

Unfortunately, PHPStorm doesn't work well under WSLg.
The issues are:

  • the window itself has quite a big white border
  • Can't use the menu. Just pressing the "File" opens and immediately closes the menus
  • Some windows (for instance, indexation) do not appear
  • We need to manually forward the XDebug port to WSL2 to have a proper xdebug session

Tried to use WSL2 using "Remote Development", but it doesn't support XDebug and can't open multiple projects simultaneously.

So far, I rolled back to PHPStorm 2021.3 RC2, and it works more-less stable. At the same time, the release version functions not as well for some reason.

@rvanlaak
Copy link

rvanlaak commented Dec 9, 2021

While having the same issues I've made an attempt to fix it by installing WSL Preview from the Microsoft Store as well.

The same issues appear; after a bit of time all PHPStorm related Git actions (e.g. annotate file, commit, push, checkout branch) do not work anymore. Reading/writing files stay accessible, so problems do not seem related to the file mount.

Restarting PHPStorm then results in the warning "Git is not installed".

In addition, it is not possible to open a terminal connection (both from PHPStorm and from cmd, powershell, etc). Trying to open a connection by executing wsl (or wsl --shutdown) from cmd does not allow closing the CMD pane anymore.

What works is a complete system reboot.

@jiangtao69039
Copy link

run IDEA as admin role can reslove

@albionbrown
Copy link

Is it known if progress was made on this issue? I've been getting these WSL crashes for a while now similar to the comments above, but I'm using VS code.

Kernel version: 5.10.102.1

.wslconfig
[wsl2]
memory=3072MB
processors=2
swap=6GB
swapFile=%USERPROFILE%\AppData\Local\Temp\swap.vhdx

@Fernien
Copy link

Fernien commented Jan 6, 2023

Having same issue. After wsl.exe --update wsl random crashes and has a task (Vmmem) that uses 100% CPU. Only reboot can fix it so far.

@ltajazz
Copy link

ltajazz commented Jan 20, 2023

Still same issue after updating wsl but no reboot needed. (not sure I even had CPU impact when it crashs)

wsl.exe --version
Version WSL : 1.0.3.0
Version du noyau : 5.15.79.1
Version WSLg : 1.0.47
Version MSRDC : 1.2.3575
Version direct3D : 1.606.4
Version de DXCore : 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp
version Windows : 10.0.19045.2486

@danztensai
Copy link

Sometimes crashes, and then when opening the port on wsl, it randomly closes so can't be access from the windows host

C:\Users\danzt>wsl -v
WSL version: 1.1.0.0
Kernel version: 5.15.83.1
WSLg version: 1.0.48
MSRDC version: 1.2.3770
Direct3D version: 1.608.2-61064218
DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp
Windows version: 10.0.22623.1245

any idea how to fix it?

@sisrfeng
Copy link

sisrfeng commented Feb 6, 2023

This issue should be opened, IMO

@Fernien
Copy link

Fernien commented Feb 6, 2023

My problem got fixed by adding these lines:

[wsl2]
guiApplications=false

to c:\users\MyUser.wslconfig

No idea what it does but it didn't brake anything so far.

@sisrfeng
Copy link

sisrfeng commented Feb 6, 2023

My problem got fixed by adding these lines:

[wsl2]
guiApplications=false

to c:\users\MyUser.wslconfig

No idea what it does but it didn't brake anything so far.

Only available for Windows 11.

@Fernien
Copy link

Fernien commented Feb 6, 2023

My problem got fixed by adding these lines:

[wsl2]
guiApplications=false

to c:\users\MyUser.wslconfig
No idea what it does but it didn't brake anything so far.

Only available for Windows 11.

Not sure what you are referring to but i am running windows 10 22H2

@sisrfeng
Copy link

sisrfeng commented Feb 6, 2023

My problem got fixed by adding these lines:

[wsl2]
guiApplications=false

to c:\users\MyUser.wslconfig
No idea what it does but it didn't brake anything so far.

Only available for Windows 11.

Not sure what you are referring to but i am running windows 10 22H2

See this part in https://learn.microsoft.com/en-us/windows/wsl/wsl-config#configuration-setting-for-wslconfig:
image

@Fernien
Copy link

Fernien commented Feb 6, 2023

My problem got fixed by adding these lines:

[wsl2]
guiApplications=false

to c:\users\MyUser.wslconfig
No idea what it does but it didn't brake anything so far.

Only available for Windows 11.

Not sure what you are referring to but i am running windows 10 22H2

See this part in https://learn.microsoft.com/en-us/windows/wsl/wsl-config#configuration-setting-for-wslconfig: image

hmm can't argue with that but it kinda fixed my problem

@sisrfeng
Copy link

sisrfeng commented Feb 6, 2023

hmm can't argue with that but it kinda fixed my problem

Maybe late win10 has something same as win11, but not documented.

@lucianHymer
Copy link

My problem got fixed by adding these lines:

[wsl2]
guiApplications=false

to c:\users\MyUser.wslconfig

No idea what it does but it didn't brake anything so far.

This seems to be working for me so far. But it's a real bummer, this is a key feature for my workflow!

It seems to be related to the fairly new window server features in WSL2. Vim uses the window server to process remote commands, which is what I'm using it for. Can't use it now though, because WSL keeps crashing unless I disable it like above.

@sisrfeng
Copy link

sisrfeng commented Feb 17, 2023

Vim uses the window server to process remote commands, which is what I'm using it for. Can't use it now though, because WSL keeps crashing unless I disable it like above.

I use the guiApplications=false trick.

I use neovim and sometimes with neovide for better UI. x11 applications like xlogo works well. What's your remote command?

@ahillfusion
Copy link

Is there any explanation as to why guiApplications causes the crashes?

@ZombieRoxtar
Copy link

It might be X11/Wayland thing, but I'm really just here to +1 this. Creating the file allowed me to run Steam on Ubuntu in Windows 10. It's about "why?'; it's about "why not?"!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests