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

Debug break in VM context crashes process #15672

Closed
TimothyGu opened this issue Sep 29, 2017 · 4 comments
Closed

Debug break in VM context crashes process #15672

TimothyGu opened this issue Sep 29, 2017 · 4 comments
Labels
c++ Issues and PRs that require attention from people who are familiar with C++. inspector Issues and PRs related to the V8 inspector protocol vm Issues and PRs related to the vm subsystem.

Comments

@TimothyGu
Copy link
Member

TimothyGu commented Sep 29, 2017

  • Version: master
  • Platform: Linux debian-x240s 4.9.0-3-amd64 SMP Debian 4.9.30-2+deb9u5 (2017-09-19) x86_64 GNU/Linux
  • Subsystem: src
'use strict';

const vm = require('vm');

const a = vm.createContext();
vm.runInContext('debugger', a);
$ ./node --inspect-brk vm-bug.js
Debugger listening on ws://127.0.0.1:9229/1a67d441-2caa-41f7-9771-481d1fb8a40d
For help see https://nodejs.org/en/docs/inspector
Debugger attached.
/home/timothy-gu/dev/node/node/out/Release/node[19145]: ../src/node.cc:1369:node::InternalCallbackScope::InternalCallbackScope(node::Environment *, Local<v8::Object>, const node::async_context &, node::InternalCallbackScope::ResourceExpectation): Assertion `(env->context()) == (env->isolate()->GetCurrentContext())' failed.
 1: node::Abort() [./node]
 2: 0x10b323e [./node]
 3: node::InternalCallbackScope::InternalCallbackScope(node::Environment*, v8::Local<v8::Object>, node::async_context const&, node::InternalCallbackScope::ResourceExpectation) [./node]
 4: node::NodePlatform::FlushForegroundTasksInternal() [./node]
 5: node::inspector::NodeInspectorClient::runMessageLoopOnPause(int) [./node]
 6: v8_inspector::V8Debugger::handleProgramBreak(v8::Local<v8::Context>, v8::Local<v8::Object>, v8::Local<v8::Value>, v8::Local<v8::Array>, bool, bool) [./node]
 7: v8_inspector::V8Debugger::BreakProgramRequested(v8::Local<v8::Context>, v8::Local<v8::Object>, v8::Local<v8::Value>) [./node]
 8: v8::internal::Debug::OnDebugBreak(v8::internal::Handle<v8::internal::Object>) [./node]
 9: v8::internal::Debug::HandleDebugBreak(v8::internal::IgnoreBreakMode) [./node]
10: v8::internal::Runtime_HandleDebuggerStatement(int, v8::internal::Object**, v8::internal::Isolate*) [./node]
11: 0x3bf47af8463d
Aborted

Probably a regression introduced in f27b5e4.

/cc @addaleax

@TimothyGu TimothyGu added c++ Issues and PRs that require attention from people who are familiar with C++. inspector Issues and PRs related to the V8 inspector protocol vm Issues and PRs related to the vm subsystem. labels Sep 29, 2017
@TimothyGu
Copy link
Member Author

Note: #15639 does not fix this.

@eugeneo
Copy link
Contributor

eugeneo commented Sep 29, 2017

I can confirm that reverting f27b5e4 makes this issue go away. I am now looking into it.

@eugeneo
Copy link
Contributor

eugeneo commented Sep 29, 2017

This is caused by InternalCallbackScope being created in RunForegroundTask(Task* task)

@addaleax Can you please take a look?

@addaleax
Copy link
Member

@eugeneo PR is in #15691 :)

addaleax added a commit to addaleax/node that referenced this issue Oct 2, 2017
Make the context check in `MakeCallback` match what the comment says
(and what actually makes sense).

Fixes: nodejs#15672
Ref: nodejs#15428
Ref: f27b5e4
addaleax added a commit to addaleax/ayo that referenced this issue Oct 12, 2017
Make the context check in `MakeCallback` match what the comment says
(and what actually makes sense).

PR-URL: nodejs/node#15691
Fixes: nodejs/node#15672
Ref: nodejs/node#15428
Ref: f27b5e4bdaafc73a830a0451ee3c641b8bcd08fe
Reviewed-By: Refael Ackermann <[email protected]>
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: Eugene Ostroukhov <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Timothy Gu <[email protected]>
Reviewed-By: Tobias Nießen <[email protected]>
addaleax added a commit to addaleax/node that referenced this issue Oct 14, 2017
Make the context check in `MakeCallback` match what the comment says
(and what actually makes sense).

PR-URL: nodejs#15691
Fixes: nodejs#15672
Ref: nodejs#15428
Ref: f27b5e4
Reviewed-By: Refael Ackermann <[email protected]>
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: Eugene Ostroukhov <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Timothy Gu <[email protected]>
Reviewed-By: Tobias Nießen <[email protected]>
targos pushed a commit that referenced this issue Oct 18, 2017
Make the context check in `MakeCallback` match what the comment says
(and what actually makes sense).

PR-URL: #15691
Fixes: #15672
Ref: #15428
Ref: f27b5e4
Reviewed-By: Refael Ackermann <[email protected]>
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: Eugene Ostroukhov <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Timothy Gu <[email protected]>
Reviewed-By: Tobias Nießen <[email protected]>
targos pushed a commit that referenced this issue Oct 18, 2017
Make the context check in `MakeCallback` match what the comment says
(and what actually makes sense).

PR-URL: #15691
Fixes: #15672
Ref: #15428
Ref: f27b5e4
Reviewed-By: Refael Ackermann <[email protected]>
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: Eugene Ostroukhov <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Timothy Gu <[email protected]>
Reviewed-By: Tobias Nießen <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c++ Issues and PRs that require attention from people who are familiar with C++. inspector Issues and PRs related to the V8 inspector protocol vm Issues and PRs related to the vm subsystem.
Projects
None yet
Development

No branches or pull requests

3 participants