celzero / firestack

Userspace wireguard and network monitor
https://rethinkdns.com/app
Mozilla Public License 2.0
100 stars 16 forks source link

miekg/dns: invalid memory address or nil pointer dereference #55

Closed hussainmohd-a closed 6 months ago

hussainmohd-a commented 6 months ago
05-20 01:20:29.957  4216  6112 I GoLog   : wgnet.go:159: I wg: dial: tcp: #0 157.240.5.63:443
05-20 01:20:29.957  4216  6112 I GoLog   : wgproxy.go:695: I wg: wg3 dial: end tcp 157.240.5.63:443; err connect tcp 157.240.5.63:443: operation timed out
05-20 01:20:29.957  4216  6112 E GoLog   : wgnet.go:170: W wg: dial: tcp: [157.240.5.63:443] failed: connect tcp 157.240.5.63:443: operation timed out
05-20 01:20:29.957  4216  6153 I GoLog   : ipmap.go:148: I ipmap: Add: resolving 157.240.5.63
05-20 01:20:29.957  4216  6112 E GoLog   : tcp.go:277: W tcp: err dialing ab14e24e5f154e58 proxy(wg3) to dst(157.240.5.63:443) for 10212: connect tcp 157.240.5.63:443: operation timed out
05-20 01:20:29.957  4216  6153 E GoLog   : tcp.go:236: W tcp: dial: #0: ab14e24e5f154e58 failed; addr(157.240.5.63:443); for uid 10212 (127011); w err(connect tcp 157.240.5.63:443: operation timed out)
05-20 01:20:31.759  4216     0 E Go      : panic: runtime error: invalid memory address or nil pointer dereference
05-20 01:20:31.760  4216     0 E Go      : [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x7491d0f440]
05-20 01:20:31.760  4216     0 E Go      : 
05-20 01:20:31.760  4216  6112 E GoLog   : panic: runtime error: invalid memory address or nil pointer dereference
05-20 01:20:31.760  4216     0 E Go      : goroutine 210086 [running]:
05-20 01:20:31.760  4216  6112 E GoLog   : [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x7491d0f440]
05-20 01:20:31.761  4216     0 E Go      : github.com/miekg/dns.(*EDNS0_PADDING).pack(0x7491a79bc0?)
05-20 01:20:31.761  4216     0 E Go      :  /tmp/gomobile-work-459425571/pkg/mod/github.com/miekg/dns@v1.1.49/edns.go:730
05-20 01:20:31.761  4216     0 E Go      : github.com/miekg/dns.(*OPT).len(0x4001d1efc0, 0x12?, 0xc?)
05-20 01:20:31.761  4216     0 E Go      :  /tmp/gomobile-work-459425571/pkg/mod/github.com/miekg/dns@v1.1.49/edns.go:130 +0x6c
05-20 01:20:31.761  4216     0 E Go      : github.com/miekg/dns.msgLenWithCompressionMap(0x4000da2240, 0x40009a1140)
05-20 01:20:31.761  4216     0 E Go      :  /tmp/gomobile-work-459425571/pkg/mod/github.com/miekg/dns@v1.1.49/msg.go:982 +0x1a8
05-20 01:20:31.761  4216     0 E Go      : github.com/miekg/dns.(*Msg).Len(0x4000da2240)
05-20 01:20:31.761  4216     0 E Go      :  /tmp/gomobile-work-459425571/pkg/mod/github.com/miekg/dns@v1.1.49/msg.go:958 +0x58
05-20 01:20:31.762  4216     0 E Go      : github.com/celzero/firestack/intra/doh.AddEdnsPadding(0x4000da2240)
05-20 01:20:31.762  4216     0 E Go      :  /home/jitpack/build/intra/doh/padding.go:92 +0x1f4
05-20 01:20:31.762  4216     0 E Go      : github.com/celzero/firestack/intra/doh.(*transport).doDoh(0x40005b2460, {0x400029291c, 0x3}, 0x4000da2240)
05-20 01:20:31.762  4216     0 E Go      :  /home/jitpack/build/intra/doh/doh.go:259 +0x44
05-20 01:20:31.762  4216     0 E Go      : github.com/celzero/firestack/intra/doh.(*transport).Query(0x40005b2460, {0x4000292918, 0x7}, 0x4000da2240, 0x4001132b00)
05-20 01:20:31.762  4216     0 E Go      :  /home/jitpack/build/intra/doh/doh.go:475 +0xa8
05-20 01:20:31.762  4216     0 E Go      : github.com/celzero/firestack/intra/dnsx.Req({0x749214b3a8?, 0x40005b2460?}, {0x4000292918?, 0x742cdee808?}, 0x4001fd3908?, 0x7491da4aa4?)
05-20 01:20:31.762  4216     0 E Go      :  /home/jitpack/build/intra/dnsx/alg.go:1014 +0xbc
05-20 01:20:31.762  4216     0 E Go      : github.com/celzero/firestack/intra/dnsx.(*ctransport).fetch.func1.1()
05-20 01:20:31.763  4216     0 E Go      :  /home/jitpack/build/intra/dnsx/cacher.go:322 +0x5c
05-20 01:20:31.763  4216     0 E Go      : github.com/celzero/firestack/intra/core.(*Barrier[...]).Do(0x749214f660, {0x4000f91410, 0x13}, 0x4001fd3b08)
05-20 01:20:31.763  4216     0 E Go      :  /home/jitpack/build/intra/core/barrier.go:101 +0x198
05-20 01:20:31.763  4216     0 E Go      : github.com/celzero/firestack/intra/dnsx.(*ctransport).fetch.func1(0x4001132b00)
05-20 01:20:31.763  4216     0 E Go      :  /home/jitpack/build/intra/dnsx/cacher.go:320 +0x148
05-20 01:20:31.763  4216     0 E Go      : github.com/celzero/firestack/intra/dnsx.(*ctransport).fetch(0x40002bc6e0, {0x4000292918, 0x7}, 0x4000da2240, 0x4001132b00, 0x4000faceb0, {0x4000f91410, 0x13})
05-20 01:20:31.763  4216     0 E Go      :  /home/jitpack/build/intra/dnsx/cacher.go:404 +0x614
05-20 01:20:31.763  4216     0 E Go      : github.com/celzero/firestack/intra/dnsx.(*ctransport).Query(0x40002bc6e0, {0x4000292918, 0x7}, 0x4000da2240, 0x4001132b00)
05-20 01:20:31.763  4216     0 E Go      :  /home/jitpack/build/intra/dnsx/cacher.go:428 +0x1a4
05-20 01:20:31.764  4216     0 E Go      : github.com/celzero/firestack/intra/dnsx.Req({0x749214b6c0?, 0x40002bc6e0?}, {0x4000292918?, 0x0?}, 0x0?, 0x4000da2240?)
05-20 01:20:31.764  4216     0 E Go      :  /home/jitpack/build/intra/dnsx/alg.go:1014 +0xbc
05-20 01:20:31.764  4216     0 E Go      : github.com/celzero/firestack/intra/dnsx.(*dnsgateway).querySecondary(0x400058cc60, {0x749214b6c0, 0x40002bc6e0}, {0x4000292918, 0x7}, 0x4000da2240, 0x4000dd7e00, 0x4000dd7e60)
05-20 01:20:31.764  4216     0 E Go      :  /home/jitpack/build/intra/dnsx/alg.go:199 +0x24c
05-20 01:20:31.764  4216     0 E Go      : created by github.com/celzero/firestack/intra/dnsx.(*dnsgateway).q in goroutine 210085
05-20 01:20:31.764  4216     0 E Go      :  /home/jitpack/build/intra/dnsx/alg.go:264 +0x170
hussainmohd-a commented 6 months ago
05-22 21:24:28.437  9522     0 E Go      : panic: runtime error: invalid memory address or nil pointer dereference
05-22 21:24:28.437  9522     0 E Go      : [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x742f114a00]
05-22 21:24:28.437  9522     0 E Go      : 
05-22 21:24:28.437  9522     0 E Go      : goroutine 47911 [running]:
05-22 21:24:28.439  9522     0 E Go      : github.com/miekg/dns.(*Msg).CopyTo(0x0, 0x4008f0a510)
05-22 21:24:28.439  9522     0 E Go      :  /tmp/gomobile-work-2622969469/pkg/mod/github.com/miekg/dns@v1.1.49/msg.go:1059 +0x20
05-22 21:24:28.439  9522     0 E Go      : github.com/miekg/dns.(*Msg).Copy(...)
05-22 21:24:28.439  9522     0 E Go      :  /tmp/gomobile-work-2622969469/pkg/mod/github.com/miekg/dns@v1.1.49/msg.go:1055
05-22 21:24:28.439  9522     0 E Go      : github.com/celzero/firestack/intra/dnsx.(*cres).copy(0x4008bcab40)
05-22 21:24:28.439  9522     0 E Go      :  /home/jitpack/build/intra/dnsx/cacher.go:125 +0x3c
05-22 21:24:28.439  9522     0 E Go      : github.com/celzero/firestack/intra/dnsx.(*ctransport).fetch.func1(0x4008327b80)
05-22 21:24:28.439  9522     0 E Go      :  /home/jitpack/build/intra/dnsx/cacher.go:334 +0x310
05-22 21:24:28.439  9522     0 E Go      : github.com/celzero/firestack/intra/dnsx.(*ctransport).fetch(0x40084423c0, {0x4007a12840, 0x8}, {0x400861c000, 0x26, 0x800}, 0x400037b320, 0x4008327b80, 0x4008769ae0, {0x4009333398, ...})
05-22 21:24:28.439  9522     0 E Go      :  /home/jitpack/build/intra/dnsx/cacher.go:402 +0x624
05-22 21:24:28.439  9522     0 E Go      : github.com/celzero/firestack/intra/dnsx.(*ctransport).Query(0x40084423c0, {0x4007a12840, 0x8}, {0x400861c000, 0x26, 0x800}, 0x4008327b80)
05-22 21:24:28.439  9522     0 E Go      :  /home/jitpack/build/intra/dnsx/cacher.go:428 +0x1d0
05-22 21:24:28.440  9522     0 E Go      : github.com/celzero/firestack/intra/dnsx.Req({0x742f54fac8?, 0x40084423c0?}, {0x4007a12840?, 0x742f641aff?}, {0x400861c000?, 0x742eecef1c?, 0x400870f678?}, 0x742eecef10?)
05-22 21:24:28.440  9522     0 E Go      :  /home/jitpack/build/intra/dnsx/alg.go:899 +0xa4
05-22 21:24:28.440  9522     0 E Go      : github.com/celzero/firestack/intra/dnsx.(*dnsgateway).q(0x4000176120, {0x742f54fac8, 0x40084423c0}, {0x0, 0x0}, {0x4008f781d8, 0x0, 0x1}, {0x4007a12840, 0x8}, ...)
05-22 21:24:28.440  9522     0 E Go      :  /home/jitpack/build/intra/dnsx/alg.go:255 +0x200
05-22 21:24:28.440  9522     0 E Go      : github.com/celzero/firestack/intra/dnsx.(*resolver).forward(0x40000c6210, {0x400861c000, 0x26, 0x800}, {0x0, 0x0, 0x0})
05-22 21:24:28.440  9522     0 E Go      :  /home/jitpack/build/intra/dnsx/transport.go:387 +0xa60
05-22 21:24:28.441  9522     0 E Go      : github.com/celzero/firestack/intra/dnsx.(*resolver).dnsudp(0x5?, {0x400861c000?, 0x0?, 0x4008ada660?}, {0x7758b5f0a8, 0x40085c7c80})
05-22 21:24:28.441  9522     0 E Go      :  /home/jitpack/build/intra/dnsx/transport.go:520 +0x38
05-22 21:24:28.441  9522     0 E Go      : github.com/celzero/firestack/intra/dnsx.(*resolver).reply.func2()
05-22 21:24:28.441  9522     0 E Go      :  /home/jitpack/build/intra/dnsx/transport.go:560 +0x74
05-22 21:24:28.441  9522     0 E Go      : created by github.com/celzero/firestack/intra/dnsx.(*resolver).reply in goroutine 47890
05-22 21:24:28.441  9522     0 E Go      :  /home/jitpack/build/intra/dnsx/transport.go:570 +0x7c
05-22 21:24:28.449  9522     0 E Go      : panic: runtime error: invalid memory address or nil pointer dereference
05-22 21:24:28.449  9522     0 E Go      : [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x742f114a00]
05-22 21:24:28.449  9522     0 E Go      : 
05-22 21:24:28.449  9522     0 E Go      : goroutine 47987 [running]:
05-22 21:24:28.449  9522     0 E Go      : github.com/miekg/dns.(*Msg).CopyTo(0x0, 0x4000160ab0)
05-22 21:24:28.449  9522     0 E Go      :  /tmp/gomobile-work-2622969469/pkg/mod/github.com/miekg/dns@v1.1.49/msg.go:1059 +0x20
05-22 21:24:28.449  9522     0 E Go      : github.com/miekg/dns.(*Msg).Copy(...)
05-22 21:24:28.449  9522     0 E Go      :  /tmp/gomobile-work-2622969469/pkg/mod/github.com/miekg/dns@v1.1.49/msg.go:1055
05-22 21:24:28.449  9522     0 E Go      : github.com/celzero/firestack/intra/dnsx.(*cres).copy(0x4008bcab40)
05-22 21:24:28.449  9522     0 E Go      :  /home/jitpack/build/intra/dnsx/cacher.go:125 +0x3c
05-22 21:24:28.449  9522     0 E Go      : github.com/celzero/firestack/intra/dnsx.(*ctransport).fetch.func1(0x400838f130)
05-22 21:24:28.449  9522     0 E Go      :  /home/jitpack/build/intra/dnsx/cacher.go:334 +0x310
05-22 21:24:28.449  9522     0 E Go      : github.com/celzero/firestack/intra/dnsx.(*ctransport).fetch(0x40084423c0, {0x4008bf9da8, 0x8}, {0x400861d800, 0x26, 0x800}, 0x4008f8ca20, 0x400838f130, 0x4008769ae0, {0x4008a1a918, ...})
05-22 21:24:28.449  9522     0 E Go      :  /home/jitpack/build/intra/dnsx/cacher.go:402 +0x624
05-22 21:24:28.449  9522     0 E Go      : github.com/celzero/firestack/intra/dnsx.(*ctransport).Query(0x40084423c0, {0x4008bf9da8, 0x8}, {0x400861d800, 0x26, 0x800}, 0x400838f130)
05-22 21:24:28.449  9522     0 E Go      :  /home/jitpack/build/intra/dnsx/cacher.go:428 +0x1d0
05-22 21:24:28.449  9522     0 E Go      : github.com/celzero/firestack/intra/dnsx.Req({0x742f54fac8?, 0x40084423c0?}, {0x4008bf9da8?, 0x742f641aff?}, {0x400861d800?, 0x742eecef1c?, 0x4009049678?}, 0x742eecef10?)
05-22 21:24:28.450  9522     0 E Go      :  /home/jitpack/build/intra/dnsx/alg.go:899 +0xa4
05-22 21:24:28.450  9522     0 E Go      : github.com/celzero/firestack/intra/dnsx.(*dnsgateway).q(0x4000176120, {0x742f54fac8, 0x40084423c0}, {0x0, 0x0}, {0x40001a0180, 0x0, 0x1}, {0x4008bf9da8, 0x8}, ...)
05-22 21:24:28.450  9522     0 E Go      :  /home/jitpack/build/intra/dnsx/alg.go:255 +0x200
05-22 21:24:28.450  9522     0 E Go      : github.com/celzero/firestack/intra/dnsx.(*resolver).forward(0x40000c6210, {0x400861d800, 0x26, 0x800}, {0x0, 0x0, 0x0})
05-22 21:24:28.450  9522     0 E Go      :  /home/jitpack/build/intra/dnsx/transport.go:387 +0xa60
05-22 21:24:28.450  9522     0 E Go      : github.com/celzero/firestack/intra/dnsx.(*resolver).dnsudp(0x5?, {0x400861d800?, 0x40003000c0?, 0x4008efcb90?}, {0x7758b5f0a8, 0x40085c7c80})
05-22 21:24:28.450  9522     0 E Go      :  /home/jitpack/build/intra/dnsx/transport.go:520 +0x38
05-22 21:24:28.450  9522     0 E Go      : github.com/celzero/firestack/intra/dnsx.(*resolver).reply.func2()
05-22 21:24:28.450  9522     0 E Go      :  /home/jitpack/build/intra/dnsx/transport.go:560 +0x74
05-22 21:24:28.450  9522     0 E Go      : created by github.com/celzero/firestack/intra/dnsx.(*resolver).reply in goroutine 47890
05-22 21:24:28.450  9522     0 E Go      :  /home/jitpack/build/intra/dnsx/transport.go:570 +0x7c
05-22 21:24:28.450  9522 27473 F libc    : Fatal signal 6 (SIGABRT), code -6 (SI_TKILL) in tid 27473 (Thread-74), pid 9522 (elzero.bravedns)
05-22 21:24:28.590  9522 11258 D BatchLogger: signal wait over, sz(b: 1, u: 0) / cur-buf(577)
ignoramous commented 6 months ago

The above crash was fixed in v055j: https://github.com/celzero/firestack/issues/49