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

ko resolve segfaults when push=false #215

Closed
ian-mi opened this issue Oct 5, 2020 · 6 comments · Fixed by #216
Closed

ko resolve segfaults when push=false #215

ian-mi opened this issue Oct 5, 2020 · 6 comments · Fixed by #216

Comments

@ian-mi
Copy link

ian-mi commented Oct 5, 2020

When push=false there are no publishers and multiPublisher.Publish will return a nil name.Reference causing a segfault:

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

goroutine 13 [running]:
github.com/google/ko/pkg/resolve.ImageReferences.func1(0x1, 0x665a99)
/usr/local/google/home/ianmi/go/pkg/mod/github.com/google/[email protected]/pkg/resolve/resolve.go:66 +0x115
golang.org/x/sync/errgroup.(*Group).Go.func1(0xc000362a80, 0xc0000b6230)
/usr/local/google/home/ianmi/go/pkg/mod/golang.org/x/[email protected]/errgroup/errgroup.go:57 +0x59
created by golang.org/x/sync/errgroup.(*Group).Go
/usr/local/google/home/ianmi/go/pkg/mod/golang.org/x/[email protected]/errgroup/errgroup.go:54 +0x66

@imjasonh
Copy link
Member

imjasonh commented Oct 5, 2020

What command were you running?

I tried with ko publish <importpath> --push=false and it succeeded (though it logged the final line <nil>...)

ko apply did fail with the stacktrace though.

@jonjohnsonjr
Copy link
Collaborator

#166

imjasonh added a commit to imjasonh/ko that referenced this issue Oct 5, 2020
@imjasonh
Copy link
Member

imjasonh commented Oct 5, 2020

WIP at master...ImJasonH:multi-panic

It gets around this by injecting not-published@sha256...

Edit: we shouldn't go with that placeholder, but that's the idea

@jonjohnsonjr
Copy link
Collaborator

As mentioned in the other bug, there doesn't seem to be any utility in just setting push=false without any other publisher. We should just return a descriptive error here.

@ian-mi does that sound right or are you interested in some kind of NOP publisher as a dry run?

@ian-mi
Copy link
Author

ian-mi commented Oct 5, 2020 via email

@imjasonh
Copy link
Member

imjasonh commented Oct 6, 2020

Updated the PR to do a nop push. This ignores -P or -B flags, and always uses -P behavior.

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

Successfully merging a pull request may close this issue.

3 participants