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

Breakpoint hit -> window gets focused -> VS Code freezes for some time #123257

Closed
ghost opened this issue May 7, 2021 · 42 comments · Fixed by #158260
Closed

Breakpoint hit -> window gets focused -> VS Code freezes for some time #123257

ghost opened this issue May 7, 2021 · 42 comments · Fixed by #158260
Assignees
Labels
chromium Issues and items related to Chromium debug Debug viewlet, configurations, breakpoints, adapter issues electron Issues and items related to Electron electron-17-update Issues related to electron 17 update insiders-released Patch has been released in VS Code Insiders upstream Issue identified as 'upstream' component related (exists outside of VS Code) upstream-issue-pending Issues that are caused by chromium but have not been reported due to pending minimal repro verified Verification succeeded windows VS Code on Windows issues
Milestone

Comments

@ghost
Copy link

ghost commented May 7, 2021

  • VS Code Version: 1.56.0
  • OS Version: Windows_NT x64 10.0.18363

Steps to Reproduce:

  1. Set breakpoint in js.-file
  2. Launch debug-session in browser (all breakpoints in dev-mode disabled)
  3. Switch to browser window
  4. Maximize browser (because it is just half open)
  5. Hit breakpoint
  6. VSCode blinks in taskbar -> switch back to it
  7. VSCode freezes and waits for something

Hints:

  • By avoiding step 4, this issue doesn't occur.
  • Minimizing and maximizing VSCode while its freezed solves this issue.
  • This issue also happens in insider-version of VSCode.

Does this issue occur when all extensions are disabled?: Yes

Launch configuration (no, this problem is not related to brave, it happens also in google chrome):

{
    "name": "Browser debug",
    "request": "launch",
    "type": "pwa-chrome",
    "runtimeExecutable": "C:/Program Files/BraveSoftware/Brave-Browser/Application/brave.exe",
    "runtimeArgs": ["--remote-debugging-port=9222"],
    "url": "http://127.0.0.1:5000",
    "webRoot": "${workspaceFolder}\\memory-viewer\\server",
    "pathMapping": {
        "/css": "${workspaceFolder}\\memory-viewer\\server\\static\\css",
        "/app": "${workspaceFolder}\\memory-viewer\\server\\static\\app",
        "/js": "${workspaceFolder}\\memory-viewer\\server\\static\\js"
    }       
},
@isidorn isidorn assigned connor4312 and unassigned isidorn May 7, 2021
@isidorn isidorn added debug Debug viewlet, configurations, breakpoints, adapter issues and removed new release labels May 7, 2021
@avenmore
Copy link

avenmore commented May 7, 2021

This looks like a regression of the issue mentioned in #116865, #117780, and others and declared a duplicate of #114459. It was fixed in 1.55 but it's back. Super annoying.

@ghost
Copy link
Author

ghost commented May 10, 2021

vscode-debugadapter-b6c8efc1.json.gz

First breakpoint successful, then I triggered it again with no success.

@isidorn
Copy link
Contributor

isidorn commented May 10, 2021

@MaxHausmann can you reproduce if you start vscode with
code --disable-features=CalculateNativeWinOcclusion <path to workspace/folder>

@ghost
Copy link
Author

ghost commented May 10, 2021

With
code --disable-features=CalculateNativeWinOcclusion <path to workspace/folder> this issue does not occur.
I tested it with several sizes of the browser-window (see initial text) and the breakpoint got hit instantly.

Additonal information: CMD says "Warning: 'disable-features' is not in the list of known options, but still passed to Electron/Chromium."

@isidorn isidorn added the candidate Issue identified as probable candidate for fixing in the next release label May 10, 2021
@isidorn isidorn assigned isidorn and deepak1556 and unassigned connor4312 May 10, 2021
@isidorn isidorn added electron Issues and items related to Electron windows VS Code on Windows issues and removed info-needed Issue requires more information from poster labels May 10, 2021
@isidorn
Copy link
Contributor

isidorn commented May 10, 2021

@MaxHausmann lovely thanks a lot.
This happens only on Windows, thus assigning windows flag, and it seems to be electron related thus assigning to my friend @deepak1556

We will investigate if we can fix this as part of the recovery release. If not we plan to fix it in the future

@isidorn isidorn changed the title Browser debugging: breakpoint doesn't hit or takes long to hit Breakpoint hit -> window gets focused -> VS Code freezes for some time May 10, 2021
@microsoft microsoft deleted a comment May 10, 2021
@microsoft microsoft deleted a comment from connor4312 May 10, 2021
@alexdima alexdima added this to the April 2021 Recovery milestone May 10, 2021
@isidorn
Copy link
Contributor

isidorn commented May 10, 2021

@MaxHausmann probably not related, but just to be 100% sure if you put

"debug.openDebug": "neverOpen"

In your settings, can you reproduce?

WORKAROUND
Put in your settings

"debug.focusWindowOnBreak": false

@ghost
Copy link
Author

ghost commented May 10, 2021

With

"debug.openDebug": "neverOpen"

I can reproduce the issue.

With

"debug.focusWindowOnBreak": false

(as the command says) VSCode window does not focus, but breakpoint got hit successfully.

@isidorn
Copy link
Contributor

isidorn commented May 10, 2021

@MaxHausmann thanks, but if the windows does not get focus there is no freeze?
As for the openDebug setting that is something which we changed this milestone and I just wanted to verify it is not related to this issue.

@ghost
Copy link
Author

ghost commented May 10, 2021

Yes, there is no freeze. The icon in the taskbar is also not blinking.

@deepak1556 deepak1556 removed the candidate Issue identified as probable candidate for fixing in the next release label May 12, 2021
@deepak1556 deepak1556 removed this from the April 2021 Recovery 2 milestone May 12, 2021
@enunez
Copy link

enunez commented May 4, 2022

This issue has been open for over a year now. Has there been any progress on fixing this bug? Is there an ETA? Has the root cause for the CalculateNativeWinOcclusion bug even been identified yet? I'd prefer not to add a launch flag, because I'm likely to forget to remove it once it eventually gets fixed.

This issue still happens for me on Windows 11 with all the latest updates. It also happens when I simply leave the computer unattended for a while. VSCode hangs and takes ~30s to respond to input again. Same thing happens with certain pages opened in Chrome.

@skaldesh
Copy link

skaldesh commented Jun 2, 2022

I am coming from issue 146737.
If this is the same root cause, then it is not restricted to Windows.

I am on Arch Linux with Sway WM:

Version: 1.67.2
Commit: c3511e6c69bb39013c4a4b7b9566ec1ca73fc4d5
Date: 2022-05-20T07:44:59.452Z
Electron: 17.4.3
Chromium: 98.0.4758.141
Node.js: 16.13.0
V8: 9.8.177.13-electron.0
OS: Linux x64 5.15.43-1-lts

I can confirm the bug there as well, that after switching focus from another application back to VSCode, it takes between 1-3s until VSCode becomes responsive again. I am happy to help debug, if need be.

@lorand-horvath
Copy link

lorand-horvath commented Jun 12, 2022

Solution here: #146737 (comment)

@deepak1556 deepak1556 removed this from the June 2022 milestone Jun 30, 2022
@hannah23280
Copy link

This issue still occur for v1.68.1

@lorand-horvath
Copy link

lorand-horvath commented Jul 5, 2022

This issue still occur for v1.68.1

@hanct Have you tried uninstalling completely and doing a clean install as I described here? #146737 (comment)
The problem is the cache growing to several thousands of files from the initial few hundred. So VSCode slows down to a crawl trying to process all of that.

@skaldesh
Copy link

skaldesh commented Jul 5, 2022

@lorand-horvath
This is no real solution, but a temporary fix.
VSCode must be fixed for the real solution

@lorand-horvath
Copy link

lorand-horvath commented Jul 5, 2022

@skaldesh Well, it's the ONLY solution that I could find after many months of searching and trying everything possible and impossible.
The interesting thing is that when I mentioned this solution/workaround/temporary fix (call it as you wish), the thread was promptly locked up: #146737 (comment)
Seems like someone is trying to sweep the issue under the proverbial rug...

@hannah23280
Copy link

This issue still occur for v1.68.1

@hanct Have you tried uninstalling completely and doing a clean install as I described here? #146737 (comment)
The problem is the cache growing to several thousands of files from the initial few hundred. So VSCode slows down to a crawl trying to process all of that.

I try to avoid that..cos when I start moving the code window (as suggested by others), the breakpoint appear. So I believe nothing to do with the cache sizes.

@hannah23280
Copy link

Then I also realize that sometime I don't even need to move the window, the break point response fast..but that is intermittent

@hannah23280
Copy link

For now, I try not to do anything so that when there is a fix, I have a broken vscode to prove this fix is working.

@Cr4zyEight
Copy link

There is a workaround on disabling this option in VS Code Settings.
By doing this u have to live with the fact that the VS Code icon will not blink in the taskbar when the debugger hits a breakpoint
But the Window will also not freeze
image

@skaldesh
Copy link

skaldesh commented Jul 8, 2022

I have opened a performance issue via code and attached a performance profile as well, since I got hit by this bug multiple times today. I am on Linux.

#154509

@vscodenpa vscodenpa added the unreleased Patch has not yet been released in VS Code Insiders label Aug 16, 2022
@vscodenpa vscodenpa added this to the August 2022 milestone Aug 16, 2022
@vscodenpa vscodenpa added insiders-released Patch has been released in VS Code Insiders and removed unreleased Patch has not yet been released in VS Code Insiders labels Aug 17, 2022
@connor4312 connor4312 added the verified Verification succeeded label Aug 25, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Oct 2, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
chromium Issues and items related to Chromium debug Debug viewlet, configurations, breakpoints, adapter issues electron Issues and items related to Electron electron-17-update Issues related to electron 17 update insiders-released Patch has been released in VS Code Insiders upstream Issue identified as 'upstream' component related (exists outside of VS Code) upstream-issue-pending Issues that are caused by chromium but have not been reported due to pending minimal repro verified Verification succeeded windows VS Code on Windows issues
Projects
None yet
Development

Successfully merging a pull request may close this issue.