nodejs / abi-stable-node

Repository used by the Node-API team to manage work related to Node-API and node-addon-api
239 stars 47 forks source link

error munmap_chunk(): invalid pointer #408

Closed helio-frota closed 3 years ago

helio-frota commented 3 years ago

Hi,

I have an example which I migrated from nan to n-api, and after the migration I'm seeing this error:

munmap_chunk(): invalid pointer
Segmentation fault (core dumped)

While I have no idea yet what munmap_chunk(): invalid pointer means, I'm still learning c/c++ so probably I can be the cause of this issue :smiley: . In other hand, the example is simple and don't uses any 3rd native dependencies, so maybe it can be more quick for you folks to identify what is happening.

NickNaso commented 3 years ago

Hi @helio-frota, which is your environment? Es. Node.js v 14.x OS: Linux arch: x64

Could I use the code that you linked to try to solve your problem?

helio-frota commented 3 years ago

Hi @NickNaso

I'm using node v14.12.0 and ubuntu 20.04 x64, feel free to use the code :+1:

NickNaso commented 3 years ago

Hi @helio-frota, I made a PR on the repo you linked in the issue after some changes all seems to work well. I hope that this could be helpful to you.

helio-frota commented 3 years ago

Thank you @NickNaso ! It is working fine, I'll learn with the changes you made. Also that approach with npx + cmake-js is much better :+1: