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

Crash after 15 minutes of startup #133856

Closed
ressu opened this issue Sep 27, 2021 · 14 comments · Fixed by #127320
Closed

Crash after 15 minutes of startup #133856

ressu opened this issue Sep 27, 2021 · 14 comments · Fixed by #127320
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug freeze-slow-crash-leak VS Code crashing, performance, freeze and memory leak issues linux Issues with VS Code on Linux snap Issues related to the snap package
Milestone

Comments

@ressu
Copy link

ressu commented Sep 27, 2021

Issue Type: Bug

With the snap build of vscode running on Ubuntu 21.04 (amd64), the vscode instance crashes after 15 minutes. The crash is reproducable and happens within a few seconds around the 15 minute mark.

The issue can be reproduced with --disable-extensions.

VS Code version: Code 1.60.2 (7f6ab54, 2021-09-22T12:01:43.795Z)
OS version: Linux x64 5.11.0-36-generic snap
Restricted Mode: No

System Info
Item Value
CPUs Intel(R) Core(TM) i5-4200M CPU @ 2.50GHz (4 x 3100)
GPU Status 2d_canvas: unavailable_software
gpu_compositing: disabled_software
multiple_raster_threads: enabled_on
oop_rasterization: disabled_off
opengl: disabled_off
rasterization: disabled_software
skia_renderer: enabled_on
video_decode: disabled_software
vulkan: disabled_off
webgl: unavailable_software
webgl2: unavailable_software
Load (avg) 0, 0, 0
Memory (System) 15.51GB (2.85GB free)
Process Argv --no-sandbox --wait --crash-reporter-directory /tmp/crash --disable-extensions --waitMarkerFilePath /tmp/qoumv
Screen Reader no
VM 0%
DESKTOP_SESSION ubuntu
XDG_CURRENT_DESKTOP Unity
XDG_SESSION_DESKTOP ubuntu
XDG_SESSION_TYPE wayland
Extensions disabled
A/B Experiments
vsliv368cf:30146710
vsreu685:30147344
python383:30185418
pythonvspyt602:30300191
vspor879:30202332
vspor708:30202333
vspor363:30204092
pythonvspyt639:30300192
pythontb:30283811
pythonptprofiler:30281270
vsdfh931:30280409
vshan820:30294714
vstes263:30335439
vscorecescf:30358481
pythondataviewer:30285071
pythonvsuse255:30340121
vscod805cf:30301675
pythonvspyt200:30340761
binariesv615:30325510
vsccppwtct:30364498
pythonvssor306:30344512
bridge0708:30335490
pygetstartedt2:30371810
dockerwalkthru:30370836
bridge0723:30353136
pythonrunftest32:30365366
pythonf5test824cf:30361778
javagetstartedc:30364665
pythonvspyt187cf:30365362
pydsgsc2:30361791

@ressu
Copy link
Author

ressu commented Sep 27, 2021

Attaching a dump from a crash: 81d35693-abf0-46fb-486dec96-10e9dd0d.dmp.gz

@deepak1556
Copy link
Collaborator

Can you provide the output of ldd /snap/code/current/usr/share/code. Also does the crash happen when you launch from the dock ?

@deepak1556 deepak1556 added freeze-slow-crash-leak VS Code crashing, performance, freeze and memory leak issues linux Issues with VS Code on Linux info-needed Issue requires more information from poster snap Issues related to the snap package labels Sep 28, 2021
@ressu
Copy link
Author

ressu commented Sep 28, 2021

Which file from /snap/code/current/usr/share/code do you want me to ldd? It seems to be a directory.

This happens from both the dock and from CLI.

@ressu
Copy link
Author

ressu commented Sep 28, 2021

In the interest of RTT in the bug, guessing ../code/code:

❯ ldd /snap/code/current/usr/share/code/code
        linux-vdso.so.1 (0x00007ffdb31e6000)
        libffmpeg.so => /snap/code/current/usr/share/code/libffmpeg.so (0x00007fef38df5000)
        libdl.so.2 => /snap/core/current/lib/x86_64-linux-gnu/libdl.so.2 (0x00007fef38bf1000)
        libpthread.so.0 => /snap/core/current/lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fef389d4000)
        librt.so.1 => /snap/core/current/lib/x86_64-linux-gnu/librt.so.1 (0x00007fef387cc000)
        libgobject-2.0.so.0 => /snap/code/current/usr/share/code/../../lib/x86_64-linux-gnu/libgobject-2.0.so.0 (0x00007fef38574000)
        libglib-2.0.so.0 => /snap/code/current/usr/share/code/../../lib/x86_64-linux-gnu/libglib-2.0.so.0 (0x00007fef3824d000)
        libxshmfence.so.1 => /snap/code/current/usr/share/code/../../lib/x86_64-linux-gnu/libxshmfence.so.1 (0x00007fef38049000)
        libgio-2.0.so.0 => /snap/code/current/usr/share/code/../../lib/x86_64-linux-gnu/libgio-2.0.so.0 (0x00007fef37c95000)
        libnss3.so => /snap/code/current/usr/share/code/../../lib/x86_64-linux-gnu/libnss3.so (0x00007fef37946000)
        libnssutil3.so => /snap/code/current/usr/share/code/../../lib/x86_64-linux-gnu/libnssutil3.so (0x00007fef37716000)
        libsmime3.so => /snap/code/current/usr/share/code/../../lib/x86_64-linux-gnu/libsmime3.so (0x00007fef374e6000)
        libnspr4.so => /snap/code/current/usr/share/code/../../lib/x86_64-linux-gnu/libnspr4.so (0x00007fef372a1000)
        libatk-1.0.so.0 => /snap/code/current/usr/share/code/../../lib/x86_64-linux-gnu/libatk-1.0.so.0 (0x00007fef37078000)
        libatk-bridge-2.0.so.0 => /snap/code/current/usr/share/code/../../lib/x86_64-linux-gnu/libatk-bridge-2.0.so.0 (0x00007fef36e46000)
        libdbus-1.so.3 => /snap/code/current/usr/share/code/../../../lib/x86_64-linux-gnu/libdbus-1.so.3 (0x00007fef36bf5000)
        libdrm.so.2 => /snap/code/current/usr/share/code/../../lib/x86_64-linux-gnu/libdrm.so.2 (0x00007fef369e1000)
        libgdk_pixbuf-2.0.so.0 => /snap/code/current/usr/share/code/../../lib/x86_64-linux-gnu/libgdk_pixbuf-2.0.so.0 (0x00007fef367b8000)
        libgtk-3.so.0 => /snap/code/current/usr/share/code/../../lib/x86_64-linux-gnu/libgtk-3.so.0 (0x00007fef35e63000)
        libgdk-3.so.0 => /snap/code/current/usr/share/code/../../lib/x86_64-linux-gnu/libgdk-3.so.0 (0x00007fef35b4a000)
        libpango-1.0.so.0 => /snap/code/current/usr/share/code/../../lib/x86_64-linux-gnu/libpango-1.0.so.0 (0x00007fef358f7000)
        libcairo.so.2 => /snap/code/current/usr/share/code/../../lib/x86_64-linux-gnu/libcairo.so.2 (0x00007fef355d1000)
        libm.so.6 => /snap/core/current/lib/x86_64-linux-gnu/libm.so.6 (0x00007fef352c8000)
        libX11.so.6 => /snap/code/current/usr/share/code/../../lib/x86_64-linux-gnu/libX11.so.6 (0x00007fef34f83000)
        libXcomposite.so.1 => /snap/code/current/usr/share/code/../../lib/x86_64-linux-gnu/libXcomposite.so.1 (0x00007fef34d7f000)
        libXdamage.so.1 => /snap/code/current/usr/share/code/../../lib/x86_64-linux-gnu/libXdamage.so.1 (0x00007fef34b7b000)
        libXext.so.6 => /snap/code/current/usr/share/code/../../lib/x86_64-linux-gnu/libXext.so.6 (0x00007fef34967000)
        libXfixes.so.3 => /snap/code/current/usr/share/code/../../lib/x86_64-linux-gnu/libXfixes.so.3 (0x00007fef34760000)
        libXrandr.so.2 => /snap/code/current/usr/share/code/../../lib/x86_64-linux-gnu/libXrandr.so.2 (0x00007fef34552000)
        libexpat.so.1 => /snap/code/current/usr/share/code/../../../lib/x86_64-linux-gnu/libexpat.so.1 (0x00007fef34328000)
        libxcb.so.1 => /snap/code/current/usr/share/code/../../lib/x86_64-linux-gnu/libxcb.so.1 (0x00007fef34101000)
        libxkbcommon.so.0 => /snap/code/current/usr/share/code/../../lib/x86_64-linux-gnu/libxkbcommon.so.0 (0x00007fef33ec1000)
        libgbm.so.1 => /snap/code/current/usr/share/code/../../lib/x86_64-linux-gnu/libgbm.so.1 (0x00007fef33cb2000)
        libasound.so.2 => /snap/code/current/usr/share/code/../../lib/x86_64-linux-gnu/libasound.so.2 (0x00007fef339a4000)
        libatspi.so.0 => /snap/code/current/usr/share/code/../../lib/x86_64-linux-gnu/libatspi.so.0 (0x00007fef3376e000)
        libgcc_s.so.1 => /snap/core/current/lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007fef33558000)
        libc.so.6 => /snap/core/current/lib/x86_64-linux-gnu/libc.so.6 (0x00007fef3318e000)
        /snap/core/current/lib64/ld-linux-x86-64.so.2 => /lib64/ld-linux-x86-64.so.2 (0x00007fef411c3000)
        libffi.so.6 => /snap/code/current/usr/share/code/../../lib/x86_64-linux-gnu/libffi.so.6 (0x00007fef32f85000)
        libpcre.so.3 => /snap/code/current/usr/share/code/../../lib/x86_64-linux-gnu/../../../lib/x86_64-linux-gnu/libpcre.so.3 (0x00007fef32d14000)
        libgmodule-2.0.so.0 => /snap/code/current/usr/share/code/../../lib/x86_64-linux-gnu/libgmodule-2.0.so.0 (0x00007fef32b0d000)
        libz.so.1 => /snap/code/current/usr/share/code/../../lib/x86_64-linux-gnu/../../../lib/x86_64-linux-gnu/libz.so.1 (0x00007fef328f2000)
        libselinux.so.1 => /snap/core/current/lib/x86_64-linux-gnu/libselinux.so.1 (0x00007fef326d0000)
        libresolv.so.2 => /snap/core/current/lib/x86_64-linux-gnu/libresolv.so.2 (0x00007fef324b5000)
        libmount.so.1 => /snap/core/current/lib/x86_64-linux-gnu/libmount.so.1 (0x00007fef3226e000)
        libplc4.so => /snap/code/current/usr/share/code/../../lib/x86_64-linux-gnu/libplc4.so (0x00007fef32066000)
        libplds4.so => /snap/code/current/usr/share/code/../../lib/x86_64-linux-gnu/libplds4.so (0x00007fef31e61000)
        libsystemd.so.0 => /snap/core/current/lib/x86_64-linux-gnu/libsystemd.so.0 (0x00007fef31ddc000)
        libpangocairo-1.0.so.0 => /snap/code/current/usr/share/code/../../lib/x86_64-linux-gnu/libpangocairo-1.0.so.0 (0x00007fef31bcd000)
        libXi.so.6 => /snap/code/current/usr/share/code/../../lib/x86_64-linux-gnu/libXi.so.6 (0x00007fef319bc000)
        libcairo-gobject.so.2 => /snap/code/current/usr/share/code/../../lib/x86_64-linux-gnu/libcairo-gobject.so.2 (0x00007fef317b0000)
        libepoxy.so.0 => /snap/code/current/usr/share/code/../../lib/x86_64-linux-gnu/libepoxy.so.0 (0x00007fef3149e000)
        libpangoft2-1.0.so.0 => /snap/code/current/usr/share/code/../../lib/x86_64-linux-gnu/libpangoft2-1.0.so.0 (0x00007fef31285000)
        libfontconfig.so.1 => /snap/code/current/usr/share/code/../../lib/x86_64-linux-gnu/libfontconfig.so.1 (0x00007fef3103f000)
        libXinerama.so.1 => /snap/code/current/usr/share/code/../../lib/x86_64-linux-gnu/libXinerama.so.1 (0x00007fef30e3b000)
        libXcursor.so.1 => /snap/code/current/usr/share/code/../../lib/x86_64-linux-gnu/libXcursor.so.1 (0x00007fef30c2e000)
        libwayland-cursor.so.0 => /snap/code/current/usr/share/code/../../lib/x86_64-linux-gnu/libwayland-cursor.so.0 (0x00007fef30a25000)
        libwayland-egl.so.1 => /snap/code/current/usr/share/code/../../lib/x86_64-linux-gnu/libwayland-egl.so.1 (0x00007fef30822000)
        libwayland-client.so.0 => /snap/code/current/usr/share/code/../../lib/x86_64-linux-gnu/libwayland-client.so.0 (0x00007fef30612000)
        libmirclient.so.9 => /snap/code/current/usr/share/code/../../lib/x86_64-linux-gnu/libmirclient.so.9 (0x00007fef3035e000)
        libthai.so.0 => /snap/code/current/usr/share/code/../../lib/x86_64-linux-gnu/libthai.so.0 (0x00007fef30152000)
        libpixman-1.so.0 => /snap/code/current/usr/share/code/../../lib/x86_64-linux-gnu/libpixman-1.so.0 (0x00007fef2fea8000)
        libfreetype.so.6 => /snap/code/current/usr/share/code/../../lib/x86_64-linux-gnu/libfreetype.so.6 (0x00007fef2fbf1000)
        libpng16.so.16 => /snap/code/current/usr/share/code/../../lib/x86_64-linux-gnu/libpng16.so.16 (0x00007fef2f9bd000)
        libxcb-shm.so.0 => /snap/code/current/usr/share/code/../../lib/x86_64-linux-gnu/libxcb-shm.so.0 (0x00007fef2f7b8000)
        libxcb-render.so.0 => /snap/code/current/usr/share/code/../../lib/x86_64-linux-gnu/libxcb-render.so.0 (0x00007fef2f5aa000)
        libXrender.so.1 => /snap/code/current/usr/share/code/../../lib/x86_64-linux-gnu/libXrender.so.1 (0x00007fef2f39f000)
        libXau.so.6 => /snap/code/current/usr/share/code/../../lib/x86_64-linux-gnu/libXau.so.6 (0x00007fef2f19a000)
        libXdmcp.so.6 => /snap/code/current/usr/share/code/../../lib/x86_64-linux-gnu/libXdmcp.so.6 (0x00007fef2ef93000)
        libwayland-server.so.0 => /snap/code/current/usr/share/code/../../lib/x86_64-linux-gnu/libwayland-server.so.0 (0x00007fef2ed7e000)
        libblkid.so.1 => /snap/core/current/lib/x86_64-linux-gnu/libblkid.so.1 (0x00007fef2eb3b000)
        liblzma.so.5 => /snap/core/current/lib/x86_64-linux-gnu/liblzma.so.5 (0x00007fef2e919000)
        libgcrypt.so.20 => /snap/core/current/lib/x86_64-linux-gnu/libgcrypt.so.20 (0x00007fef2e638000)
        libharfbuzz.so.0 => /snap/code/current/usr/share/code/../../lib/x86_64-linux-gnu/libharfbuzz.so.0 (0x00007fef2e3a0000)
        libuuid.so.1 => /snap/core/current/lib/x86_64-linux-gnu/libuuid.so.1 (0x00007fef2e199000)
        libmircommon.so.7 => /snap/code/current/usr/share/code/../../lib/x86_64-linux-gnu/libmircommon.so.7 (0x00007fef2df49000)
        libmirprotobuf.so.3 => /snap/code/current/usr/share/code/../../lib/x86_64-linux-gnu/libmirprotobuf.so.3 (0x00007fef2dcc3000)
        libcapnp-0.5.3.so => /snap/code/current/usr/share/code/../../lib/x86_64-linux-gnu/libcapnp-0.5.3.so (0x00007fef2da23000)
        libmircore.so.1 => /snap/code/current/usr/share/code/../../lib/x86_64-linux-gnu/libmircore.so.1 (0x00007fef2d818000)
        libboost_system.so.1.58.0 => /snap/code/current/usr/share/code/../../lib/x86_64-linux-gnu/libboost_system.so.1.58.0 (0x00007fef2d611000)
        libprotobuf-lite.so.9 => /snap/code/current/usr/share/code/../../lib/x86_64-linux-gnu/libprotobuf-lite.so.9 (0x00007fef2d3d7000)
        libstdc++.so.6 => /snap/core/current/usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007fef2d055000)
        libdatrie.so.1 => /snap/code/current/usr/share/code/../../lib/x86_64-linux-gnu/libdatrie.so.1 (0x00007fef2ce4c000)
        libgpg-error.so.0 => /snap/core/current/lib/x86_64-linux-gnu/libgpg-error.so.0 (0x00007fef2cc38000)
        libgraphite2.so.3 => /snap/code/current/usr/share/code/../../lib/x86_64-linux-gnu/libgraphite2.so.3 (0x00007fef2ca0f000)
        libboost_filesystem.so.1.58.0 => /snap/code/current/usr/share/code/../../lib/x86_64-linux-gnu/libboost_filesystem.so.1.58.0 (0x00007fef2c7f3000)
        libkj-0.5.3.so => /snap/code/current/usr/share/code/../../lib/x86_64-linux-gnu/libkj-0.5.3.so (0x00007fef2c5c2000)

@deepak1556 deepak1556 removed the info-needed Issue requires more information from poster label Sep 28, 2021
@deepak1556
Copy link
Collaborator

Can you check if the issue repros with latest stable 1.61 ?

@ressu
Copy link
Author

ressu commented Oct 12, 2021

Confirmed to be reproducible on 1.61.0

Full version string:

Version: 1.61.0
Commit: ee8c7def80afc00dd6e593ef12f37756d8f504ea
Date: 2021-10-07T18:11:02.929Z
Electron: 13.5.1
Chrome: 91.0.4472.164
Node.js: 14.16.0
V8: 9.1.269.39-electron.0
OS: Linux x64 5.11.0-37-generic snap

@deepak1556
Copy link
Collaborator

Is this still an issue with latest stable 1.73 which comes with newer runtime.

@deepak1556 deepak1556 added info-needed Issue requires more information from poster and removed freeze-slow-crash-leak VS Code crashing, performance, freeze and memory leak issues labels Dec 7, 2022
@ressu
Copy link
Author

ressu commented Dec 11, 2022

Just checked and confirmed that the issue is still there.

❯ /snap/bin/code --wait

~ took 15m7s 
❯ snap info code    
name:      code
summary:   Code editing. Redefined.
publisher: Visual Studio Code (vscode✓)
store-url: https://snapcraft.io/code
contact:   https://twitter.com/code
license:   unset
description: |
  Visual Studio Code is a new choice of tool that combines the
  simplicity of a code editor with what developers need for the core
  edit-build-debug cycle.
commands:
  - code
  - code.url-handler
snap-id:      Ht0aUHi7ofh9Fbwh6m7jUN2pAy6kzBiu
tracking:     latest/stable
refresh-date: yesterday at 13:57 GMT
channels:
  latest/stable:    5235c6bb 2022-12-07 (114) 254MB classic
  latest/candidate: ↑                               
  latest/beta:      ↑                               
  latest/edge:      ↑                               
installed:          5235c6bb            (114) 254MB classic

@deepak1556
Copy link
Collaborator

Thanks for confirming, can you attach the new crash dumps since 1.73 has updated runtime.

@joaomoreno joaomoreno assigned joaomoreno and unassigned deepak1556 Dec 12, 2022
@ressu
Copy link
Author

ressu commented Dec 16, 2022

Let's see if this is a full dump. I've attempted multiple times but the dump never seems to complete and is left in the pending directory.. So let's see if this works.

04d1b3c7-68ab-49f7-a6f6-78ff73a4d68a.dmp.gz

@deepak1556
Copy link
Collaborator

deepak1556 commented Dec 20, 2022

Thanks for the crash logs, based on the trace you are hitting the same issue as #138385. Do you use a smart card reader, I am confused as to why libpcsclite.so.1 gets loaded into VSCode process when we don't use it. Couple of follow-ups,

  1. Can you run with the following command snap run --strace="-o code_strace.log -DD -qq -e trace=file" code and attach the log once the crash happens

  2. Can you check if the issue repros with our deb package.

@ressu
Copy link
Author

ressu commented Dec 20, 2022

I do have a smartcard reader, but "using it" is over selling it. But it indeed is connected to the machine.

  1. Here is a strace log collected from a crashing process: code_strace.log.gz
  2. deb works normally. That's my daily driver for any VS code needs.

@deepak1556 deepak1556 added bug Issue identified by VS Code Team member as probable bug freeze-slow-crash-leak VS Code crashing, performance, freeze and memory leak issues and removed info-needed Issue requires more information from poster labels Dec 21, 2022
@deepak1556
Copy link
Collaborator

Thanks for the logs, can confirm the library being loaded when accessing nssdb in your case very likely cofigured by the presence of the reader.

2512142 stat("/home/ressu/.pki/nssdb/cert9.db-journal", 0x7f8470a0dda0) = -1 ENOENT (No such file or directory)
2512142 stat("/home/ressu/.pki/nssdb/cert9.db-wal", 0x7f8470a0dda0) = -1 ENOENT (No such file or directory)
2512142 open("/usr/lib64/libcryptoki.so", O_RDONLY|O_CLOEXEC) = 111
2512142 open("/snap/code/115/usr/share/code/libpcsclite.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
2512142 open("/snap/code/115/usr/share/code/../../lib/x86_64-linux-gnu/libpcsclite.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
2512142 open("/snap/code/115/usr/share/code/../../../lib/x86_64-linux-gnu/libpcsclite.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
2512142 open("/snap/core/current/usr/lib/x86_64-linux-gnu/libpcsclite.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
2512142 open("/snap/core/current/lib/x86_64-linux-gnu/libpcsclite.so.1", O_RDONLY|O_CLOEXEC) = 111

Currently our snap base image is based on Ubuntu 16.04 which definitely contains an older version of the library that hits this bug https://bugs.launchpad.net/ubuntu/+source/pcsc-lite/+bug/294830, this should be addressed once we update our snap core, refs #127320. Please continue to use deb package till then.

@ressu
Copy link
Author

ressu commented Dec 21, 2022

That's a good find. I confirmed that this is indeed the case. Starting code with an empty $HOME gets rid of the problem. Copying ~/.pki to the empty home causes the crash to reappear. And of course deleting $HOME/.pki makes the issue go away again.

So I think we now know the root cause for certain.

@joaomoreno joaomoreno removed their assignment Jan 3, 2023
@joaomoreno joaomoreno added this to the Backlog milestone Jan 3, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Apr 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug freeze-slow-crash-leak VS Code crashing, performance, freeze and memory leak issues linux Issues with VS Code on Linux snap Issues related to the snap package
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants