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

Sending HTTP with SBOM Returning Status 500, StackOverFlow Error in Logs #153

Closed
zvigrinberg opened this issue Sep 14, 2023 · 1 comment
Closed

Comments

@zvigrinberg
Copy link
Contributor

Description

When Sending HTTP Request with SBOM , it Returns Status 500 with empty body, and in logs StackOverFlow exception is dumped.

Investigation

It appears that if there is Cyclic References in the bom , it causes this infinite loop when trying to build the dependencies tree.

For Instance, takes this partial sbom.

[
  {
            "ref": "pkg:golang/cloud.google.com/[email protected]",
            "dependsOn": [
                "pkg:golang/cloud.google.com/go/[email protected]",
                "pkg:golang/github.com/golang/[email protected]",
                "pkg:golang/github.com/google/[email protected]",
                "pkg:golang/github.com/google/martian/[email protected]",
                "pkg:golang/github.com/googleapis/gax-go/[email protected]",
                "pkg:golang/[email protected]",
                "pkg:golang/golang.org/x/[email protected]",
                "pkg:golang/golang.org/x/[email protected]",
                "pkg:golang/google.golang.org/[email protected]",
                "pkg:golang/google.golang.org/[email protected]",
                "pkg:golang/google.golang.org/[email protected]",
                "pkg:golang/google.golang.org/[email protected]"
            ]
        },

 {
            "ref": "pkg:golang/cloud.google.com/go/[email protected]",
            "dependsOn": [
                "pkg:golang/cloud.google.com/[email protected]",
                "pkg:golang/github.com/google/[email protected]",
                "pkg:golang/github.com/googleapis/gax-go/[email protected]",
                "pkg:golang/golang.org/x/[email protected]",
                "pkg:golang/google.golang.org/[email protected]",
                "pkg:golang/google.golang.org/[email protected]",
                "pkg:golang/google.golang.org/[email protected]",
                "pkg:golang/google.golang.org/[email protected]"
            ]
        }
]

This cyclic references causes to infinite loop, and this cyclic reference is originally from the go mod graph.

image

image

Need to decide how to detect such cycle in dependency graph ( cyclic detection) and prune further calls in such case to resolve infinite loop.

@zvigrinberg
Copy link
Contributor Author

solved by #157

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