Skip to content

crashes on some lookups #25

Open
Open
@balboah

Description

@balboah

Hello,

While using coredns 1.7.0 with the config:

    .:53 {
        debug
        health {
           lameduck 5s
        }
        ready
        prometheus :9153
        unbound

        cache

        loop
        reload
    }

And querying for ipleak.net, I get a crash:

panic: runtime error: index out of range [0] with length 0

goroutine 799 [running]:
github.com/coredns/coredns/plugin/cache.key(0xc00003e190, 0xb, 0xc0003a3a70, 0x0, 0x0, 0x0, 0xc0002a4300)
	/src/coredns-1.7.0/plugin/cache/cache.go:78 +0xca
github.com/coredns/coredns/plugin/cache.(*ResponseWriter).WriteMsg(0xc0002aa300, 0xc0003a3a70, 0x1, 0x1)
	/src/coredns-1.7.0/plugin/cache/cache.go:162 +0x165
github.com/coredns/unbound.(*Unbound).ServeDNS(0xc00060e6e0, 0xdf6380, 0xc0002a4330, 0xdfdfe0, 0xc0002aa300, 0xc0002a8d80, 0xc000070bf0, 0x1, 0x1)
	/go/pkg/mod/github.com/coredns/unbound@v0.0.6/unbound.go:140 +0x4ca
github.com/coredns/coredns/plugin.NextOrFailure(0xd00513, 0x4, 0xdebe80, 0xc00060e6e0, 0xdf6380, 0xc0002a4330, 0xdfdfe0, 0xc0002aa300, 0xc0002a8d80, 0x0, ...)
	/src/coredns-1.7.0/plugin/plugin.go:80 +0xfb

If I remove the cache entry from the config, I get no crash but also an empty reply.
If I leave cache but replace unbond with forward, everything works fine

It seems to only happen on some cases, resolving google.com works fine with the above example config

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions