Skip to content

Conversation

constantind
Copy link

@constantind constantind commented Aug 8, 2025

When NodeDisconnect calls worker.WorkComplete() and Destroy() sets the callback to null, while the thread is stopping or starting in a race, creating "use after free" segmentation fault in the message callback handler on Linux.

Closes: #1057

cc: @GaryWilber

NodeDisconnect calls worker.WorkComplete() tells V8 persistent callback to be freed, while the thread is still alive, creating use after free segmentation fault.

Fixes Blizzard#1057
@GaryWilber
Copy link
Collaborator

Would it be possible to fix this by adding the IsEmpty() check to this if statement instead of HandleMessageCallback?

@constantind
Copy link
Author

Yes, it is better in the worker itself, i will run a test and update

NodeDisconnect calls worker.WorkComplete() which deletes the callback, while the thread is still alive, creating use after free segmentation fault.
Fix: segfault due to use after free in workers thread
@constantind
Copy link
Author

Reopened new pull request #1138

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Segfault when disconnecting right after consuming
2 participants