Skip to content

ERR_BUFFER_OUT_OF_BOUNDS exception on ref.reinterpret call #50

Description

@avivsalman

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 :)

Activity

  1. addaleax commented on Nov 26, 2020

    @addaleax
    Contributor

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

  2. sangshuduo commented on Jan 18, 2021

    @sangshuduo

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions