-
Notifications
You must be signed in to change notification settings - Fork 30.2k
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 after use of node-canvas
lets node crash
#15099
Comments
I can reproduce this with master. I think this is caused by the devtools using the v8 inspector protocol to grab properties (by default these tools usually try to list the value all enumerable properties), the cause probably lies in the injected scripts that wrap the value being inspected. When you run the code with llnode stack trace
|
cc @nodejs/v8-inspector |
So no, I don't think this is a bug in Node.js, V8, or the Chrome Inspector, but in node-canvas's Canvas.prototype.height getter for not being as robust as it can be. In Node.js we usually wrap the C++ handle in another JS-defined object for precisely reasons like this. |
@TimothyGu Hmm, wait, I remember the Devtools usually does not call getters and display place holders for properties like this, because getters can trigger all kinds of side effects that are not really what a debugger is supposed to trigger. If the inspector is only generating a preview, to me it is not supposed to call the getter, and just return something indicating that the property has a getter. |
@joyeecheung The getter is defined as an interceptor in C++, so Dev Tools (which operates in JS) can't tell whether it's an accessor property. |
Accessors should not attempt to unwrap the non-existent 'this' when accessed via the prototype. Fixes Automattic#803 Fixes Automattic#847 Fixes Automattic#885 Fixes nodejs/node#15099
Accessors should not attempt to unwrap the non-existent 'this' when accessed via the prototype. Fixes Automattic#803 Fixes Automattic#847 Fixes Automattic#885 Fixes nodejs/node#15099
Automattic/node-canvas#855 is the current bug in node-canvas for this. I finally got around to finishing the fix for it this morning (Automattic/node-canvas#808). @TimothyGu or anyone else: in that change, I'm creating a new |
@zbjornson The |
Accessors should not attempt to unwrap the non-existent 'this' when accessed via the prototype. Fixes Automattic#803 Fixes Automattic#847 Fixes Automattic#885 Fixes nodejs/node#15099
Perfect, thanks! |
Accessors should not attempt to unwrap the non-existent 'this' when accessed via the prototype. Fixes Automattic#803 Fixes Automattic#847 Fixes Automattic#885 Fixes nodejs/node#15099
Since this has been fixed in node-canvas and it doesn't seem like there is anything to do on our side, I'll go ahead and close this out. Thanks for the bug report. |
If I have this code:
and
canvas
is"canvas": "^1.6.6",
and then I runnode --inspect=31852 --debug-brk dist/index.js
, attach the chrome debugger and I place a breakpoint on theconsole.log('done');
this will crash with:same is true for debugging with vscode.
However the same code works when running without a breakpoint/debugger. Thats why I assume a bug within node itself.
The text was updated successfully, but these errors were encountered: