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: 'code .' resulting in Segmentation fault #3117

Closed
SHJordan opened this issue Jun 2, 2020 · 19 comments
Closed

WSL2: 'code .' resulting in Segmentation fault #3117

SHJordan opened this issue Jun 2, 2020 · 19 comments
Assignees

Comments

@SHJordan
Copy link

SHJordan commented Jun 2, 2020

Issue Type: Bug

navigate to desired folder to be opened by wsl2 ubuntu 20.04, write "code ." and hit enter.

VS Code version: Code 1.45.1 (5763d909d5f12fe19f215cbfdd29a91c0fa9208a, 2020-05-14T08:27:35.169Z)
OS version: Windows_NT x64 10.0.19635

System Info
Item Value
CPUs Intel(R) Core(TM) i5-6600K CPU @ 3.50GHz (4 x 3504)
GPU Status 2d_canvas: enabled
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
oop_rasterization: disabled_off
protected_video_decode: unavailable_off
rasterization: enabled
skia_renderer: disabled_off_ok
video_decode: enabled
viz_display_compositor: enabled_on
viz_hit_test_surface_layer: disabled_off_ok
webgl: enabled
webgl2: enabled
Load (avg) undefined
Memory (System) 15.96GB (5.56GB free)
Process Argv
Screen Reader no
VM 0%
Extensions (14)
Extension Author (truncated) Version
copy-relative-path ale 0.0.2
dart-code Dar 3.11.0
flutter Dar 3.11.0
vscode-eslint dba 2.1.5
prettier-vscode esb 5.0.0
intellij-idea-keybindings k-- 0.2.40
expand-region let 0.1.4
vscode-edge-devtools ms- 1.0.7
remote-wsl ms- 0.44.2
debugger-for-edge msj 1.0.14
vetur oct 0.24.0
material-icon-theme PKi 4.1.0
vue-vscode-snippets sdr 1.9.0
vscode-wakatime Wak 4.0.0

(2 theme extensions excluded)

@SHJordan
Copy link
Author

SHJordan commented Jun 2, 2020

image
I still can reach the folder by windows and open it in vscode, its just it wasnt like this since last vscode update.

@aeschli aeschli transferred this issue from microsoft/vscode Jun 3, 2020
@aeschli
Copy link
Contributor

aeschli commented Jun 3, 2020

Can you run bash -x $(which code) to get more information?
Also code --verbose

@SHJordan
Copy link
Author

SHJordan commented Jun 3, 2020

code --verbose

image
Sadly it seems not to be working at all.

@SHJordan
Copy link
Author

SHJordan commented Jun 3, 2020

which code worked for me:
/mnt/c/Program Files/Microsoft VS Code/bin/code

@aeschli
Copy link
Contributor

aeschli commented Jun 3, 2020

Sorry, forgot the quotes:
bash -x "$(which code)"

@SHJordan
Copy link
Author

SHJordan commented Jun 3, 2020

