Skip to content

napi_detach_arraybuffer aborts in Node 12.16.2 with an external arraybuffer #33022

Closed
@mafintosh

Description

  • Version: 12.6.2
  • Platform: mac
  • Subsystem: n-api

What steps will reproduce the bug?

When using the napi_detach_arraybuffer api in Node.js 12.16.2, with an arraybuffer created with napi_create_external_arraybuffer that has a finalise method Node aborts with a V8 error.

(Additionally a warning is produced at compile with missing headers for napi_detach_arraybuffer)

I managed to make a simple test case for it here, https://github.com/mafintosh/failing-napi-detach-with-finalise

If you install and run example.js on latest Node.js 12, it aborts. The example simply allocates and detaches an externally created arraybuffer with a dummy finaliser.

If I do the same thing without the finaliser it seems to work.

On Node.js 13+ it always seem to work in both cases.

Metadata

Assignees

No one assigned

    Labels

    node-apiIssues and PRs related to the Node-API.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions