fastdns icon indicating copy to clipboard operation
fastdns copied to clipboard

Panic in fastdns.ParseMessage

Open andys opened this issue 1 year ago • 2 comments

Unfortunately, no logging available, it was a random DNS lookup from the Internet (possibly a bot etc). Was v0.8.2

panic: runtime error: index out of range [107] with length 9

goroutine 34267 [running]:
github.com/phuslu/fastdns.ParseMessage(0x40003171a0, {0x4000164c00?, 0x400029c8c0?, 0x0?}, 0xe0?)
        vendor/github.com/phuslu/fastdns/message.go:153 +0x380
github.com/phuslu/fastdns.serveCtx(0x4000060b40)
        vendor/github.com/phuslu/fastdns/server.go:185 +0x88
github.com/phuslu/fastdns.(*workerPool).workerFunc(0x40000cc1b0, 0x400045e060)
        dns_server/vendor/github.com/phuslu/fastdns/workerpool.go:223 +0x68
github.com/phuslu/fastdns.(*workerPool).getCh.func1()
        vendor/github.com/phuslu/fastdns/workerpool.go:195 +0x38
created by github.com/phuslu/fastdns.(*workerPool).getCh in goroutine 22
        vendor/github.com/phuslu/fastdns/workerpool.go:194 +0x1e4

andys avatar Oct 02 '24 23:10 andys

It just happened again. I'll add more logging.

andys avatar Oct 13 '24 20:10 andys

I tried to fix in v0.9.4, thanks.

phuslu avatar Oct 16 '24 16:10 phuslu

I supposed it has been fixed so close this issue now. If re-produced or panic again, please reopen or raise a new one. thanks~

phuslu avatar Oct 27 '24 11:10 phuslu

@phuslu Thank you! No crashes as yet, I'll keep you informed

andys avatar Oct 27 '24 18:10 andys

@phuslu Also no more crashes in the last 3 weeks. Thanks again.

andys avatar Nov 18 '24 01:11 andys