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

Regression in inspectors when entering certain frames #32648

Closed
ptomato opened this issue Apr 4, 2020 · 2 comments
Closed

Regression in inspectors when entering certain frames #32648

ptomato opened this issue Apr 4, 2020 · 2 comments
Assignees
Labels
inspector Issues and PRs related to the V8 inspector protocol

Comments

@ptomato
Copy link

ptomato commented Apr 4, 2020

  • Version: v14.0.0-pre
  • Platform: Linux toolbox 5.4.10-200.fc31.x86_64 #1 SMP Thu Jan 9 19:58:12 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
  • Subsystem: ?

Recently on master there seems to be a regression in inspecting. For example, I can't seem to enter the constructor of EventEmitter while debugging. With node-inspect, the process exits when you try to enter an affected frame (which may be a separate bug in node-inspect), and with Chromium devtools simply nothing happens when trying to enter an affected frame. I bisected this down to commit a9fb51f.

What steps will reproduce the bug?

It's most obvious when using node-inspect. Here's a snippet that reproduces it reliably for me:

debuggerbug.js:

const EventEmitter = require('events');
new EventEmitter();

Run this in node-inspect, step to next line, then step in, and node-inspect will exit.

How often does it reproduce? Is there a required condition?

Once you hit a frame that exhibits the behaviour, it reproduces 100% of the time.

What is the expected behavior?

Debugging the snippet listed above with node 12.16.1:

$ node inspect debuggerbug.js 
< Debugger listening on ws://127.0.0.1:9229/b341c6b2-3a49-4ccb-8532-dbdde04c43a8
< For help, see: https://nodejs.org/en/docs/inspector
< Debugger attached.
Break on start in debuggerbug.js:1
> 1 const EventEmitter = require('events');
  2 new EventEmitter();
  3 
debug> n
break in debuggerbug.js:2
  1 const EventEmitter = require('events');
> 2 new EventEmitter();
  3 
debug> s
break in events.js:65
 63 
 64 function EventEmitter(opts) {
>65   EventEmitter.init.call(this, opts);
 66 }
 67 module.exports = EventEmitter;
debug>

What do you see instead?

Debugging the snippet listed above with node built from master:

$ ./node inspect debuggerbug.js
< Debugger listening on ws://127.0.0.1:9229/3c103069-28fb-4a95-ba99-a7e6ff344c72
< For help, see: https://nodejs.org/en/docs/inspector
< Debugger attached.
Break on start in debuggerbug.js:1
> 1 const EventEmitter = require('events');
  2 new EventEmitter();
  3 
debug> n
break in debuggerbug.js:2
  1 const EventEmitter = require('events');
> 2 new EventEmitter();
  3 
debug> s
debug> There was an internal error in node-inspect. Please report this bug.
No script for id: 13 - undefined
Error: No script for id: 13 - undefined
    at _pending.<computed> (internal/deps/node-inspect/lib/internal/inspect_client.js:243:27)
    at Client._handleChunk (internal/deps/node-inspect/lib/internal/inspect_client.js:213:11)
    at Socket.emit (events.js:315:20)
    at Socket.EventEmitter.emit (domain.js:485:12)
    at addChunk (_stream_readable.js:299:12)
    at readableAddChunk (_stream_readable.js:275:9)
    at Socket.Readable.push (_stream_readable.js:216:10)
    at TCP.onStreamRead (internal/stream_base_commons.js:191:23)

Additional information

It's quite possible that this uncovers a separate bug in node-inspect, but I reported it here first because it seems to affect all inspectors. Using ./node --inspect-brk debuggerbug.js with Chromium devtools, you also cannot enter the EventEmitter frame. The UI does nothing when you click the Step In button.

@mmarchini mmarchini added the inspector Issues and PRs related to the V8 inspector protocol label Apr 4, 2020
@addaleax addaleax self-assigned this Apr 5, 2020
@addaleax
Copy link
Member

addaleax commented Apr 5, 2020

@ptomato Thanks for the excellent bug report! #32672 should address this. 👍

addaleax added a commit to addaleax/node that referenced this issue Apr 5, 2020
This is necessary for `--inspect-brk-node` to work, and for the
inspector to be aware of scripts created before bootstrapping.

Fixes: nodejs#32648
Refs: nodejs#30467 (comment)
@ptomato
Copy link
Author

ptomato commented Apr 6, 2020

Thanks for the swift response, @addaleax. I verified that the linked PR fixes the problem for me.

BethGriggs pushed a commit that referenced this issue Apr 14, 2020
This is necessary for `--inspect-brk-node` to work, and for the
inspector to be aware of scripts created before bootstrapping.

Fixes: #32648
Refs: #30467 (comment)

PR-URL: #32672
Reviewed-By: Gus Caplan <[email protected]>
Reviewed-By: Eugene Ostroukhov <[email protected]>
Reviewed-By: Joyee Cheung <[email protected]>
Reviewed-By: David Carlier <[email protected]>
Reviewed-By: James M Snell <[email protected]>
addaleax added a commit to addaleax/node that referenced this issue Sep 23, 2020
This is necessary for `--inspect-brk-node` to work, and for the
inspector to be aware of scripts created before bootstrapping.

Fixes: nodejs#32648
Refs: nodejs#30467 (comment)

PR-URL: nodejs#32672
Reviewed-By: Gus Caplan <[email protected]>
Reviewed-By: Eugene Ostroukhov <[email protected]>
Reviewed-By: Joyee Cheung <[email protected]>
Reviewed-By: David Carlier <[email protected]>
Reviewed-By: James M Snell <[email protected]>
addaleax added a commit that referenced this issue Sep 23, 2020
This is necessary for `--inspect-brk-node` to work, and for the
inspector to be aware of scripts created before bootstrapping.

Fixes: #32648
Refs: #30467 (comment)

Backport-PR-URL: #35241
PR-URL: #32672
Reviewed-By: Gus Caplan <[email protected]>
Reviewed-By: Eugene Ostroukhov <[email protected]>
Reviewed-By: Joyee Cheung <[email protected]>
Reviewed-By: David Carlier <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
inspector Issues and PRs related to the V8 inspector protocol
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants