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

Omitting the parameters/required field from a bundle causes SIGSEGV on installation #60

Closed
glyn opened this issue Jul 15, 2019 · 1 comment

Comments

@glyn
Copy link
Contributor

glyn commented Jul 15, 2019

According to the CNAB spec, the parameters/required field in a bundle is optional:

required: A list of required parameters. MUST be an array of strings.(OPTIONAL)

The bundle schema confirms this by not declaring the field to be required.

Yet attempting to install a bundle without an explicit empty array for parameters/required results in SIGSEGV e.g.:

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

goroutine 1 [running]:
github.com/deislabs/duffle/vendor/github.com/deislabs/cnab-go/bundle.ValuesOrDefaults(0xc00036b410, 0xc0000da540, 0xc0002c7a30, 0x0, 0xc00036b440)
	/Users/gnormington/go/src/github.com/deislabs/duffle/vendor/github.com/deislabs/cnab-go/bundle/bundle.go:139 +0x9a
main.calculateParamValues(0xc0000da540, 0x0, 0x0, 0x34e4b08, 0x0, 0x0, 0x34e4b08, 0x0, 0x0, 0x3, ...)
	/Users/gnormington/go/src/github.com/deislabs/duffle/cmd/duffle/install.go:264 +0x3dd
main.(*installCmd).run(0xc0000da240, 0x1a, 0x24beb40)
	/Users/gnormington/go/src/github.com/deislabs/duffle/cmd/duffle/install.go:139 +0x41e
main.newInstallCmd.func1(0xc0001dcf00, 0xc0000e6e40, 0x2, 0x2, 0x0, 0x0)
	/Users/gnormington/go/src/github.com/deislabs/duffle/cmd/duffle/install.go:85 +0xcf
github.com/deislabs/duffle/vendor/github.com/spf13/cobra.(*Command).execute(0xc0001dcf00, 0xc0000e6e00, 0x2, 0x2, 0xc0001dcf00, 0xc0000e6e00)
	/Users/gnormington/go/src/github.com/deislabs/duffle/vendor/github.com/spf13/cobra/command.go:762 +0x465
github.com/deislabs/duffle/vendor/github.com/spf13/cobra.(*Command).ExecuteC(0xc0003c3b80, 0x0, 0xc0003c3b80, 0xc00009a058)
	/Users/gnormington/go/src/github.com/deislabs/duffle/vendor/github.com/spf13/cobra/command.go:852 +0x2ec
github.com/deislabs/duffle/vendor/github.com/spf13/cobra.(*Command).Execute(...)
	/Users/gnormington/go/src/github.com/deislabs/duffle/vendor/github.com/spf13/cobra/command.go:800
main.main()
	/Users/gnormington/go/src/github.com/deislabs/duffle/cmd/duffle/main.go:32 +0x48

Steps to reproduce

  1. Unless schema version missing from examples duffle#795 has been fixed, edit examples/helloworld/duffle.json to ensure it has a schema version, e.g.
    "schemaVersion" : "v1.0.0-WD",
    
  2. duffle build ./examples/helloworld
  3. docker push the resultant invocation image
  4. duffle install helloworld helloworld
  5. Observe SIGSEGV
@glyn glyn transferred this issue from cnabio/duffle Jul 15, 2019
@glyn
Copy link
Contributor Author

glyn commented Jul 15, 2019

Fixed by #50

@glyn glyn closed this as completed Jul 15, 2019
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

1 participant