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: slice bounds out of range under arm64 because of old dependency pkg #18

Closed
4nx opened this issue Jan 15, 2021 · 2 comments
Closed
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@4nx
Copy link

4nx commented Jan 15, 2021

Describe the bug:
I started to create a new webhook for another DNS provider. You can find it here: github.com/4nx/cert-manager-webook-joker. While building and testing the package under arm64 I found a bug within an old dependency package which is used.

TEST_ZONE_NAME=xxx go test .
panic: runtime error: slice bounds out of range [:9] with length 8

goroutine 1 [running]:
github.com/miekg/dns.ClientConfigFromFile(0x1346942, 0x10, 0x0, 0x0, 0x0)
	/home/ubuntu/go/pkg/mod/github.com/miekg/dns@v0.0.0-20170721150254-0f3adef2e220/clientconfig.go:86 +0x8b4
github.com/jetstack/cert-manager/pkg/issuer/acme/dns/util.getNameservers(0x1346942, 0x10, 0x229a540, 0x2, 0x2, 0x0, 0x25, 0x21ba808)
	/home/ubuntu/go/pkg/mod/github.com/jetstack/cert-manager@v0.13.1/pkg/issuer/acme/dns/util/wait.go:51 +0x30
github.com/jetstack/cert-manager/pkg/issuer/acme/dns/util.init()
	/home/ubuntu/go/pkg/mod/github.com/jetstack/cert-manager@v0.13.1/pkg/issuer/acme/dns/util/wait.go:44 +0x88
FAIL	github.com/4nx/cert-manager-webhook-joker	0.122s
FAIL

The problem is that a very old version of github.com/miekg/dns package is still used:

https://github.com/jetstack/cert-manager-webhook-example/blob/7a722fd8517afee606f0c13673880f6eedee5d87/go.sum#L294

The project had a bug until version 1.0.4:

https://github.com/miekg/dns/blob/5364553f1ee9cddc7ac8b62dce148309c386695b/clientconfig.go#L94

which had been fixed in version 1.0.5 after this pull request miekg/dns#642 through:

miekg/dns@0079071

The most recent version of the project is 1.1.35.

Expected behaviour:
A working webhook under ARM64.

Steps to reproduce the bug:
Simply following: https://github.com/4nx/cert-manager-webhook-joker#development under ARM64

Anything else we need to know?:
The webhook is working under amd64.

Environment details::

  • Kubernetes version: v1.20.0+k3s2
  • Cloud-provider/provisioner: K3s under raspberry pi 4
  • cert-manager version: v.1.1.0
  • Install method: helm

/kind bug

@jetstack-bot jetstack-bot added the kind/bug Categorizes issue or PR as related to a bug. label Jan 15, 2021
@4nx
Copy link
Author

4nx commented Jan 22, 2021

I added a pull request to fix the bug only by updating the miekg/dns packages just a bit.

@4nx
Copy link
Author

4nx commented Jan 22, 2021

#19

@jakexks jakexks closed this as completed Mar 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

No branches or pull requests

3 participants