mirror of
https://github.com/hickory-dns/hickory-dns.git
synced 2026-04-25 03:05:51 +03:00
[GH-ISSUE #339] Panic when serializing some messages #450
Labels
No labels
blocked
breaking-change
bug
bug:critical
bug:tests
cleanup
compliance
compliance
compliance
crate:all
crate:client
crate:native-tls
crate:proto
crate:recursor
crate:resolver
crate:resolver
crate:rustls
crate:server
crate:util
dependencies
docs
duplicate
easy
easy
enhance
enhance
enhance
feature:dns-over-https
feature:dns-over-quic
feature:dns-over-tls
feature:dnsssec
feature:global_lb
feature:mdns
feature:tsig
features:edns
has workaround
ops
perf
platform:WASM
platform:android
platform:fuchsia
platform:linux
platform:macos
platform:windows
pull-request
question
test
tools
tools
trust
unclear
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/hickory-dns#450
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @SAPikachu on GitHub (Feb 9, 2018).
Original GitHub issue: https://github.com/hickory-dns/hickory-dns/issues/339
Test case:
Backtrace:
I am using latest master code. Any hint for debugging this? :)
@bluejekyll commented on GitHub (Feb 9, 2018):
These two lines from the trace look to be the most interesting:
It looks like the label offset pointers are having a problem for some reason. My guess is that the logic around that in the serialization of the Name as it relates to the label compression is having an issue, not sure why (I did rewrite that section of code in 0.8):
https://github.com/bluejekyll/trust-dns/blob/master/proto/src/rr/domain/name.rs#L549-L592
But that looks like where it's probably coming from?
@bluejekyll commented on GitHub (Feb 9, 2018):
If you use VSCode, I like to throw this in the lldb plugin and step through the code to see what's going on, personally.
@SAPikachu commented on GitHub (Feb 10, 2018):
Thanks for the hint! It seems
Name::emit_as_canonicalstores label pointers for all labels, then rewrites one of the label in middle of the name and invalidates saved pointers beyond that label, and caused the panic. If I changetrimto:Then the test would pass. Do you see any problem with this change?
@bluejekyll commented on GitHub (Feb 10, 2018):
Ah, that was an edge condition I hadn’t considered. I think your change is correct, Nice work!
Want to submit a PR and maybe a test case (just with serialization) so that we don’t run into this against?
Thanks!
@SAPikachu commented on GitHub (Feb 10, 2018):
Oh great, will submit PR a bit later. :)