Closed theloglizard closed 5 hours ago
@theloglizard What's the output of go version
?
go version go version go1.11.13 linux/386
@theloglizard Try building again using a more recent version of Golang (at least 1.13). It doesn't look like your Go version is respecting the replace
directive in the go.mod
file.
OK, I upgraded to go 1.14.4, deleted the previous builds (I think), and the issue remains.
The make clean was pretty minimal, so I deleted my gocode/bin and gocode/pkg which seemed to force the refetch of some dependencies, which seemed a generally good thing. The integration tests were a considerable disaster (see attached for stderr), and much like what's below.
. _ sudo snap refresh --classic --channel=1.14/stable go rm -rf ~/gocode/bin rm -rf ~/gocode/pkg make install (from the source directory with everything)
go build (from the zdns sub directory so I could run the integration tests which expect zdns/zdns)
Checking the one in my path coincides with the date and time I built-- it does. Debian:~/zdns$ ls -l `which zdns` -rwxr-xr-x 1 username username 7103083 Jun 6 08:01 /home/username/gocode/bin/zdns
Debian:\~/zdns$ date Sat 06 Jun 2020 08:07:40 AM
Debian:\~/zdns$ go version go version go1.14.4 linux/386
Debian:\~/zdns$ echo "censys.io" | zdns A {"data":{"answers":[{"answer":"104.26.11.245","class":"IN","name":"censys.io","ttl":300,"type":"A"},{"answer":"104.26.10.245","class":"IN","name":"censys.io","ttl":300,"type":"A"},{"answer":"172.67.68.81","class":"IN","name":"censys.io","ttl":300,"type":"A"}],"protocol":"udp","resolver":"192.168.0.1:53"},"name":"censys.io","status":"NOERROR","timestamp":"2020-06-06T08:07:55-04:00"}
Debian:\~/zdns$ echo "censys.io" | zdns A -iterative panic: runtime error: index out of range [-3624]
goroutine 12 [running]: github.com/zmap/zdns/cachehash.(ShardedCacheHash).getShard(...) /home/username/zdns/cachehash/shardedcachehash.go:42 github.com/zmap/zdns/cachehash.(ShardedCacheHash).Lock(0xa062394, 0x82bcc80, 0xa09c090) /home/username/zdns/cachehash/shardedcachehash.go:72 +0x5b github.com/zmap/zdns/modules/miekg.(GlobalLookupFactory).GetCachedResult(0xa062390, 0xa090007, 0x2, 0x10002, 0x3, 0x4, 0x0, 0x0, 0x0, 0x0, ...) /home/username/zdns/modules/miekg/miekg.go:194 +0x1bc github.com/zmap/zdns/modules/miekg.(Lookup).cachedRetryingLookup(0xa096030, 0x10001, 0xa090000, 0x9, 0x82f9b0f, 0x10, 0x82f671d, 0x1, 0x1, 0x0, ...) /home/username/zdns/modules/miekg/miekg.go:545 +0x825 github.com/zmap/zdns/modules/miekg.(Lookup).iterativeLookup(0xa096030, 0x10001, 0xa090000, 0x9, 0x82f9b0f, 0x10, 0x1, 0x82f671d, 0x1, 0x851b614, ...) /home/username/zdns/modules/miekg/miekg.go:770 +0xd1 github.com/zmap/zdns/modules/miekg.(Lookup).DoMiekgLookup(0xa096030, 0xa090000, 0x9, 0x82f9b0f, 0x10, 0x82031ee, 0x82b4800, 0xa0127e0, 0x82f67a8, 0x2, ...) /home/username/zdns/modules/miekg/miekg.go:826 +0x281 github.com/zmap/zdns/modules/miekg.(*Lookup).DoLookup(0xa096030, 0xa090000, 0x9, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...) /home/username/zdns/modules/miekg/miekg.go:916 +0x45 github.com/zmap/zdns.doLookup(0x8361020, 0xa062390, 0xa10a270, 0xa022800, 0xa022840, 0xa13fd80, 0xa016b90, 0x4, 0x200, 0x28) /home/username/zdns/lookup.go:132 +0x81a created by github.com/zmap/zdns.DoLookups /home/username/zdns/lookup.go:205 +0x2a7_
I'm not entirely sure what was going on here, but I just used the used the oldest version of the Go toolchain we now support (Go 1.20) and in Debian installed zdns
from source. I'm able to run both --iterative
and external lookups without getting this issue.
I'm going to close this, if someone else runs into it again we can investigate from there.
I can do a clone but can't seem to do a checkout as advised. I see there were some recent edits, there, so I'm hoping there's some other updates that maybe got another wire crossed.