-
Notifications
You must be signed in to change notification settings - Fork 452
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
Shared memory buffer causes crash #799
Comments
I've been working on this all day and any sort of buffer I use causes a crash. |
Both your links are broken i.e. resulting in 404. |
That's because I changed my code a bunch since I couldn't get help. |
Hi @RossComputerGuy , I was not able to reproduce your issue in your code. I stubbed out the definitions of |
Those come from https://github.com/emoon/minifb |
I'm also facing this issue but only when I use node 14.x (on 10 and 12, everything is fine). This time for my project https://github.com/melchor629/node-flac-bindings. I always have the crash when I run the tests:
The crash happens when I create a |
This issue is stale because it has been open many days with no activity. It will be closed soon unless the stale label is removed or a comment is made. |
This looks like it is related to: nodejs/node#32463 and this https://monorail-prod.appspot.com/p/v8/issues/detail?id=9908 which is quoted as indicating that it is intentional. |
Is there any method to workaround this issue? |
There isn't any that I know of |
I found like a workaround, but just if you can control the scope of the buffers: when the buffer is no longer needed, size_t sharedMemoryLength = /* ... */;
uint8_t* sharedMemory = /* ... */;
// wrap into node Buffer
auto jsBuffer = napi::Buffer::New(env, sharedMemory, sharedMemoryLength);
// send it to JS
someJsCallback({jsBuffer});
// detach after use
jsBuffer.ArrayBuffer().Detach(); For C++ wrapped objects that contains some pointers to shared memory, instead I cache the
Hope it helps. |
Header: https://github.com/emberliteOS/core/blob/v1.1.x/include/shell/window.h
Code: https://github.com/emberliteOS/core/blob/v1.1.x/src/shell/window.cc
Related function in my code:
Window::GetBuffer
Repl shows the buffer for a second then it crashes. I have no idea why this crash is happening and how to fix it.
The text was updated successfully, but these errors were encountered: