Title: GC Crash With ObjectWrap + Exceptions · Issue #599 · nodejs/node-addon-api · GitHub
Open Graph Title: GC Crash With ObjectWrap + Exceptions · Issue #599 · nodejs/node-addon-api
X Title: GC Crash With ObjectWrap + Exceptions · Issue #599 · nodejs/node-addon-api
Description: I am seeing crashes in the V8 GC when I have ObjectWraps that throw in subclass constructors. Example: class MyObject : public ObjectWrap
Open Graph Description: I am seeing crashes in the V8 GC when I have ObjectWraps that throw in subclass constructors. Example: class MyObject : public ObjectWrap
X Description: I am seeing crashes in the V8 GC when I have ObjectWraps that throw in subclass constructors. Example: class MyObject : public ObjectWrap<MyObject> { MyObject(const CallbackInfo& info) : ...
Opengraph URL: https://github.com/nodejs/node-addon-api/issues/599
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"GC Crash With ObjectWrap + Exceptions","articleBody":"I am seeing crashes in the V8 GC when I have ObjectWraps that throw in subclass constructors. Example:\r\n\r\n`class MyObject : public ObjectWrap\u003cMyObject\u003e {\r\n MyObject(const CallbackInfo\u0026 info) : ObjectWrap\u003cMyObject\u003e(info) {\r\n throw Error::New(info.Env(), \"something exceptional happened!\");\r\n }\r\n}`\r\n\r\nThe ObjectWrap constructor will create a napi_ref for the object, associate this pointer and register a finalizer. If the subclass throws, the C++ runtime invalidates the this pointer. However, the pointer is still registered with the napi_ref. When the GC gets to the object, the finalizer tries to delete the invalid this and the system may crash.","author":{"url":"https://github.com/dananderson","@type":"Person","name":"dananderson"},"datePublished":"2019-11-12T20:43:07.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/599/node-addon-api/issues/599"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:9e6d9f00-e382-45c4-bbc9-e9eddd405e3a |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D200:141FAF:F36D02:152205A:6A4E8FB2 |
| html-safe-nonce | bb8a81de7a1bec3509b5d6ac38f55d4abdac12dabec1e2fda60015816db157ad |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEMjAwOjE0MUZBRjpGMzZEMDI6MTUyMjA1QTo2QTRFOEZCMiIsInZpc2l0b3JfaWQiOiI0NTE2NjIzNTExODg4NzYwNzU1IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | e1193700258ed89ffe6c9a67b3742f6664fdb5d9e7a96ea563b60fe8e0dc6c3b |
| hovercard-subject-tag | issue:521791010 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/nodejs/node-addon-api/599/issue_layout |
| twitter:image | https://opengraph.githubassets.com/a67c45a7d37e1462fcc8c417538d81e4f5bbf1361b3ad72e63691a9978af3560/nodejs/node-addon-api/issues/599 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/a67c45a7d37e1462fcc8c417538d81e4f5bbf1361b3ad72e63691a9978af3560/nodejs/node-addon-api/issues/599 |
| og:image:alt | I am seeing crashes in the V8 GC when I have ObjectWraps that throw in subclass constructors. Example: class MyObject : public ObjectWrap |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | dananderson |
| hostname | github.com |
| expected-hostname | github.com |
| None | 41b6ab3ba6d20a71766ac245b5a4a94c6fc672a9cd4da7d44c1b33ab8bf6a21c |
| turbo-cache-control | no-preview |
| go-import | github.com/nodejs/node-addon-api git https://github.com/nodejs/node-addon-api.git |
| octolytics-dimension-user_id | 9950313 |
| octolytics-dimension-user_login | nodejs |
| octolytics-dimension-repository_id | 81384578 |
| octolytics-dimension-repository_nwo | nodejs/node-addon-api |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81384578 |
| octolytics-dimension-repository_network_root_nwo | nodejs/node-addon-api |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | e6a744804e8e70f97b4d5a18a94dcc63db22f97a |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width