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 when trying to unmarshal specific yaml #13

Closed
ccampbell opened this issue Jul 8, 2016 · 9 comments
Closed

Panic when trying to unmarshal specific yaml #13

ccampbell opened this issue Jul 8, 2016 · 9 comments

Comments

@ccampbell
Copy link

This is a pretty bizarre one. When trying to unmarshal this yaml:

Port: 7746
Processes:
    Something:
        Command: some command

I get this panic:

panic: reflect: reflect.Value.Set using unaddressable value

goroutine 1 [running]:
panic(0x3cdb80, 0xc820132680)
    /usr/local/Cellar/go/1.6.2/libexec/src/runtime/panic.go:481 +0x3e6
reflect.flag.mustBeAssignable(0x16)
    /usr/local/Cellar/go/1.6.2/libexec/src/reflect/value.go:229 +0x221
reflect.Value.Set(0x3a98e0, 0x0, 0x16, 0x3a98e0, 0xc82016e2c0, 0x16)
    /usr/local/Cellar/go/1.6.2/libexec/src/reflect/value.go:1328 +0x25
dj/vendor/github.com/ghodss/yaml.indirect(0x3a98e0, 0x0, 0x16, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
    /Users/craig/go-clean/src/dj/vendor/github.com/ghodss/yaml/fields.go:48 +0x528
dj/vendor/github.com/ghodss/yaml.convertToJSONableObject(0x3ca880, 0xc820136630, 0xc8201346a0, 0x0, 0x0, 0x0, 0x0)
    /Users/craig/go-clean/src/dj/vendor/github.com/ghodss/yaml/yaml.go:106 +0xc9
dj/vendor/github.com/ghodss/yaml.convertToJSONableObject(0x3ca880, 0xc8201365d0, 0xc8200d7170, 0x0, 0x0, 0x0, 0x0)
    /Users/craig/go-clean/src/dj/vendor/github.com/ghodss/yaml/yaml.go:205 +0xf3a
dj/vendor/github.com/ghodss/yaml.convertToJSONableObject(0x3ca880, 0xc8201365a0, 0xc8200d7628, 0x0, 0x0, 0x0, 0x0)
    /Users/craig/go-clean/src/dj/vendor/github.com/ghodss/yaml/yaml.go:195 +0xb15
dj/vendor/github.com/ghodss/yaml.yamlToJSON(0xc820162000, 0x43, 0x243, 0xc8200d78a0, 0x0, 0x0, 0x0, 0x0, 0x0)
    /Users/craig/go-clean/src/dj/vendor/github.com/ghodss/yaml/yaml.go:89 +0x110
dj/vendor/github.com/ghodss/yaml.Unmarshal(0xc820162000, 0x43, 0x243, 0x3a9880, 0x78c480, 0x0, 0x0)
    /Users/craig/go-clean/src/dj/vendor/github.com/ghodss/yaml/yaml.go:32 +0xa8

Interestingly it seems like it might be something specific to the word Processes cause if I change that to Process or really any other word it works fine. I was previously using an older version of your library c3eb24a and it works fine there.

@mspiegel
Copy link

I'm having the same issue.

@bacongobbler
Copy link

Here's a very basic sample that reproduces this issue: https://play.golang.org/p/-HW2JX08zd

@bacongobbler
Copy link

nvm, looks like #7 is the fix.

@ghodss
Copy link
Owner

ghodss commented Mar 27, 2017

@bacongobbler Did you verify this is fixed in latest?

@ccampbell
Copy link
Author

@ghodss I am pretty sure @bacongobbler realized the issue he was experiencing was fixed with #7 (not that it was the same issue as the original ticket I made here)

@ghodss
Copy link
Owner

ghodss commented Mar 28, 2017

@ccampbell Are you able to test your issue against latest?

@bacongobbler
Copy link

Yep! I can verify that this was fixed in latest. Thank you!

@bacongobbler
Copy link

bacongobbler commented Mar 28, 2017

@ccampbell not sure if it is relevant to your issue, but the example I put up does cause the same panic to trigger as shown in the OP, so either they are the same issue or at least related to each other. Either way, upgrading to master resolved the panic for me. :)

@ccampbell
Copy link
Author

Aha! I just tried on latest master and it is working for me as well. Thanks!

dims pushed a commit to dims/yaml that referenced this issue Feb 18, 2019
Updated OWNERS file to include link to docs
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

4 participants