Sorry, forgot the quotes:
bash -x "$(which code)"

  • COMMIT=5763d909d5f12fe19f215cbfdd29a91c0fa9208a
  • APP_NAME=code
  • QUALITY=stable
  • NAME=Code
  • DATAFOLDER=.vscode
    ++++ realpath '/mnt/c/Program Files/Microsoft VS Code/bin/code'
    +++ dirname '/mnt/c/Program Files/Microsoft VS Code/bin/code'
    ++ dirname '/mnt/c/Program Files/Microsoft VS Code/bin'
  • VSCODE_PATH='/mnt/c/Program Files/Microsoft VS Code'
  • ELECTRON='/mnt/c/Program Files/Microsoft VS Code/Code.exe'
  • grep -qi Microsoft /proc/version
    ++ uname -r
    ++ sed -E 's/^[0-9.]+-([0-9]+)-Microsoft|([0-9]+).([0-9]+).([0-9]+)-microsoft-standard|.*/\1\2\3\4/'
  • WSL_BUILD=419104
  • '[' -z 419104 ']'
  • '[' 419104 -ge 17063 ']'
  • export WSLENV=ELECTRON_RUN_AS_NODE/w:WT_SESSION::WT_PROFILE_ID
  • WSLENV=ELECTRON_RUN_AS_NODE/w:WT_SESSION::WT_PROFILE_ID
    ++ wslpath -m '/mnt/c/Program Files/Microsoft VS Code/resources/app/out/cli.js'
  • CLI='C:/Program Files/Microsoft VS Code/resources/app/out/cli.js'
  • WSL_EXT_ID=ms-vscode-remote.remote-wsl
  • '[' 419104 -ge 41955 -a 419104 -lt 41959 ']'
  • ELECTRON_RUN_AS_NODE=1
  • '/mnt/c/Program Files/Microsoft VS Code/Code.exe' 'C:/Program Files/Microsoft VS Code/resources/app/out/cli.js' --locate-extension ms-vscode-remote.remote-wsl
    ++ cat /tmp/remote-wsl-loc.txt
  • WSL_EXT_WLOC='c:\Users\Jordan.vscode\extensions\ms-vscode-remote.remote-wsl-0.44.2'
  • '[' -n 'c:\Users\Jordan.vscode\extensions\ms-vscode-remote.remote-wsl-0.44.2' ']'
    ++ wslpath -u 'c:\Users\Jordan.vscode\extensions\ms-vscode-remote.remote-wsl-0.44.2'
  • WSL_CODE=/mnt/c/Users/Jordan/.vscode/extensions/ms-vscode-remote.remote-wsl-0.44.2/scripts/wslCode.sh
  • /mnt/c/Users/Jordan/.vscode/extensions/ms-vscode-remote.remote-wsl-0.44.2/scripts/wslCode.sh 5763d909d5f12fe19f215cbfdd29a91c0fa9208a stable '/mnt/c/Program Files/Microsoft VS Code/Code.exe' code .vscode
    Segmentation fault
  • exit 139

@derkan
Copy link

derkan commented Jun 16, 2020

same error here, any improvements?

Calling in centos7 wsl2:

> code
/mnt/c/Users/erkan/AppData/Local/Programs/Microsoft VS Code/bin/code: line 62:    55 Segmentation fault      ELECTRON_RUN_AS_NODE=1 "$ELECTRON" "$CLI" --locate-extension $WSL_EXT_ID > /tmp/remote-wsl-loc.txt 2> /dev/null
/mnt/c/Users/erkan/AppData/Local/Programs/Microsoft VS Code/bin/code: line 63:    57 Segmentation fault      ELECTRON_RUN_AS_NODE=1 "$ELECTRON" "$CLI" "$@"

> echo $?
139

And for Ubuntu:

 > bash -x "$(which code)"
+ '[' '' = true ']'
+ COMMIT=a5d1cc28bb5da32ec67e86cc50f84c67cc690321
+ APP_NAME=code
+ QUALITY=stable
+ NAME=Code
+ DATAFOLDER=.vscode
++++ realpath '/mnt/c/Users/erkan/AppData/Local/Programs/Microsoft VS Code/bin/code'
+++ dirname '/mnt/c/Users/erkan/AppData/Local/Programs/Microsoft VS Code/bin/code'
++ dirname '/mnt/c/Users/erkan/AppData/Local/Programs/Microsoft VS Code/bin'
+ VSCODE_PATH='/mnt/c/Users/erkan/AppData/Local/Programs/Microsoft VS Code'
+ ELECTRON='/mnt/c/Users/erkan/AppData/Local/Programs/Microsoft VS Code/Code.exe'
+ grep -qi Microsoft /proc/version
++ uname -r
++ sed -E 's/^[0-9.]+-([0-9]+)-Microsoft.*|([0-9]+).([0-9]+).([0-9]+)-microsoft-standard.*|.*/\1\2\3\4/'
+ WSL_BUILD=419104
+ '[' -z 419104 ']'
+ '[' 419104 -ge 17063 ']'
+ export WSLENV=ELECTRON_RUN_AS_NODE/w:WT_SESSION:DISPLAY/p:WT_PROFILE_ID
+ WSLENV=ELECTRON_RUN_AS_NODE/w:WT_SESSION:DISPLAY/p:WT_PROFILE_ID
++ wslpath -m '/mnt/c/Users/erkan/AppData/Local/Programs/Microsoft VS Code/resources/app/out/cli.js'
+ CLI='C:/Users/erkan/AppData/Local/Programs/Microsoft VS Code/resources/app/out/cli.js'
+ WSL_EXT_ID=ms-vscode-remote.remote-wsl
+ '[' 419104 -ge 41955 -a 419104 -lt 41959 ']'
+ ELECTRON_RUN_AS_NODE=1
+ '/mnt/c/Users/erkan/AppData/Local/Programs/Microsoft VS Code/Code.exe' 'C:/Users/erkan/AppData/Local/Programs/Microsoft VS Code/resources/app/out/cli.js' --locate-extension ms-vscode-remote.remote-wsl
/mnt/c/Users/erkan/AppData/Local/Programs/Microsoft VS Code/bin/code: line 63: 14966 Segmentation fault      ELECTRON_RUN_AS_NODE=1 "$ELECTRON" "$CLI" --locate-extension $WSL_EXT_ID > /tmp/remote-wsl-loc.txt 2> /dev/null
++ cat /tmp/remote-wsl-loc.txt
+ WSL_EXT_WLOC=
+ '[' -n '' ']'
+ ELECTRON_RUN_AS_NODE=1
+ '/mnt/c/Users/erkan/AppData/Local/Programs/Microsoft VS Code/Code.exe' 'C:/Users/erkan/AppData/Local/Programs/Microsoft VS Code/resources/app/out/cli.js'
/mnt/c/Users/erkan/AppData/Local/Programs/Microsoft VS Code/bin/code: line 64: 14968 Segmentation fault      ELECTRON_RUN_AS_NODE=1 "$ELECTRON" "$CLI" "$@"
+ exit 139

@Darival
Copy link

Darival commented Jul 17, 2020

same issue here:
WSL2
Ubuntu 20.04 focal(on the Windows Subsystem for Linux)

$ bash -x "$(which code)"
+ '[' '' = true ']'
+ COMMIT=17299e413d5590b14ab0340ea477cdd86ff13daf
+ APP_NAME=code
+ QUALITY=stable
+ NAME=Code
+ DATAFOLDER=.vscode
++++ realpath '/mnt/c/Users/cesar/AppData/Local/Programs/Microsoft VS Code/bin/code'
+++ dirname '/mnt/c/Users/cesar/AppData/Local/Programs/Microsoft VS Code/bin/code'
++ dirname '/mnt/c/Users/cesar/AppData/Local/Programs/Microsoft VS Code/bin'
+ VSCODE_PATH='/mnt/c/Users/cesar/AppData/Local/Programs/Microsoft VS Code'
+ ELECTRON='/mnt/c/Users/cesar/AppData/Local/Programs/Microsoft VS Code/Code.exe'
+ IN_WSL=false
+ '[' -n Ubuntu ']'
+ IN_WSL=true
+ '[' true = true ']'
+ export WSLENV=ELECTRON_RUN_AS_NODE/w:WT_SESSION::WT_PROFILE_ID
+ WSLENV=ELECTRON_RUN_AS_NODE/w:WT_SESSION::WT_PROFILE_ID
++ wslpath -m '/mnt/c/Users/cesar/AppData/Local/Programs/Microsoft VS Code/resources/app/out/cli.js'
+ CLI='C:/Users/cesar/AppData/Local/Programs/Microsoft VS Code/resources/app/out/cli.js'
+ WSL_EXT_ID=ms-vscode-remote.remote-wsl
+ ELECTRON_RUN_AS_NODE=1
+ '/mnt/c/Users/cesar/AppData/Local/Programs/Microsoft VS Code/Code.exe' 'C:/Users/cesar/AppData/Local/Programs/Microsoft VS Code/resources/app/out/cli.js' --locate-extension ms-vscode-remote.remote-wsl
++ cat /tmp/remote-wsl-loc.txt
+ WSL_EXT_WLOC='c:\Users\cesar\.vscode\extensions\ms-vscode-remote.remote-wsl-0.44.4'
+ '[' -n 'c:\Users\cesar\.vscode\extensions\ms-vscode-remote.remote-wsl-0.44.4' ']'
++ wslpath -u 'c:\Users\cesar\.vscode\extensions\ms-vscode-remote.remote-wsl-0.44.4'
+ WSL_CODE=/mnt/c/Users/cesar/.vscode/extensions/ms-vscode-remote.remote-wsl-0.44.4/scripts/wslCode.sh
+ /mnt/c/Users/cesar/.vscode/extensions/ms-vscode-remote.remote-wsl-0.44.4/scripts/wslCode.sh 17299e413d5590b14ab0340ea477cdd86ff13daf stable '/mnt/c/Users/cesar/AppData/Local/Programs/Microsoft VS Code/Code.exe' code .vscode
Segmentation fault
+ exit 139
$code --verbose
Segmentation fault

This is the second time this happens to me, my work around is to make a backup of my projects folder and reinstal ubuntu for wsl.

@Edmund-Shi
Copy link

Edmund-Shi commented Aug 14, 2020

I got the same issue in WSL 2, Ubuntu 18.04. After I switch WSL 2 to WSL using wsl --set-version Ubuntu 1, I still got the same issue.

Output for bash -x "$(which code)"

+ '[' '' = true ']'
+ COMMIT=db40434f562994116e5b21c24015a2e40b2504e6
+ APP_NAME=code
+ QUALITY=stable
+ NAME=Code
+ DATAFOLDER=.vscode
++++ realpath '/mnt/c/Users/edm/AppData/Local/Programs/Microsoft VS Code/bin/code'
+++ dirname '/mnt/c/Users/edm/AppData/Local/Programs/Microsoft VS Code/bin/code'
++ dirname '/mnt/c/Users/edm/AppData/Local/Programs/Microsoft VS Code/bin'
+ VSCODE_PATH='/mnt/c/Users/edm/AppData/Local/Programs/Microsoft VS Code'
+ ELECTRON='/mnt/c/Users/edm/AppData/Local/Programs/Microsoft VS Code/Code.exe'
+ IN_WSL=false
+ '[' -n Ubuntu ']'
+ IN_WSL=true
+ '[' true = true ']'
+ export WSLENV=ELECTRON_RUN_AS_NODE/w:WT_SESSION::WT_PROFILE_ID
+ WSLENV=ELECTRON_RUN_AS_NODE/w:WT_SESSION::WT_PROFILE_ID
++ wslpath -m '/mnt/c/Users/edm/AppData/Local/Programs/Microsoft VS Code/resources/app/out/cli.js'
+ CLI='C:/Users/edm/AppData/Local/Programs/Microsoft VS Code/resources/app/out/cli.js'
+ WSL_EXT_ID=ms-vscode-remote.remote-wsl
+ ELECTRON_RUN_AS_NODE=1
+ '/mnt/c/Users/edm/AppData/Local/Programs/Microsoft VS Code/Code.exe' 'C:/Users/edm/AppData/Local/Programs/Microsoft VS Code/resources/app/out/cli.js' --locate-extension ms-vscode-remote.remote-wsl
++ cat /tmp/remote-wsl-loc.txt
+ WSL_EXT_WLOC='c:\Users\edm\.vscode\extensions\ms-vscode-remote.remote-wsl-0.44.4'
+ '[' -n 'c:\Users\edm\.vscode\extensions\ms-vscode-remote.remote-wsl-0.44.4' ']'
++ wslpath -u 'c:\Users\edm\.vscode\extensions\ms-vscode-remote.remote-wsl-0.44.4'
+ WSL_CODE=/mnt/c/Users/edm/.vscode/extensions/ms-vscode-remote.remote-wsl-0.44.4/scripts/wslCode.sh
+ /mnt/c/Users/edm/.vscode/extensions/ms-vscode-remote.remote-wsl-0.44.4/scripts/wslCode.sh db40434f562994116e5b21c24015a2e40b2504e6 stable '/mnt/c/Users/edm/AppData/Local/Programs/Microsoft VS Code/Code.exe' code .vscode
Segmentation fault (core dumped)
+ exit 139
Output for wsl --list --verbose

  NAME      STATE           VERSION
* Ubuntu    Running         1
Output for VSCODE_WSL_DEBUG_INFO=true code .

+ COMMIT=db40434f562994116e5b21c24015a2e40b2504e6
+ APP_NAME=code
+ QUALITY=stable
+ NAME=Code
+ DATAFOLDER=.vscode
+ realpath /mnt/c/Users/edm/AppData/Local/Programs/Microsoft VS Code/bin/code
+ dirname /mnt/c/Users/edm/AppData/Local/Programs/Microsoft VS Code/bin/code
+ dirname /mnt/c/Users/edm/AppData/Local/Programs/Microsoft VS Code/bin
+ VSCODE_PATH=/mnt/c/Users/edm/AppData/Local/Programs/Microsoft VS Code
+ ELECTRON=/mnt/c/Users/edm/AppData/Local/Programs/Microsoft VS Code/Code.exe
+ IN_WSL=false
+ [ -n Ubuntu ]
+ IN_WSL=true
+ [ true = true ]
+ export WSLENV=ELECTRON_RUN_AS_NODE/w:WT_SESSION::WT_PROFILE_ID
+ wslpath -m /mnt/c/Users/edm/AppData/Local/Programs/Microsoft VS Code/resources/app/out/cli.js
+ CLI=C:/Users/edm/AppData/Local/Programs/Microsoft VS Code/resources/app/out/cli.js
+ WSL_EXT_ID=ms-vscode-remote.remote-wsl
+ ELECTRON_RUN_AS_NODE=1 /mnt/c/Users/edm/AppData/Local/Programs/Microsoft VS Code/Code.exe C:/Users/edm/AppData/Local/Programs/Microsoft VS Code/resources/app/out/cli.js --locate-extension ms-vscode-remote.remote-wsl
+ cat /tmp/remote-wsl-loc.txt
+ WSL_EXT_WLOC=c:\Users\edm\.vscode\extensions\ms-vscode-remote.remote-wsl-0.44.4
+ [ -n c:\Users\edm\.vscode\extensions\ms-vscode-remote.remote-wsl-0.44.4 ]
+ wslpath -u c:\Users\edm\.vscode\extensions\ms-vscode-remote.remote-wsl-0.44.4
+ WSL_CODE=/mnt/c/Users/edm/.vscode/extensions/ms-vscode-remote.remote-wsl-0.44.4/scripts/wslCode.sh
+ /mnt/c/Users/edm/.vscode/extensions/ms-vscode-remote.remote-wsl-0.44.4/scripts/wslCode.sh db40434f562994116e5b21c24015a2e40b2504e6 stable /mnt/c/Users/edm/AppData/Local/Programs/Microsoft VS Code/Code.exe code .vscode .
+ [ -z .vscode ]
+ echo .vscode
+ sed -e s/.vscode/.vscode-server/g
+ DATAFOLDER=.vscode-server
+ VSCODE_REMOTE_BIN=/home/edm/.vscode-server/bin
+ AUTHORITY=wsl+default
+ [ Ubuntu ]
+ AUTHORITY=wsl+Ubuntu
+ [ ! -d /home/edm/.vscode-server ]
+ dirname /mnt/c/Users/edm/.vscode/extensions/ms-vscode-remote.remote-wsl-0.44.4/scripts/wslCode.sh
+ /mnt/c/Users/edm/.vscode/extensions/ms-vscode-remote.remote-wsl-0.44.4/scripts/wslDownload.sh db40434f562994116e5b21c24015a2e40b2504e6 stable /home/edm/.vscode-server/bin
+ [ ! -d /home/edm/.vscode-server/bin/db40434f562994116e5b21c24015a2e40b2504e6 ]
+ RC=0
+ [ 0 -ne 0 ]
+ dirname /mnt/c/Users/edm/.vscode/extensions/ms-vscode-remote.remote-wsl-0.44.4/scripts/wslCode.sh
+ VSCODE_CLIENT_COMMAND=/mnt/c/Users/edm/AppData/Local/Programs/Microsoft VS Code/Code.exe VSCODE_CLIENT_COMMAND_CWD=/mnt/c/Users/edm/.vscode/extensions/ms-vscode-remote.remote-wsl-0.44.4/scripts VSCODE_CLI_AUTHORITY=wsl+Ubuntu /home/edm/.vscode-server/bin/db40434f562994116e5b21c24015a2e40b2504e6/bin/code .
Segmentation fault (core dumped)
+ exit 139

@drewhemm
Copy link

Woke up this morning to start work after latest Windows Insider Preview updates and now I am getting this! Is there any known workaround?

@drewhemm
Copy link

Output for bash -x "$(which code)"
+ '[' '' = true ']'
+ COMMIT=db40434f562994116e5b21c24015a2e40b2504e6
+ APP_NAME=code
+ QUALITY=stable
+ NAME=Code
+ DATAFOLDER=.vscode
++++ realpath '/mnt/c/Users/andre/AppData/Local/Programs/Microsoft VS Code/bin/code'
+++ dirname '/mnt/c/Users/andre/AppData/Local/Programs/Microsoft VS Code/bin/code'
++ dirname '/mnt/c/Users/andre/AppData/Local/Programs/Microsoft VS Code/bin'
+ VSCODE_PATH='/mnt/c/Users/andre/AppData/Local/Programs/Microsoft VS Code'
+ ELECTRON='/mnt/c/Users/andre/AppData/Local/Programs/Microsoft VS Code/Code.exe'
+ IN_WSL=false
+ '[' -n Ubuntu ']'
+ IN_WSL=true
+ '[' true = true ']'
+ export WSLENV=ELECTRON_RUN_AS_NODE/w:WT_SESSION::WT_PROFILE_ID
+ WSLENV=ELECTRON_RUN_AS_NODE/w:WT_SESSION::WT_PROFILE_ID
++ wslpath -m '/mnt/c/Users/andre/AppData/Local/Programs/Microsoft VS Code/resources/app/out/cli.js'
+ CLI='C:/Users/andre/AppData/Local/Programs/Microsoft VS Code/resources/app/out/cli.js'
+ WSL_EXT_ID=ms-vscode-remote.remote-wsl
+ ELECTRON_RUN_AS_NODE=1
+ '/mnt/c/Users/andre/AppData/Local/Programs/Microsoft VS Code/Code.exe' 'C:/Users/andre/AppData/Local/Programs/Microsoft VS Code/resources/app/out/cli.js' --locate-extension ms-vscode-remote.remote-wsl
++ cat /tmp/remote-wsl-loc.txt
+ WSL_EXT_WLOC='c:\Users\andre\.vscode\extensions\ms-vscode-remote.remote-wsl-0.44.4'
+ '[' -n 'c:\Users\andre\.vscode\extensions\ms-vscode-remote.remote-wsl-0.44.4' ']'
++ wslpath -u 'c:\Users\andre\.vscode\extensions\ms-vscode-remote.remote-wsl-0.44.4'
+ WSL_CODE=/mnt/c/Users/andre/.vscode/extensions/ms-vscode-remote.remote-wsl-0.44.4/scripts/wslCode.sh
+ /mnt/c/Users/andre/.vscode/extensions/ms-vscode-remote.remote-wsl-0.44.4/scripts/wslCode.sh db40434f562994116e5b21c24015a2e40b2504e6 stable '/mnt/c/Users/andre/AppData/Local/Programs/Microsoft VS Code/Code.exe' code .vscode
Segmentation fault
+ exit 139
Output for wsl --list --verbose
NAME                   STATE           VERSION
* Ubuntu                 Running         2

@aeschli
Copy link
Contributor

aeschli commented Aug 14, 2020

Please also try VSCODE_WSL_DEBUG_INFO=true code .. This should get even more logging.

@drewhemm
Copy link

Output for VSCODE_WSL_DEBUG_INFO=true code .
+ COMMIT=db40434f562994116e5b21c24015a2e40b2504e6
+ APP_NAME=code
+ QUALITY=stable
+ NAME=Code
+ DATAFOLDER=.vscode
+ realpath /mnt/c/Users/andre/AppData/Local/Programs/Microsoft VS Code/bin/code
+ dirname /mnt/c/Users/andre/AppData/Local/Programs/Microsoft VS Code/bin/code
+ dirname /mnt/c/Users/andre/AppData/Local/Programs/Microsoft VS Code/bin
+ VSCODE_PATH=/mnt/c/Users/andre/AppData/Local/Programs/Microsoft VS Code
+ ELECTRON=/mnt/c/Users/andre/AppData/Local/Programs/Microsoft VS Code/Code.exe
+ IN_WSL=false
+ [ -n Ubuntu ]
+ IN_WSL=true
+ [ true = true ]
+ export WSLENV=ELECTRON_RUN_AS_NODE/w:WT_SESSION::WT_PROFILE_ID
+ wslpath -m /mnt/c/Users/andre/AppData/Local/Programs/Microsoft VS Code/resources/app/out/cli.js
+ CLI=C:/Users/andre/AppData/Local/Programs/Microsoft VS Code/resources/app/out/cli.js
+ WSL_EXT_ID=ms-vscode-remote.remote-wsl
+ ELECTRON_RUN_AS_NODE=1 /mnt/c/Users/andre/AppData/Local/Programs/Microsoft VS Code/Code.exe C:/Users/andre/AppData/Local/Programs/Microsoft VS Code/resources/app/out/cli.js --locate-extension ms-vscode-remote.remote-wsl
+ cat /tmp/remote-wsl-loc.txt
+ WSL_EXT_WLOC=c:\Users\andre\.vscode\extensions\ms-vscode-remote.remote-wsl-0.44.4
+ [ -n c:\Users\andre\.vscode\extensions\ms-vscode-remote.remote-wsl-0.44.4 ]
+ wslpath -u c:\Users\andre\.vscode\extensions\ms-vscode-remote.remote-wsl-0.44.4
+ WSL_CODE=/mnt/c/Users/andre/.vscode/extensions/ms-vscode-remote.remote-wsl-0.44.4/scripts/wslCode.sh
+ /mnt/c/Users/andre/.vscode/extensions/ms-vscode-remote.remote-wsl-0.44.4/scripts/wslCode.sh db40434f562994116e5b21c24015a2e40b2504e6 stable /mnt/c/Users/andre/AppData/Local/Programs/Microsoft VS Code/Code.exe code .vscode .
+ [ -z .vscode ]
+ echo .vscode+
sed -e s/.vscode/.vscode-server/g
+ DATAFOLDER=.vscode-server
+ VSCODE_REMOTE_BIN=/home/andrew/.vscode-server/bin
+ AUTHORITY=wsl+default
+ [ Ubuntu ]
+ AUTHORITY=wsl+Ubuntu
+ [ ! -d /home/andrew/.vscode-server ]
+ dirname /mnt/c/Users/andre/.vscode/extensions/ms-vscode-remote.remote-wsl-0.44.4/scripts/wslCode.sh
+ /mnt/c/Users/andre/.vscode/extensions/ms-vscode-remote.remote-wsl-0.44.4/scripts/wslDownload.sh db40434f562994116e5b21c24015a2e40b2504e6 stable /home/andrew/.vscode-server/bin
+ [ ! -d /home/andrew/.vscode-server/bin/db40434f562994116e5b21c24015a2e40b2504e6 ]
+ RC=0
+ [ 0 -ne 0 ]
+ dirname /mnt/c/Users/andre/.vscode/extensions/ms-vscode-remote.remote-wsl-0.44.4/scripts/wslCode.sh
+ VSCODE_CLIENT_COMMAND=/mnt/c/Users/andre/AppData/Local/Programs/Microsoft VS Code/Code.exe VSCODE_CLIENT_COMMAND_CWD=/mnt/c/Users/andre/.vscode/extensions/ms-vscode-remote.remote-wsl-0.44.4/scripts VSCODE_CLI_AUTHORITY=wsl+Ubuntu /home/andrew/.vscode-server/bin/db40434f562994116e5b21c24015a2e40b2504e6/bin/code .
Segmentation fault
+ exit 139

@aeschli
Copy link
Contributor

aeschli commented Aug 14, 2020

The segmentation fault occurs when running the windows exe of code (/mnt/c/Users/andre/AppData/Local/Programs/Microsoft VS Code/Code.exe)

Must be a WSL issue. Maybe related to microsoft/WSL#5274
@drewhemm You can try WSLENV="" VSCODE_WSL_DEBUG_INFO=true code .

@drewhemm
Copy link

I solved this by renaming the ~/.vscode-server directory to ~/.vscode-server.bak and then re-opening VSC. I also tried a few things like re-creating my WSL instance, but as soon as I copied the contents of my home directory over, I got the segmentation fault again.

I have copied my extensions over from the .bak folder, so it is something else that is causing the issue.

@drewhemm
Copy link

drewhemm commented Aug 14, 2020

I also used the 'opportunity' to move over to the newer Ubuntu 20.04 LTS WSL distribution. I used a regex (apt install (.+) on /var/log/apt/history.log) to get the names of all the apt packages I had installed on my previous instance and then install them all in one go. Everything else I need is in my home folder (like pip packages installed with pip install --user ansible), so the transition was quite seamless.

@Edmund-Shi
Copy link

I solved this by renaming the ~/.vscode-server directory to ~/.vscode-server.bak and then re-opening VSC.

Thanks for @drewhemm. This works for me!

@derkan
Copy link

derkan commented Aug 31, 2020

The segmentation fault occurs when running the windows exe of code (/mnt/c/Users/andre/AppData/Local/Programs/Microsoft VS Code/Code.exe)

Must be a WSL issue. Maybe related to microsoft/WSL#5274
@drewhemm You can try WSLENV="" VSCODE_WSL_DEBUG_INFO=true code .

this solution(WSLENV="") worked for me, thanks.

@aeschli
Copy link
Contributor

aeschli commented Sep 10, 2020

We have two issues on segmentation faults
a. when opening VSCode with code .
b. when VSCode is open but starting the remote server fails

This issue is for a.
It seems to be a WSL issue related to WSLENV that should be fixed soon: microsoft/WSL#5274
In the meantime set your WSLENV to empty or run with WSLENV="" code .

For b. we have #3556

Closing this issue.

@aeschli aeschli closed this as completed Sep 10, 2020
@github-actions github-actions bot locked and limited conversation to collaborators Oct 25, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants