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

ERR_BUFFER_OUT_OF_BOUNDS exception on ref.reinterpret call #50

Open
avivsalman opened this issue Nov 26, 2020 · 2 comments
Open

ERR_BUFFER_OUT_OF_BOUNDS exception on ref.reinterpret call #50

avivsalman opened this issue Nov 26, 2020 · 2 comments

Comments

@avivsalman
Copy link

avivsalman commented Nov 26, 2020

Hi, I have problem, when I'm using ref-napi 1.5.2 its work fine, but I need the napi libs for compatibility issue with electron and last node versions too, and change to 3.0.1 then I got this error when use reinterpret inside a ffi.Callback function.

captureCallback = ffi.Callback('void', ['pointer', 'uint', 'uint', 'pointer'], (ctx: any, rsv: number, dtSize: number, dt: Buffer) => { const dtReinterpreted = new dpfpdd_capture_callback_data_0(ref.reinterpret(dt, dtSize)); ..... ..... });

I hope it is useful, if need anything else please update me :)

@addaleax
Copy link
Contributor

What is dtSize in that example? You can’t use reinterpret anymore to increase the size of the underlying ArrayBuffer.

@sangshuduo
Copy link

sangshuduo commented Jan 18, 2021

I have this issue too with v3.0.1. Now it works with nodejs v12 locked version 1.5.2. But led core dump with nodejs v14.

#FailureMessage Object: 0x7ffe1e14b410
1: 0xa71261 [node]
2: 0x19d3254 V8_Fatal(char const*, ...) [node]
3: 0xe5b549 v8::internal::GlobalBackingStoreRegistry::Register(std::shared_ptrv8::internal::BackingStore) [node]
4: 0xba6a98 v8::ArrayBuffer::GetBackingStore() [node]
5: 0x9c1be0 napi_get_typedarray_info [node]
6: 0x7f6dc80fa1c8 [/home/shuduo/work/taosdata/TDengine.orig/src/connector/nodejs/node_modules/ref-napi/prebuilds/linux-x64/node.napi.node]
7: 0x7f6dc80fff5f Napi::details::CallbackData<Napi::Value ()(Napi::CallbackInfo const&), Napi::Value>::Wrapper(napi_env__, napi_callback_info__) [/home/connector/nodejs/node_modules/ref-napi/prebuilds/linux-x64/node.napi.node]
8: 0x9b8c6f [node]
9: 0xbe571b [node]
10: 0xbe6cc6 [node]
11: 0xbe7346 v8::internal::Builtin_HandleApiCall(int, unsigned long
, v8::internal::Isolate*) [node]
12: 0x14012d9 [node]
Illegal instruction (core dumped)

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

3 participants