-
Notifications
You must be signed in to change notification settings - Fork 54
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
Heap corruption during authoritative resolution #5
Comments
Update: Finally a lead after so many months of head scratching... When implementing the unbound node module, I noticed a similar heap corruption in node.js. It only presented itself when the unbound context was set to async mode. It was consistent and reproducible (it seemed to cause unrecoverable memory corruption maybe 1 out of every 20 times the bns test suite was run). I'm going to guess the same issue is affecting hnsd. I hesitate to call this a bug in libunbound. It's possible that libuv and libevent don't play well with each other for some reason (?). I think the solution for now would be to call unbound's resolver synchronously in the uv thread pool (the same fix used in the unbound node module). We can leave this open to investigate the causes of this more thoroughly in the future. |
This has come up again in a branch where hnsd can discover peers and open more connections: #38 (comment) |
Got a stack trace of this:
|
Spotted this today when clicking an obfuscated twitter link. The daemon had been running locally on my laptop for a few days.
I've been unable to reproduce it, so no chance of using valgrind to track this down. The
ns: udp nodata
log implies thathsk_ns_onrecv()
successfully executed otherwise I would suspect this of being an issue with the authoritative cache that was just added. It's also not sending a message in response, so there's no cache hit there.My best guess is something funky happened in the P2P pool which corrupted the heap. I'm starting to add more debug logs so we can narrow this down when it happens again.
The text was updated successfully, but these errors were encountered: