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

Variables in local window stop stop updating their value when stepping through code quickly #30

Closed
stevencl opened this issue Nov 16, 2015 · 11 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug verified Verification succeeded
Milestone

Comments

@stevencl
Copy link
Member

In a node express app I have the following loop:

var msg = 'hello world';
var i = 0;
while (i < 100) {
msg = msg + i.toString();
i++;
}

I set up the local and watch windows in the debugger so that I can see the msg variable in both.

When stepping through the loop, if I press F10 very quickly, eventually the msg variable in the locals window will stop updating. See the screenshot below
snip_20151116130725

When stepping through quickly, I sometimes see a message in the watch window that says 'Exception while processing request'

This is on 0.10.0

@chrisdias chrisdias added this to the Backlog milestone Nov 16, 2015
@chrisdias chrisdias added bug Issue identified by VS Code Team member as probable bug Accepting PRs and removed Accepting PRs labels Nov 16, 2015
@isidorn isidorn modified the milestones: Dec 2015, Backlog Nov 18, 2015
@isidorn
Copy link
Contributor

isidorn commented Nov 20, 2015

I can not repro this. I was even holding down F5 and all was good.
@stevencl do you still see this on latest and with latest node version (e.g 4.2.1)? If yes please reopen this issue.

@isidorn isidorn closed this as completed Nov 20, 2015
@stevencl
Copy link
Member Author

debugger
@isidorn Yes, I still see this issue in 0.10.1 and with the latest node (4.2.2). It happens when I step through the code very quickly.

@stevencl stevencl reopened this Nov 20, 2015
@jel-massih
Copy link

I am also able to replicate this. For me, it completly breaks the variable panel until restart of VS Code (can scroll but unable to expand any items and nothing gets updated)

@isidorn
Copy link
Contributor

isidorn commented Nov 23, 2015

@weinand can you please try reproing this? I can not repro on my mac machine.

@jel-massih if it breaks the variables pane it should be unrelated since for steven the pane seems to be fine. If you open the developer tools console via command palette do you see some exceptions once the variables pane is broken?

@stevencl
Copy link
Member Author

@isidorn, I have the same behaviour as @jel-massih. Here is the console log:

issue30.txt

@isidorn isidorn assigned weinand and unassigned isidorn Nov 23, 2015
@isidorn
Copy link
Contributor

isidorn commented Nov 23, 2015

This looks like an exception on the node-debug side, moving to Andre

@weinand
Copy link
Contributor

weinand commented Nov 23, 2015

@isidorn for me the problem is easily reproducible: open the dev tools console and step through the loop by keeping F10 pressed (and auto-repeat starts). You don't need a watch for this. After some time the 'index' problem occurs but the CALL STACK continues to update (line numbers of the top frame changes). But the VARIABLES view is stuck: it doesn't update and you cannot drill down into variables.

I've debugged the problem and here is my analysis:

After some time the UI sends a 'scope' request with an invalid frame id. This can happen if node-debug already got another 'step' request which has invalidated the frames of the previous step. Since node-debug did not check for this situation sufficiently, a "Cannot read property 'index' of undefined" occurs. I've fixed this problem by returning a proper error.
However, the variables UI still doesn't work because it doesn't seem to be able to recover from exceptions or proper errors returned from the 'scope' request.

Could you please try to reproduce with my steps from above and then try to fix the issue that the variables view does not recover from an exception/error returned from the 'scope' request.

@weinand weinand assigned isidorn and unassigned weinand Nov 23, 2015
@weinand weinand modified the milestones: Nov 2015 - Recovery, Backlog Nov 23, 2015
@isidorn
Copy link
Contributor

isidorn commented Nov 23, 2015

Thanks for the analysis. I will look into it following your steps.

@egamma egamma modified the milestones: Nov 2015 - end, Dec 2015 Nov 23, 2015
@isidorn
Copy link
Contributor

isidorn commented Nov 23, 2015

In case of an error I now set the scopes to []. This way all consectuive step attepts should recover the variables view.

Please note that I was still unable to repro this on my machine, so please verify instead of me.
Thanks

weinand added a commit to microsoft/vscode-node-debug that referenced this issue Nov 23, 2015
@weinand
Copy link
Contributor

weinand commented Nov 23, 2015

@isidorn @stevencl With the latest fixes in VS Code and node-debug I'm no longer able to reproduce the problem on OS X. Steven could you please try on Windows?

@stevencl
Copy link
Member Author

Thanks, I confirmed that this fix works on Windows too. Thanks!

rudygt pushed a commit to rudygt/vscode-node-debug that referenced this issue Nov 24, 2015
@isidorn isidorn added the verified Verification succeeded label Dec 15, 2015
@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 18, 2017
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 verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

6 participants