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

[BUG] exo manifest format panics if read file is changed #481

Closed
BenElgar opened this issue Nov 5, 2021 · 1 comment · Fixed by #512
Closed

[BUG] exo manifest format panics if read file is changed #481

BenElgar opened this issue Nov 5, 2021 · 1 comment · Fixed by #512
Assignees
Labels
bug Something isn't working

Comments

@BenElgar
Copy link
Contributor

BenElgar commented Nov 5, 2021

❯ exo manifest format exo.hcl > exo.hcl
vpanic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x10 pc=0x8c0e3c]

goroutine 1 [running]:
github.com/deref/exo/internal/manifest/exohcl.(*FormatVersion).Analyze(0xc00000f6f8, 0xc000414720)
        /home/ben/Programming/exo/internal/manifest/exohcl/version.go:37 +0x3c
github.com/deref/exo/internal/manifest/exohcl.(*Manifest).Analyze(0xc0004103c0, 0xc000414720)
        /home/ben/Programming/exo/internal/manifest/exohcl/manifest.go:41 +0x285
github.com/deref/exo/internal/manifest.(*Loader).Load(0xc0002efd10, 0x0)
        /home/ben/Programming/exo/internal/manifest/manifest.go:75 +0x295
github.com/deref/exo/internal/cli.loadManifest({0xf0bcc8, 0xc0004146f0}, {0xef74e0, 0xc000010020}, {0x7ffed199c32e, 0x7})
        /home/ben/Programming/exo/internal/cli/manifest.go:51 +0x1ba
github.com/deref/exo/internal/cli.glob..func25(0x140ed00, {0xc0003b3e00, 0x1, 0x1})
        /home/ben/Programming/exo/internal/cli/manifest_format.go:20 +0x50
github.com/spf13/cobra.(*Command).execute(0x140ed00, {0xc0003b3dd0, 0x1, 0x1})
        /home/ben/go/pkg/mod/github.com/spf13/cobra@v1.2.1/command.go:856 +0x60e
github.com/spf13/cobra.(*Command).ExecuteC(0x1410b00)
        /home/ben/go/pkg/mod/github.com/spf13/cobra@v1.2.1/command.go:974 +0x3bc
github.com/spf13/cobra.(*Command).Execute(...)
        /home/ben/go/pkg/mod/github.com/spf13/cobra@v1.2.1/command.go:902
github.com/deref/exo/internal/cli.Main()
        /home/ben/Programming/exo/internal/cli/root.go:51 +0x6a
main.main()
        /home/ben/Programming/exo/main.go:6 +0x17
@BenElgar BenElgar added bug Something isn't working needs triage Incoming request that needs to be triaged and prioritized labels Nov 5, 2021
@brandonbloom brandonbloom removed the needs triage Incoming request that needs to be triaged and prioritized label Nov 15, 2021
@brandonbloom brandonbloom self-assigned this Nov 15, 2021
@brandonbloom
Copy link
Member

I wouldn't expect this usage to work because the shell truncates (deletes & recreates?) the destination file.

However, it definitely shouldn't crash! 41b229d fixes that.

Though I'll take this as a feature request for being able to do a format-in-place on the manifest file & will follow-up with that soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants