Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

panic with DNS SRV query on 1.19.1 #21560

Closed
alexdulin opened this issue Jul 25, 2024 · 1 comment
Closed

panic with DNS SRV query on 1.19.1 #21560

alexdulin opened this issue Jul 25, 2024 · 1 comment

Comments

@alexdulin
Copy link

alexdulin commented Jul 25, 2024

Overview of the Issue

Consul 1.19.1 can still panic on certain DNS queries, despite other issues that have been resolved.


Reproduction Steps

  1. In one terminal, run consul agent -dev -client 0.0.0.0 -bind 0.0.0.0 -recursor 8.8.8.8 -advertise '{{ GetPrivateIP }}'
  2. In another terminal, run dig -p 8600 foo.virtual.consul SRV

The result:

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

goroutine 243 [running]:
github.com/hashicorp/consul/agent/dns.messageSerializer.serialize({}, 0xc0012fbb48)
	github.com/hashicorp/consul/agent/dns/message_serializer.go:85 +0x4fa
github.com/hashicorp/consul/agent/dns.(*Router).handleRequestRecursively(0xc0012ae120, 0xc000a566c0, {{0x0, 0x0}, {0x0, 0x0}, {0x0, 0x0}}, 0xc0004b4310, {0x54a5ac8, ...}, ...)
	github.com/hashicorp/consul/agent/dns/router.go:276 +0x97b
github.com/hashicorp/consul/agent/dns.(*Router).HandleRequest(0xc0012ae120, 0xc000a566c0, {{0x0, 0x0}, {0x0, 0x0}, {0x0, 0x0}}, {0x54a5ac8, 0xc001350b10})
	github.com/hashicorp/consul/agent/dns/router.go:188 +0x42a
github.com/hashicorp/consul/agent/dns.(*Router).ServeDNS(0xc0012ae120, {0x54d4ad0, 0xc000e87480}, 0xc000a566c0)
	github.com/hashicorp/consul/agent/dns/router.go:315 +0x53
github.com/miekg/dns.(*Server).serveDNS(0xc0012a4240, {0xc0012be000, 0x3b, 0xffff}, 0xc000e87480)
	github.com/miekg/dns@v1.1.50/server.go:659 +0x42a
github.com/miekg/dns.(*Server).serveUDPPacket(0xc0012a4240, 0xc00129a320, {0xc0012be000, 0x3b, 0xffff}, {0x54cfd70, 0xc00128e068}, 0xc000f90640, {0x0, 0x0})
	github.com/miekg/dns@v1.1.50/server.go:603 +0x1a5
created by github.com/miekg/dns.(*Server).serveUDP in goroutine 172
	github.com/miekg/dns@v1.1.50/server.go:533 +0x405

Consul info for both Client and Server

Consul v1.19.1
Revision 9f62fb41
Build Date 2024-07-11T14:47:27Z
Protocol 2 spoken by default, understands 2 to 3 (agent will automatically use protocol >2 when speaking to compatible agents)

Operating system and Environment details

Linux 5.19.0-50-generic 50-Ubuntu SMP PREEMPT_DYNAMIC Mon Jul 10 18:24:29 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

@jmurret
Copy link
Member

jmurret commented Aug 14, 2024

This is resolved with #21598 which reverts the experimental v2 dns and will be available in 1.19.2.

@jmurret jmurret closed this as completed Aug 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants