Skip to content

Fix: segfault due to use after free in workers thread#1138

Open
constantind wants to merge 1 commit intoBlizzard:masterfrom
constantind:constantind-patch-1
Open

Fix: segfault due to use after free in workers thread#1138
constantind wants to merge 1 commit intoBlizzard:masterfrom
constantind:constantind-patch-1

Conversation

@constantind
Copy link

@constantind constantind commented Aug 22, 2025

When NodeDisconnect calls worker.WorkComplete() and Destroy() at https://github.com/Blizzard/node-rdkafka/blob/master/src/kafka-consumer.cc#L1396 sets the callback to null, while the thread is inside the loop 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() which deletes the callback, while the thread is still alive, creating use after free segmentation fault.
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

1 participant