AdguardTeam / AdGuardHome

Network-wide ads & trackers blocking DNS server
https://adguard.com/adguard-home/overview.html
GNU General Public License v3.0
25.59k stars 1.84k forks source link

Panic on CTRL-C (v0.107.0-b.11) #3655

Closed timkgh closed 3 years ago

timkgh commented 3 years ago

Issue Details

Panic when exiting process (CTRL-C)

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x2c8 pc=0x66f118]

goroutine 655 [running]:
github.com/AdguardTeam/dnsproxy/proxy.(*Proxy).Resolve(0x0, 0xc0005c7b00, 0x0, 0x0)
    github.com/AdguardTeam/dnsproxy@v0.39.5/proxy/proxy.go:480 +0x30
github.com/AdguardTeam/AdGuardHome/internal/dnsforward.(*Server).processUpstream(0xc000276f00, 0xc00012bd60, 0x0)
    github.com/AdguardTeam/AdGuardHome/internal/dnsforward/dns.go:544 +0x8c
github.com/AdguardTeam/AdGuardHome/internal/dnsforward.(*Server).handleDNSRequest(0xc000276f00, 0xc000188380, 0xc0005c7b00, 0x0, 0x0)
    github.com/AdguardTeam/AdGuardHome/internal/dnsforward/dns.go:102 +0x2dc
github.com/AdguardTeam/dnsproxy/proxy.(*Proxy).handleDNSRequest(0xc000188380, 0xc0005c7b00, 0x2123b60, 0x28)
    github.com/AdguardTeam/dnsproxy@v0.39.5/proxy/server.go:127 +0x240
github.com/AdguardTeam/dnsproxy/proxy.(*Proxy).udpHandlePacket(0xc000188380, 0xc000bb12f0, 0x28, 0x28, 0xc00047751c, 0x4, 0x4, 0xc0004944e0, 0xc000306040)
    github.com/AdguardTeam/dnsproxy@v0.39.5/proxy/server_udp.go:105 +0x2fc
github.com/AdguardTeam/dnsproxy/proxy.(*Proxy).udpPacketLoop.func1(0xc000188380, 0xc000bb12f0, 0x28, 0x28, 0xc00047751c, 0x4, 0x4, 0xc0004944e0, 0xc000306040, 0x1cc76e8, ...)
    github.com/AdguardTeam/dnsproxy@v0.39.5/proxy/server_udp.go:74 +0x7c
created by github.com/AdguardTeam/dnsproxy/proxy.(*Proxy).udpPacketLoop
    github.com/AdguardTeam/dnsproxy@v0.39.5/proxy/server_udp.go:73 +0x500

Expected Behavior

Exit cleanly, no crash. v0.106.3 is well behaved wrt CTRL-C

Actual Behavior

panic

EugeneOne1 commented 3 years ago

@timkgh, Hello and thank you for the report. Latest edge build contains our solution for the issue. Could you please check if the problem remains?

EugeneOne1 commented 3 years ago

@timkgh, we'll close the issue for now if you don't mind. Please feel free to reopen it if the panic reoccurs.