bug: spec with no top-level action panics with index out of range

Open Beginner friendly
#477 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
78/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
go
Domain
testing-qa

Research direction

Start with modelchecker/processor.go, especially Processor.InitializeNode around line 1501, and inspect how it handles files with no top-level actions. Reproduce the panic with the Server spec in the issue, then check the cases with actions only inside a role and with only an assertion. Done when these cases no longer panic and the model checker reports a usable result or error.

Written by the indexing model from the issue text.

Description

fizzbee 0.5.4 from the tap, macos 26, arm64.

a spec with no top-level action crashes the model checker with a go panic.

repro, servers.fizz:

role Server:
    pass
$ fizz servers.fizz
Model checking servers.json
configFileName: fizz.yaml
fizz.yaml not found. Using default options
StateSpaceOptions: options:{max_actions:100  max_concurrent_actions:2}
panic: runtime error: index out of range [0] with length 0

goroutine 1 [running]:
github.com/fizzbee-io/fizzbee/modelchecker.(*Processor).InitializeNode(0x7cdd772c0000)
	modelchecker/processor.go:1501 +0x6d0
github.com/fizzbee-io/fizzbee/modelchecker.(*Processor).Start(0x7cdd772c0000)
	modelchecker/processor.go:1542 +0x50
...

same panic when the only actions are inside a role, and when the file holds only an assertion. with a top-level action Init added the checker runs.

processor.go:1501 is if p.Files[0].Actions[0].Name != "Init" {. the same line is on main at processor.go:1775 (e1287d36c). not tried on a build of main.

Dominant language
Go
Stars
361
Forks
24
Avg merge
1d 3h
Merged PRs (30d)
62

Getting set up

  • Ships a Dockerfile or Docker Compose file
  • No pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from fizzbee-io/fizzbee

All issues in fizzbee-io/fizzbee

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.