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

crash app when call function export from Nan::Export #980

Open
giangtran99 opened this issue Nov 1, 2024 · 0 comments
Open

crash app when call function export from Nan::Export #980

giangtran99 opened this issue Nov 1, 2024 · 0 comments

Comments

@giangtran99
Copy link

  • Problem:
    i try to use Nan::Export but when i call function export from Nan::Export, it cause crash app,
    i debug nan_callbacks_12_inl.h and i see that error occur at callstack function :

obj->GetInternalField(kFunctionIndex)
---I::GetInstanceType(obj);
----------ReadRawField<uint16_t>(map, kMapInstanceTypeOffset);

void FunctionCallbackWrapper(const v8::FunctionCallbackInfo<v8::Value> &info) {
  v8::Local<v8::Object> obj = info.Data().As<v8::Object>();
  FunctionCallback callback = reinterpret_cast<FunctionCallback>(
      reinterpret_cast<intptr_t>(
          obj->GetInternalField(kFunctionIndex) // -> error line
          .As<v8::Value>().As<v8::External>()->Value()));
  FunctionCallbackInfo<v8::Value>
      cbinfo(info, obj->GetInternalField(kDataIndex).As<v8::Value>());
  callback(cbinfo);
}
  • Enviroment:
    electronjs : 32.2.0
    nan: 2.22.0
    v8 : 12.8.374.36-electron.0
    node : 20.18.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant