You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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) : ObjectWrap<MyObject>(info) { throw Error::New(info.Env(), "something exceptional happened!"); } }
The 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.
Activity
objectwrap: gracefully handle constructor exceptions
objectwrap: gracefully handle constructor exceptions
objectwrap: gracefully handle constructor exceptions
objectwrap: gracefully handle constructor exceptions
objectwrap: gracefully handle constructor exceptions
objectwrap: gracefully handle constructor exceptions
objectwrap: gracefully handle constructor exceptions
objectwrap: gracefully handle constructor exceptions
objectwrap: gracefully handle constructor exceptions
objectwrap: gracefully handle constructor exceptions
objectwrap: gracefully handle constructor exceptions
objectwrap: gracefully handle constructor exceptions
objectwrap: gracefully handle constructor exceptions
objectwrap: gracefully handle constructor exceptions