-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
nil ptr in defaults.go:152 msg.IsEdns0 #1614
Comments
If it helps, managed to grab a str(query) from a recent crash log:
|
thanks for that. This indeed needs a fix. Maybe I have the cycles this weekend |
(I obviously didn't have time this weekend, and also not soon) so there is an OPT rr (PADDING), and then some would nil....odd. This also happens if you (manually) in a Msg and call the above code? (PADDING is relative new, might be something fishy there) |
Unsure how the DNS msg is crafted. The app is handling the DNS queries forwarded to it by dnsmasq (on Android). If I were to hazard a guess, these queries were sent by Chrome.
Yeah, no matter what checks we added (in our code), we couldn't prevent the |
odd Do you happen to see which things nilled in |
and... tcpdump or some such?! |
Unfortunately, no. The logs are sent by app users as bug reports from Android devices in the field, if that makes sense. We've hit this nil ptr may be twice or thrice in our testing too but it is so so rare.
We added Footnotes |
Hmm, I see, but without something to trigger this it will be very hard to figure it out.
Can you get your test to dump something (even hex of a packet might help).
There can be all kinds of garbage in a dns packet, so it would be nice to get a handle on
this.
[ Quoting ***@***.***> in "Re: [miekg/dns] nil ptr in defaults..." ]
… and... tcpdump or some such?!
Unfortunately, no. The logs are sent by app users as bug reports from Android
devices in the field, if that makes sense. We've hit this nil ptr may be twice
or thrice in our testing too but it is so so rare.
Do you happen to see which things nil'd in dns.Extra[i].Header().Rrtype,
i.e. the Extra[i] or does Header() return a nil?
We tried adding a nil check on dns, on dns.Extra[i], a "deep" nil check on
dns.Extra[i].Header() ... but nothing stopped a crash as the nil ptr would
manifest elsewhere (you can follow the desperate fixes we tried here: https://
github.com/celzero/firestack/issues/96).[^0] I didn't open bugs for those, as
the nils manifest from our code. After many unsuccessful attempts, out of
exasperation, we switched to Msg.IsEdns0() as the first thing our code did, and
sure enough, hit a nil ptr, except the bug now manifested squarely in the lib
and not our code.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you commented.*Message ID: <miekg/dns/issues/
***@***.***>
|
A crash report from our app points to a nil ptr whilst iterating over Extra RRs:
dns/defaults.go
Lines 147 to 157 in b77d1ed
Unsure if it is incorrect use of the lib by our code, or something that's indicative of other issues (as I see miekg/dns codebase accessing struct fields ex:
Extra[x].Header()
all too often).(from: celzero/firestack#111)
The text was updated successfully, but these errors were encountered: