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

signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0xb337d2 #128

Closed
MartinX3 opened this issue Apr 25, 2024 · 3 comments
Closed

Comments

@MartinX3
Copy link

MartinX3 commented Apr 25, 2024

Using arch linux I downloaded
https://github.com/pb33f/openapi-changes/releases/download/v0.0.61/openapi-changes_0.0.61_linux_x86_64.tar.gz

Then I executed ./openapi-changes report api-with-examples_2.0.yaml api-with-examples_3.0.yaml
(The files are https://raw.githubusercontent.com/OAI/OpenAPI-Specification/main/examples/v2.0/yaml/api-with-examples.yaml and https://raw.githubusercontent.com/OAI/OpenAPI-Specification/main/examples/v3.0/api-with-examples.yaml)

Which resulted in

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

goroutine 1 [running]:
github.com/pb33f/openapi-changes/cmd.GetReportCommand.func1(0xc0001d8908, {0xc00007cb00, 0x2, 0xd32e0b?})
	/home/runner/work/openapi-changes/openapi-changes/cmd/report.go:200 +0xe52
github.com/spf13/cobra.(*Command).execute(0xc0001d8908, {0xc00007caa0, 0x2, 0x2})
	/home/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:983 +0xaca
github.com/spf13/cobra.(*Command).ExecuteC(0x1742420)
	/home/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:1115 +0x3ff
github.com/spf13/cobra.(*Command).Execute(...)
	/home/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:1039
github.com/pb33f/openapi-changes/cmd.Execute({0x10d1244?, 0x19?}, {0x10db760?, 0xd4155e?}, {0xc00002e840?, 0xc0000061c0?})
	/home/runner/work/openapi-changes/openapi-changes/cmd/root.go:51 +0x91
main.main()
	/home/runner/work/openapi-changes/openapi-changes/openapi-changes.go:29 +0x158

Using the console output it just results in an endless "generating model for commit bla".

This is a v2 vs v3 report.
If I try a v3 vs a completely different v3.1 report it works.

daveshanley added a commit that referenced this issue Apr 25, 2024
@daveshanley daveshanley mentioned this issue Apr 25, 2024
daveshanley added a commit that referenced this issue Apr 25, 2024
@daveshanley
Copy link
Member

This has been fixed in v0.0.62

However, it won't operate as expected, because you cannot compare a v2 spec and a v3 spec. openapi-changes will report an error regarding mis-matched versions.

@MartinX3
Copy link
Author

Thank you! That's perfect.

@MartinX3
Copy link
Author

MartinX3 commented Apr 27, 2024

Ah @daveshanley would it be possible to write openapi version instead of version in the error message?
And also output it as a json like the "no-changes-found" message {"message": "No changes found between specifications"}?
It would the output machine-readable.

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

2 participants