vscode: Leaking notifications make VS Code freeze

  • VSCode Version: 1.29.0 Insiders
  • OS Version: Windows

Several hangs in a row. Attached are the log files from two of the hangs which contain the error [error] [VS Code]: detected unresponsive.

InsidersHangs.zip

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 14
  • Comments: 67 (26 by maintainers)

Commits related to this issue

Most upvoted comments

why hide my comment 😹

When you fix that ?

How to revert to previous version?

Hi, I am also experiencing hang. VS Code version Version 1.29.0, macOS 10.13.6 (17G3025)

But unfortunately, because the window was unresponsive, I cannot get developer tool to launch, so I did not get any CPU profiling. But I do have control over other VS Code windows running separately to the window that frozen. Will profiling other windows produce useful information? Also, during the hang, Code Helper spiked to 100%.

Was having same issue, latest insiders seems to have fixed it, thanks for working on that.

nov-14-2018 15-29-21

I can reliably reproduce this. In above gif I have added a message that prints whenever a new listener is added, I have also tweaked the purge timeout to make things happen faster.

  1. have a sticky notification, like the update notifications or one with buttons
  2. when it pops up and within the purge timeout (15sec) focus another app
  3. now we have a sticky notification but no window focus (L222) which means we add another listener (L223) - we now have 2 listeners for that notification.
  4. Repeat steps 1-3 you have 4 listeners, then 8, 16, 32, 64, 128, etc

Eventually everything is cleaned-up (once the toast hides) but with an unlucky sequence of focus changes and because this leak grows exponential things get messy quickly. I have reached states with 500000+ listeners easily which means game over.

Vscode is Nice this frozen completly my mac hahahah

24edbb38-8459-47e4-b3fc-e44d8694ab6a

@bsendras Yeah, we already know that. We work full steam towards 1.29.1. In the meantime you can use insiders: http://code.visualstudio.com/insiders/ which already has the fix for this.

I’ve been using today’s build all day and haven’t encountered the problem so far🤞 Version 1.30.0-insider (6ef7e81ec086ced5fb20e904ea405075be474023)

Appreciate all your help @jrieken @roblourens

Everyone that is affected by this: Clearing your notifications should help to workaround this.

I was seeing this while editing a file for which I did not have the suggested extension, which triggered a popup that I didn’t bother clearing.

Hi folks,

It sees VS Code will reproduce this hang whenever it is not being worked on. Although strangely if your workspace only contains markdown or HTML this issue would not occur. Since I did not experience hang in separate VS Code windows where I was editing .md or .html files.

The window I got hang was the one I was editing .tex files with latex-workshop plugin.

@jrieken Johannes, I finally got the CPU profile. This time I profiled for 5 sec, after waiting for about 5 min I was able saved it.

My extensions are listed below.

Gimly81.matlab
austin.code-gnu-global
DavidAnson.vscode-markdownlint
DotJoshJohnson.xml
gnhuy91.theme-oceanicnext-sublime
James-Yu.latex-workshop
magicstack.MagicPython
mitaki28.vscode-clang
ms-python.python
ms-vscode.azure-account
ms-vscode.cpptools
naumovs.theme-oceanicnext
PeterJausovec.vscode-docker
PKief.material-icon-theme
redhat.java
tht13.python
vscjava.vscode-java-debug
vscjava.vscode-java-pack
vscjava.vscode-java-test
vscjava.vscode-maven
yzhang.markdown-all-in-one

CPU profile with .txt extension added CPU-20181114T084129.cpuprofile.txt

Freeze quite frequently to me as well. I have attached the cpu profile which is in .txt extension since Github not allow to upload .cpuprofile

profile.txt

VSCode Version: 1.29.0 OS Version: MacOS 10.13.6

Code Extensions:

  • CoenraadS.bracket-pair-colorizer
  • eamodio.gitlens
  • jcanero.hoogle-vscode
  • justusadam.language-haskell
  • sdras.night-owl
  • Vans.haskero
  • vscodevim.vim

@VishwaRajGit @tecosaur please help us profile this.

  • start dev tools via F1 > Developer Tools
  • open the cpu profiler via ‘More Tools > CPU Profiler’ in the overflow menu (see https://github.com/Microsoft/vscode/issues/62970#issuecomment-438164153)
  • pop-out and minimise the dev tools window
  • use vs code as usual and wait for it to slow down
  • when it hangs, freezes, or slows down, then go to dev tools and hit ‘Start’ in the CPU Profiler tab
  • profile for 5-10 seconds and press the red botton to stop profiling
  • be patient and when the profile appears, select ‘Save’, and share the profile here

nov-13-2018 18-08-19

Thanks for your help.

I’m getting this severely too. Is there any way I can roll back to the previous version?

@sgyzetrov @joseph1125 @tomaxsas Only CPU profiling will help us understand this. If the hang is very bad, then restart VS Code, start dev tools and keep them in the background, and profile when the editor is unresponsive.

What were you doing before the hangs?

I don’t think the logs have any useful info besides this error which shows up many times after the hang message in one instance

[error] SyntaxError: Unexpected token o in JSON at position 0
    at JSON.parse (<anonymous>)
    at c (C:\Users\gregvanl\AppData\Local\Programs\Microsoft VS Code Insiders\resources\app\out\vs\code\electron-main\main.js:177:254)
    at e.onBuffer (C:\Users\gregvanl\AppData\Local\Programs\Microsoft VS Code Insiders\resources\app\out\vs\code\electron-main\main.js:182:571)
    at C:\Users\gregvanl\AppData\Local\Programs\Microsoft VS Code Insiders\resources\app\out\vs\code\electron-main\main.js:180:669
    at e.fire (C:\Users\gregvanl\AppData\Local\Programs\Microsoft VS Code Insiders\resources\app\out\vs\code\electron-main\main.js:122:218)
    at C:\Users\gregvanl\AppData\Local\Programs\Microsoft VS Code Insiders\resources\app\out\vs\code\electron-main\main.js:185:795
    at C:\Users\gregvanl\AppData\Local\Programs\Microsoft VS Code Insiders\resources\app\out\vs\code\electron-main\main.js:120:478
    at C:\Users\gregvanl\AppData\Local\Programs\Microsoft VS Code Insiders\resources\app\out\vs\code\electron-main\main.js:120:705
    at e.fire (C:\Users\gregvanl\AppData\Local\Programs\Microsoft VS Code Insiders\resources\app\out\vs\code\electron-main\main.js:122:218)
    at EventEmitter.r (C:\Users\gregvanl\AppData\Local\Programs\Microsoft VS Code Insiders\resources\app\out\vs\code\electron-main\main.js:127:987)
    at emitTwo (events.js:131:20)
    at EventEmitter.emit (events.js:214:7)
    at WebContents.<anonymous> (C:\Users\gregvanl\AppData\Local\Programs\Microsoft VS Code Insiders\resources\electron.asar\browser\api\web-contents.js:286:13)
    at emitTwo (events.js:126:13)
    at WebContents.emit (events.js:214:7)

@jrieken is there any way to tie this to issues we’ve looked at lately?