-
-
Notifications
You must be signed in to change notification settings - Fork 99
Description
I use q in Termux. Since I live in China, where the Internet is censored, DNS servers outside the country could be unstable to use.
Recently I was testing NextDNS over QUIC. At first, everything seemed to work fine:
~ $ q dns.nextdns.io @quic://dns.nextdns.io -Sv --trace
DEBU Name: dns.nextdns.io
DEBU RR types: [NS MX TXT CNAME A AAAA]
DEBU Server(s): [quic://dns.nextdns.io]
DEBU Using server dns.nextdns.io:853 with transport quic
DEBU Using QUIC transport: dns.nextdns.io:853
DEBU Connecting to dns.nextdns.io:853
DEBU Dialing with QUIC ALPN tokens: [doq doq-i11]
steering.nextdns.io. 1m A 37.252.249.233
steering.nextdns.io. 1m A 45.11.104.186
dns.nextdns.io. 4m22s CNAME steering.nextdns.io.
Stats:
Received 160 B from dns.nextdns.io:853 in 2.7586s (18:27:47 12-25-2025 UTC)
Opcode: QUERY Status: NOERROR ID 0: Flags: qr rd ra (1 Q 3 A 0 N 1 E)
steering.nextdns.io. 1m AAAA 2a00:11c0:17:429::3
steering.nextdns.io. 1m AAAA 2a0b:4341:509:186:5054:ff:fe0e:98d3
dns.nextdns.io. 4m21s CNAME steering.nextdns.io.
Stats:
Received 184 B from dns.nextdns.io:853 in 2.7586s (18:27:47 12-25-2025 UTC)
Opcode: QUERY Status: NOERROR ID 0: Flags: qr rd ra (1 Q 3 A 0 N 1 E)
Stats:
Received 90 B from dns.nextdns.io:853 in 2.7586s (18:27:47 12-25-2025 UTC)
Opcode: QUERY Status: NOERROR ID 0: Flags: qr rd ra (1 Q 1 A 0 N 1 E)
dns.nextdns.io. 4m20s CNAME steering.nextdns.io.
Stats:
Received 90 B from dns.nextdns.io:853 in 2.7586s (18:27:47 12-25-2025 UTC)
Opcode: QUERY Status: NOERROR ID 0: Flags: qr rd ra (1 Q 1 A 0 N 1 E)
steering.nextdns.io. 0s TXT "ecs: none"
steering.nextdns.io. 0s TXT "laddr: 37.252.249.233:853"
steering.nextdns.io. 0s TXT "proto: DOQ"
steering.nextdns.io. 0s TXT "raddr: 222.183.184.97:55271"
Stats:
Received 289 B from dns.nextdns.io:853 in 2.7586s (18:27:47 12-25-2025 UTC)
Opcode: QUERY Status: NOERROR ID 0: Flags: qr rd ra (1 Q 5 A 0 N 1 E)
Stats:
Received 90 B from dns.nextdns.io:853 in 2.7586s (18:27:47 12-25-2025 UTC)
Opcode: QUERY Status: NOERROR ID 0: Flags: qr rd ra (1 Q 1 A 0 N 1 E)
But moments later, something triggered an issue, and q crashed with a flood of error messages:
~ $ q dns.nextdns.io @quic://dns.nextdns.io -Sv --trace
DEBU Name: dns.nextdns.io
DEBU RR types: [AAAA NS MX TXT CNAME A]
DEBU Server(s): [quic://dns.nextdns.io]
DEBU Using server dns.nextdns.io:853 with transport quic
DEBU Using QUIC transport: dns.nextdns.io:853
DEBU Connecting to dns.nextdns.io:853
DEBU Dialing with QUIC ALPN tokens: [doq doq-i11]
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x651f8896d4]
goroutine 8 [running]:
github.com/quic-go/quic-go.(*Conn).setCloseError(...)
/home/builder/.termux-build/_cache/go-path/pkg/mod/github.com/quic-go/quic-go@v0.54.0/connection.go:1794
github.com/quic-go/quic-go.(*Conn).closeLocal(0x0, {0x651fab1ec0, 0x40002061a0})
/home/builder/.termux-build/_cache/go-path/pkg/mod/github.com/quic-go/quic-go@v0.54.0/connection.go:1803 +0x64
github.com/quic-go/quic-go.(*Conn).CloseWithError(0x0, 0x0, {0x0, 0x0})
/home/builder/.termux-build/_cache/go-path/pkg/mod/github.com/quic-go/quic-go@v0.54.0/connection.go:1819 +0x7c
github.com/natesales/q/transport.(*QUIC).Close(0x651f4b0891?)
/home/builder/.termux-build/q-dns-client/src/transport/quic.go:153 +0x2c
main.driver.func2()
/home/builder/.termux-build/q-dns-client/src/main.go:515 +0x3b0
created by main.driver in goroutine 1
/home/builder/.termux-build/q-dns-client/src/main.go:441 +0x1714
I believe this is unusual. An FATA message should appear here instead, but some error handling logic seems missing.
As I don’t understand Go and have nothing else to test the QUIC connection (Adguard Home, for now, appears to work fine,) below are just some guesses that might be helpful to trace the bug.
Chinese government censors the web with the Great Firewall (aka GFW.) In some conditions, trying to access blocked websites could ended up with the connection being reset or closed. If q fails to handle this properly, it could throw an error.