shawn1m / overture

A customized DNS relay server
MIT License
1.79k stars 284 forks source link

panic: runtime error: invalid memory address or nil pointer dereference #232

Closed Mr-Sheep closed 3 years ago

Mr-Sheep commented 4 years ago

when running overture 1.6.1 on debian 9, got this error message, tried downgrade to 1.6: panic: runtime error: invalid memory address or nil pointer dereference Full log below:


root@sheep:/usr/local/bin/overture# ./overture -c config.json 
INFO[2020-05-05 02:04:10] Overture v1.6.1
INFO[2020-05-05 02:04:10] If you want to use overture safe and sound, please read the README.md from project repository: https://github.com/shawn1m/overture
INFO[2020-05-05 02:04:10] Domain TTL file ./domain_ttl_sample has been loaded with 1 records (0 failed)
INFO[2020-05-05 02:04:10] Domain file ./black.txt has been loaded with 5008 records (regex-list)
INFO[2020-05-05 02:04:10] IP network file ./white.txt has been loaded with 517 records
ERRO[2020-05-05 02:04:10] Failed to open IP network file: open : no such file or directory
INFO[2020-05-05 02:04:10] Minimum TTL is disabled
INFO[2020-05-05 02:04:10] CacheSize is 99
INFO[2020-05-05 02:04:10] Hosts file has been loaded successfully
INFO[2020-05-05 02:04:10] Overture is listening on :53
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0x73972e]

goroutine 10 [running]:
github.com/shawn1m/overture/core/outbound/clients.(*RemoteClient).getEDNSClientSubnetIP(0xc00009a370)
        /usr/go/src/github.com/shawn1m/overture/core/outbound/clients/remote.go:40 +0x2e
github.com/shawn1m/overture/core/outbound/clients.NewClient(0xc0000aee10, 0xc0000a43f0, 0x88a740, 0xc00006a880, 0xc000177a80, 0xe, 0xc00025d2c0, 0x1)
        /usr/go/src/github.com/shawn1m/overture/core/outbound/clients/remote.go:34 +0xca
github.com/shawn1m/overture/core/outbound/clients.NewClientBundle(0xc0000aeb40, 0xc00000cac0, 0x4, 0x4, 0xc00006a840, 0x4, 0x4, 0xc000177a80, 
0xe, 0x0, ...)
        /usr/go/src/github.com/shawn1m/overture/core/outbound/clients/remote_bundle.go:39 +0x1e8
github.com/shawn1m/overture/core/outbound.(*Dispatcher).Exchange(0xc0000b67a0, 0xc0000aeb40, 0xc000177a80, 0xe, 0xc00008ae70)
        /usr/go/src/github.com/shawn1m/overture/core/outbound/dispatcher.go:55 +0x191
github.com/shawn1m/overture/core/inbound.(*Server).ServeDNS(0xc0000b6780, 0x892240, 0xc000060780, 0xc0000aeb40)
        /usr/go/src/github.com/shawn1m/overture/core/inbound/server.go:137 +0x31b
github.com/miekg/dns.(*ServeMux).ServeDNS(0xc00000cd40, 0x892240, 0xc000060780, 0xc0000aeb40)
        /home/appveyor/.gvm/pkgsets/go1.13.8/global/pkg/mod/github.com/miekg/dns@v1.1.8/serve_mux.go:128 +0x5d
github.com/miekg/dns.(*Server).serveDNS(0xc000021200, 0xc0000f6200, 0x33, 0x200, 0xc000060780)
        /home/appveyor/.gvm/pkgsets/go1.13.8/global/pkg/mod/github.com/miekg/dns@v1.1.8/server.go:603 +0x2b2
github.com/miekg/dns.(*Server).serveUDPPacket(0xc000021200, 0xc00025e560, 0xc0000f6200, 0x33, 0x200, 0xc00000e2b0, 0xc00000ce20)
        /home/appveyor/.gvm/pkgsets/go1.13.8/global/pkg/mod/github.com/miekg/dns@v1.1.8/server.go:549 +0xb2
created by github.com/miekg/dns.(*Server).serveUDP
        /home/appveyor/.gvm/pkgsets/go1.13.8/global/pkg/mod/github.com/miekg/dns@v1.1.8/server.go:479 +0x2ac
LEXUGE commented 3 years ago

This might be related to your configuration. Are you missing EDNS Client part for your DNS or the Socks5 part?

shawn1m commented 3 years ago

Will be fixed by https://github.com/shawn1m/overture/commit/0dcc87fae15d0341fa4de8aa3ccae7812fc27c98