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

Adding a non-existant dep results in uncontrolled panic WHEN calling Analyze/Run #3

Open
Itxaka opened this issue Feb 21, 2023 · 0 comments

Comments

@Itxaka
Copy link
Collaborator

Itxaka commented Feb 21, 2023

package main

import (
	"github.com/spectrocloud-labs/herd"
)

func main() {
	g := herd.DAG()
	g.Add("one", herd.WithDeps("broken"))
	g.Analyze() // or g.Run(context.Background())
}

Results in:

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

goroutine 1 [running]:
github.com/spectrocloud-labs/herd.(*Graph).buildStateGraph(0xc00010e210)
        /home/itxaka/go/pkg/mod/github.com/spectrocloud-labs/[email protected]/dag.go:85 +0x214
github.com/spectrocloud-labs/herd.(*Graph).Analyze(...)
        /home/itxaka/go/pkg/mod/github.com/spectrocloud-labs/[email protected]/dag.go:98
main.main()
        /home/itxaka/projects/immucore/test/main.go:10 +0x91

Why I understand why this is, maybe its possible to catch, log and exit with Fatal claiming that some deps are non-existant.

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