celzero / firestack

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

intra/doh.asDohRequest: invalid memory address or nil pointer dereference #76

Closed hussainmohd-a closed 3 months ago

hussainmohd-a commented 3 months ago
I wg: dial: udp: #0 108.177.15.84:443
I wg: wg14 dial: end udp 108.177.15.84:443; err <nil>
I udp: 217d2ca723c3ec3d (proxy? wg14@185.107.56.22:51820) 10.2.0.2:47217 -> 108.177.15.84:443/108.177.15.84:443 for uid 10120
I proxy: exit: dial(udp) to 66.102.1.95:443; err? <nil>
I udp: c8a504252d492ddf (proxy? Exit@127.0.0.127:1337) 10.165.165.108:58112 -> 64.233.166.95:443/66.102.1.95:443 for uid 10103
I wg: dial: tcp: #0 140.82.121.3:443
I wg: wg14 dial: end tcp 140.82.121.3:443; err <nil>
I tcp: new conn 62a247eff5f53561 via proxy(wg14); src(10.111.222.1:46676) -> dst(140.82.121.3:443) for 10120
I wg: dial: tcp: #0 64.233.167.95:443
I wg: wg14 dial: end tcp 64.233.167.95:443; err <nil>
I tcp: new conn 37ff5f536f8fe375 via proxy(wg14); src(10.111.222.1:42016) -> dst(64.233.167.95:443) for 10120
I cache: del: 0; ref: 0; tot: 2 / high? false
I wg: dial: tcp: #0 64.233.166.95:443
I wg: wg14 dial: end tcp 64.233.166.95:443; err <nil>
I tcp: new conn fb4f810aa90acca5 via proxy(wg14); src(10.111.222.1:36842) -> dst(64.233.166.95:443) for 10120
I wg: dial: udp: #0 142.251.173.95:443
I wg: wg14 dial: end udp 142.251.173.95:443; err <nil>
I udp: 0279965add7894db (proxy? wg14@185.107.56.22:51820) 10.2.0.2:17587 -> 64.233.166.95:443/142.251.173.95:443 for uid 10120
I wg: dial: tcp: #0 64.233.167.138:443
I wg: wg14 dial: end tcp 64.233.167.138:443; err <nil>
I tcp: new conn 24c29a12c3294f06 via proxy(wg14); src(10.111.222.1:51538) -> dst(64.233.167.138:443) for 10120
I wg: dial: tcp: #0 64.233.167.100:443
I wg: wg14 dial: end tcp 64.233.167.100:443; err <nil>
I tcp: new conn c1b476fc70f4f0a1 via proxy(wg14); src(10.111.222.1:51540) -> dst(64.233.167.100:443) for 10120
I cache: del: 0; ref: 0; tot: 3 / high? false
I wg: dial: tcp: #0 185.199.110.154:443
I wg: wg14 dial: end tcp 185.199.110.154:443; err <nil>
I tcp: new conn 420822fb85fbe064 via proxy(wg14); src(10.111.222.1:50014) -> dst(185.199.110.154:443) for 10120
I wg: dial: tcp: #0 185.199.108.154:443
I wg: wg14 dial: end tcp 185.199.108.154:443; err <nil>
I tcp: new conn 769e850f832aca1c via proxy(wg14); src(10.111.222.1:50016) -> dst(185.199.108.154:443) for 10120
I wg: dial: tcp: #0 185.199.109.133:443
I wg: wg14 dial: end tcp 185.199.109.133:443; err <nil>
I tcp: new conn 0ba2732818e0c66d via proxy(wg14); src(10.111.222.1:35510) -> dst(185.199.109.133:443) for 10120
I wg: dial: tcp: #0 185.199.108.133:443
I wg: wg14 dial: end tcp 185.199.108.133:443; err <nil>
I tcp: new conn d6dfe7b1854ed579 via proxy(wg14); src(10.111.222.1:35514) -> dst(185.199.108.133:443) for 10120
I wg: dial: tcp: #0 185.199.111.133:443
I wg: wg14 dial: end tcp 185.199.111.133:443; err <nil>
I tcp: new conn 9553b0e17b398c36 via proxy(wg14); src(10.111.222.1:35512) -> dst(185.199.111.133:443) for 10120
E alg.querySecondary [0] runtime error: invalid memory address or nil pointer dereference

20 July 2024, 07:52:52: F alg.querySecondary [0] runtime error: invalid memory address or nil pointer dereference
 (#1)
20 July 2024, 07:52:52: goroutine 11573 [running]:
github.com/celzero/firestack/intra/log.(*simpleLogger).Stack(0x40001460e0, 0x0, {0x40089b1260?, 0x40089b1140?}, {0x4009790000, 0x10000, 0x10000})
    /home/jitpack/build/intra/log/logger.go:400 +0x2c0
github.com/celzero/firestack/intra/log.C({0x40089b1140, 0x58}, {0x4009790000, 0x10000, 0x10000})
    /home/jitpack/build/intra/log/log.go:136 +0xf8
github.com/celzero/firestack/intra/core.trace(0x40001460e0?, {0x40089b1140, 0x58})
    /home/jitpack/build/intra/core/dontpanic.go:101 +0x1a4
github.com/celzero/firestack/intra/core.Recover(0x0, {0x7020683d7d, 0x12})
    /home/jitpack/build/intra/core/dontpanic.go:74 +0x13c
panic({0x7020dad2e0?, 0x70212cd750?})
    /home/jitpack/golang/go/src/runtime/panic.go:770 +0x124
github.com/miekg/dns.(*EDNS0_PADDING).pack(0x7020789928?)
    /tmp/gomobile-work-566082087/pkg/mod/github.com/miekg/dns@v1.1.49/edns.go:730
github.com/miekg/dns.(*OPT).len(0x4009169dc0, 0x11?, 0xc?)
    /tmp/gomobile-work-566082087/pkg/mod/github.com/miekg/dns@v1.1.49/edns.go:130 +0x6c
github.com/miekg/dns.msgLenWithCompressionMap(0x400017f560, 0x0)
    /tmp/gomobile-work-566082087/pkg/mod/github.com/miekg/dns@v1.1.49/msg.go:982 +0x1a8
github.com/miekg/dns.(*Msg).packBufferWithCompressionMap(0x400017f560, {0x0, 0x0, 0x0}, {0x0?, 0x4008c39590?}, 0x1)
    /tmp/gomobile-work-566082087/pkg/mod/github.com/miekg/dns@v1.1.49/msg.go:789 +0x178
github.com/miekg/dns.(*Msg).PackBuffer(0x400017f560, {0x0, 0x0, 0x0})
    /tmp/gomobile-work-566082087/pkg/mod/github.com/miekg/dns@v1.1.49/msg.go:732 +0x7c
github.com/miekg/dns.(*Msg).Pack(...)
    /tmp/gomobile-work-566082087/pkg/mod/github.com/miekg/dns@v1.1.49/msg.go:723
github.com/celzero/firestack/intra/doh.(*transport).asDohRequest(0x4000216400, 0x7020d80400?)
    /home/jitpack/build/intra/doh/doh.go:554 +0x38
github.com/celzero/firestack/intra/doh.(*transport).doDoh(0x4000216400, {0x4008b534e4, 0x4}, 0x400017f560)
    /home/jitpack/build/intra/doh/doh.go:332 +0x1ac
github.com/celzero/firestack/intra/doh.(*transport).Query(0x4000216400, {0x4008b534e0, 0x8}, 0x400017f560, 0x4008b4e900)
    /home/jitpack/build/intra/doh/doh.go:583 +0xa8
github.com/celzero/firestack/intra/dnsx.Req({0x7020e99de0, 0x4000216400}, {0x4008b534e0, 0x8}, 0x400017f560, 0x4008b4e900)
    /home/jitpack/build/intra/dnsx/alg.go:1048 +0xd8
github.com/celzero/firestack/intra/dnsx.(*ctransport).fetch.func1.1()
    /home/jitpack/build/intra/dnsx/cacher.go:335 +0x5c
github.com/celzero/firestack/intra/core.(*Barrier[...]).Do(0x7020ea1860, {0x4008ff70e0, 0x13}, 0x4008da1a78)
    /home/jitpack/build/intra/core/barrier.go:118 +0x1bc
github.com/celzero/firestack/intra/dnsx.(*ctransport).fetch.func1(0x4008b4e900)
    /home/jitpack/build/intra/dnsx/cacher.go:333 +0x164
github.com/celzero/firestack/intra/dnsx.(*ctransport).fetch(0x400023e8f0, {0x4008b534e0, 0x8}, 0x400017f560, 0x4008b4e900, 0x4008a88aa0, {0x4008ff70e0, 0x13})
    /home/jitpack/build/intra/dnsx/cacher.go:417 +0x69c
github.com/celzero/firestack/intra/dnsx.(*ctransport).Query(0x400023e8f0, {0x4008b534e0, 0x8}, 0x400017f560, 0x4008b4e900)
    /home/jitpack/build/intra/dnsx/cacher.go:441 +0x1a4
github.com/celzero/firestack/intra/dnsx.Req({0x7020e9a1f0, 0x400023e8f0}, {0x4008b534e0, 0x8}, 0x400017f560, 0x4008b4e900)
    /home/jitpack/build/intra/dnsx/alg.go:1048 +0xd8
github.com/celzero/firestack/intra/dnsx.(*dnsgateway).querySecondary(0x400017e1b0, {0x7020e9a1f0, 0x400023e8f0}, {0x4008b534e0, 0x8}, 0x400017f560, 0x40088b75c0, 0x40088b7620)
    /home/jitpack/build/intra/dnsx/alg.go:212 +0x330
created by github.com/celzero/firestack/intra/dnsx.(*dnsgateway).q in goroutine 11572
    /home/jitpack/build/intra/dnsx/alg.go:279 +0x19c