- Version: 13.3.0
- Platform: Windows7 x64 and Ubuntu18 x64
What steps will reproduce the bug?
Error occurs when creating external buffer (node::Buffer::New) over existing node buffer with different size, this mechanism is used in the node-ffi library.
Simple reproducer:
git clone https://github.com/ZFail/node-addon-examples
cd node-addon-examples
git checkout d1b2b7505337411ecfdcdf1d6bfc4d1aaa923a1f
cd 2_function_arguments
cd node-addon-api
yarn install
node addon.js
What is the expected behavior?
output must be:
This should be 0123456789012345: 0123456789012345
This should be 01: 01
This should be 0123: 0123
What do you see instead?
This should be 0123456789012345: 0123456789012345
#
# Fatal error in , line 0
# Check failed: length == backing_store->byte_length().
#
#
#
#FailureMessage Object: 00000000001ADF80
Additional information
Seems like an error in the LookupOrCreateBackingStore function in v8. We should not do a BackingStore lookup for an external buffer.
https://github.com/nodejs/node/blob/master/deps/v8/src/api/api.cc#L7281
What steps will reproduce the bug?
Error occurs when creating external buffer (node::Buffer::New) over existing node buffer with different size, this mechanism is used in the node-ffi library.
Simple reproducer:
What is the expected behavior?
output must be:
What do you see instead?
Additional information
Seems like an error in the LookupOrCreateBackingStore function in v8. We should not do a BackingStore lookup for an external buffer.
https://github.com/nodejs/node/blob/master/deps/v8/src/api/api.cc#L7281