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

Debugging across http requests throws exception #3682

Closed
willm opened this issue Nov 5, 2015 · 8 comments
Closed

Debugging across http requests throws exception #3682

willm opened this issue Nov 5, 2015 · 8 comments
Labels
tls Issues and PRs related to the tls subsystem.

Comments

@willm
Copy link

willm commented Nov 5, 2015

Hi,

I hope this is the right place to post this, but I think I've found an issue with node debug.

Given this code in test.js:

var http = require('https');
http.get('https://nodejs.org', function (res) {
    debugger;
}).on('error', function (e) {
    throw e;
});
node debug test.js                                                                                                               20 ↵
< Debugger listening on port 5858
debug> . ok
break in test/t.js:1
> 1 var http = require('https');
  2     http.get('https://nodejs.org', function (res) {
  3         debugger;
debug> c
break in test/t.js:3
  1 var http = require('https');
  2     http.get('https://nodejs.org', function (res) {
> 3         debugger;
  4     }).on('error', function (e) {
debug> repl
Press Ctrl + C to leave debug repl
> res
< iojs: ../src/util-inl.h:196: TypeName* node::Unwrap(v8::Local<v8::Object>) [with TypeName = node::TLSWrap]: Assertion `(object->InternalFieldCount()) > (0)' failed.
program terminated

I think this should be allowing me to inspect the res object. Not sure if this is a node or V8 issue though. I'm running node 4.0.0 on Ubuntu 14.04.3 LTS

node --version
v4.0.0
@mscdex mscdex added tls Issues and PRs related to the tls subsystem. debugger labels Nov 5, 2015
@bnoordhuis
Copy link
Member

Is it possible that you have an older iojs binary on your PATH? The iojs: in the assert message is suspicious.

@willm
Copy link
Author

willm commented Nov 6, 2015

It's possible (I use n to manage multiple node/iojs versions). So I tried to mitigate this using the node:4.0.0 docker image and still get an error, but no mention of iojs.

node debug test.js
< Debugger listening on port 5858
debug> . ok
break in /test.js:1
> 1 var http = require('https');
  2 http.get('https://nodejs.org', function (res) {
  3     debugger;
debug> c
break in /test.js:3
  1 var http = require('https');
  2 http.get('https://nodejs.org', function (res) {
> 3     debugger;
  4 }).on('error', function (e) {
  5     throw e;
debug> repl
Press Ctrl + C to leave debug repl
> res
< node: ../src/util-inl.h:196: TypeName* node::Unwrap(v8::Local<v8::Object>) [with TypeName = node::TLSWrap]: Assertion `(object->InternalFieldCount()) > (0)' failed.
program terminated

@willm willm closed this as completed Nov 6, 2015
@willm willm reopened this Nov 6, 2015
@Fishrock123
Copy link
Contributor

It's possible v4.0.0 had a missed error message somewhere, @willm can I get you to try v4.2.2?

@willm
Copy link
Author

willm commented Nov 6, 2015

Same issue with 4.2.2, it seems to go way back (I also tried 0.10.40)

node debug test.js 
< Debugger listening on port 5858
debug> . ok
break in /test.js:1
> 1 var http = require('https');
  2 http.get('https://nodejs.org', function (res) {
  3     debugger;
debug> c
break in /test.js:3
  1 var http = require('https');
  2 http.get('https://nodejs.org', function (res) {
> 3     debugger;
  4 }).on('error', function (e) {
  5     throw e;
debug> repl
Press Ctrl + C to leave debug repl
> res
< node: ../src/util-inl.h:196: TypeName* node::Unwrap(v8::Local<v8::Object>) [with TypeName = node::TLSWrap]: Assertion `(object->InternalFieldCount()) > (0)' failed.
program terminated
debug> 
(^C again to quit)
debug> 
root@499efe4fee8e:/# node -v
v4.2.2

@Fishrock123
Copy link
Contributor

cc @indutny

@srl295
Copy link
Member

srl295 commented Jan 9, 2016

Is this nodejs/node-v0.x-archive#9028 ? because that's also reproducible on v5.1.0
> process.binding('crypto').Connection.prototype
--> crash

@willm
Copy link
Author

willm commented Jan 9, 2016

It looks like it could well be the case. I've tested all the versions and can confirm that the regression happened in 0.11.14 (0.11.13 works fine)

@YouriT
Copy link

YouriT commented Mar 2, 2016

+1

bnoordhuis added a commit to bnoordhuis/io.js that referenced this issue Mar 2, 2016
* Restrict the receiver to instances of the FunctionTemplate.
* Use `args.This()` instead of `args.Holder()`.

Fixes: nodejs#3682
PR-URL: nodejs#5521
Reviewed-By: Fedor Indutny <fedor@indutny.com>
Fishrock123 pushed a commit that referenced this issue Mar 2, 2016
* Restrict the receiver to instances of the FunctionTemplate.
* Use `args.This()` instead of `args.Holder()`.

Fixes: #3682
PR-URL: #5521
Reviewed-By: Fedor Indutny <fedor@indutny.com>
MylesBorins pushed a commit that referenced this issue Mar 17, 2016
* Restrict the receiver to instances of the FunctionTemplate.
* Use `args.This()` instead of `args.Holder()`.

Fixes: #3682
PR-URL: #5521
Reviewed-By: Fedor Indutny <fedor@indutny.com>
MylesBorins pushed a commit that referenced this issue Mar 21, 2016
* Restrict the receiver to instances of the FunctionTemplate.
* Use `args.This()` instead of `args.Holder()`.

Fixes: #3682
PR-URL: #5521
Reviewed-By: Fedor Indutny <fedor@indutny.com>
MylesBorins pushed a commit that referenced this issue Mar 21, 2016
* Restrict the receiver to instances of the FunctionTemplate.
* Use `args.This()` instead of `args.Holder()`.

Fixes: #3682
PR-URL: #5521
Reviewed-By: Fedor Indutny <fedor@indutny.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tls Issues and PRs related to the tls subsystem.
Projects
None yet
Development

No branches or pull requests

6 participants