Skip to content

[bug] Infinite recursion in Provisioner.Class(), Type(), and Description() methods #481

@Abhishek9639

Description

@Abhishek9639

Describe the bug
The Provisioner struct in the environment provisioner package has three methods Class(), Type(), and Description() that call themselves unconditionally, causing infinite recursion and a stack overflow crash whenever they're invoked.

To Reproduce

  1. Go to internal/provisioners/envprov/envprov.go
  2. Look at the Provisioner receiver methods around lines 147–162
  3. Call any of Class(), Type(), or Description() on a *Provisioner value
  4. The program crashes with a stack overflow

Expected behavior
These methods should return a meaningful string value (or an empty string), not recurse into themselves. The sibling type envVarResourceTracker implements them correctly by returning stored fields like e.resClass.

Screenshots

func (p *Provisioner) Class() string {
	return p.Class() // calls itself infinitely
}
func (p *Provisioner) Type() string {
	return p.Type() // calls itself infinitely
}
func (p *Provisioner) Description() string {
	return p.Description() // calls itself infinitely
}

Desktop (please complete the following information):

  • OS: All platforms
  • Version: latest main branch

Additional context
These methods are currently not hit in normal CLI flows, which is why the bug has survived undetected. However, any future code that logs, debugs, or inspects a Provisioner value by calling these methods will immediately crash the binary. A simple fix would be to return a static string like "" or "*" from each method.

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions