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

SIGSEGV on fastly backend create (v1.7.0) #540

Closed
jfoote opened this issue Mar 10, 2022 · 6 comments · Fixed by #542
Closed

SIGSEGV on fastly backend create (v1.7.0) #540

jfoote opened this issue Mar 10, 2022 · 6 comments · Fixed by #542
Labels
bug Something isn't working

Comments

@jfoote
Copy link

jfoote commented Mar 10, 2022

Version

% fastly version
Fastly CLI version 1.7.0 (6150a45)
Built with go version go1.17.7 linux/amd64

What happened

Hello. I got a SIGSEGV when attempting to run fastly backend create. See details below.

fastly backend create --version=latest --name=<REDACTED> --address=<REDACTED_IPV4_ADDRESS> --port=8080
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x13e52df]

goroutine 1 [running]:
github.com/fastly/kingpin.(*uintValue).Set(0xc000206528, {0x20671656d, 0x19acbc0})
	/home/runner/go/pkg/mod/github.com/fastly/kingpin@v2.1.12-0.20191105091915-95d230a53780+incompatible/values_generated.go:679 +0x3f
github.com/fastly/kingpin.(*Application).setValues(0xc0003c0ea0, 0xc0004cc160)
	/home/runner/go/pkg/mod/github.com/fastly/kingpin@v2.1.12-0.20191105091915-95d230a53780+incompatible/app.go:479 +0x354
github.com/fastly/kingpin.(*Application).Parse(0xc0003c0ea0, {0xc000030080, 0x19ac978, 0x4})
	/home/runner/go/pkg/mod/github.com/fastly/kingpin@v2.1.12-0.20191105091915-95d230a53780+incompatible/app.go:240 +0xd0
github.com/fastly/cli/pkg/app.processCommandInput({0x19f1b48, {0xc000030080, 0x6, 0x6}, {{{0xc00024a280, 0x34}, {0xc00020a298, 0x2}, {0xc0002221e0, 0x19}, ...}, ...}, ...}, ...)
	/home/runner/work/cli/cli/pkg/app/usage.go:319 +0x6b4
github.com/fastly/cli/pkg/app.Run({0x19f1b48, {0xc000030080, 0x6, 0x6}, {{{0xc00024a280, 0x34}, {0xc00020a298, 0x2}, {0xc0002221e0, 0x19}, ...}, ...}, ...})
	/home/runner/work/cli/cli/pkg/app/run.go:95 +0x952
main.main()
	/home/runner/work/cli/cli/cmd/fastly/main.go:183 +0xa58

OS details follow

% sw_vers
ProductName:	macOS
ProductVersion:	12.2.1
BuildVersion:	21D62
@jfoote jfoote added the bug Something isn't working label Mar 10, 2022
@fgsch
Copy link
Member

fgsch commented Mar 10, 2022

Confirmed. Can repro with fastly backend create --address=1.2.3.4 --port=8080.

@Integralist
Copy link
Collaborator

Thanks @jfoote for raising this issue, and thanks @fgsch for validating!

Yup it looks like the --port is the culprit. The moment I add that it explodes 😬

I'll take a look into this soon.

@fgsch
Copy link
Member

fgsch commented Mar 10, 2022

Same issue with fastly healthcheck create --timeout=10

@fgsch
Copy link
Member

fgsch commented Mar 11, 2022

For completion, I believe it affects all these:

pkg/commands/healthcheck/create.go:	c.CmdClause.Flag("timeout", "Timeout in milliseconds").UintVar(c.Input.Timeout)
pkg/commands/healthcheck/create.go:	c.CmdClause.Flag("check-interval", "How often to run the healthcheck in milliseconds").UintVar(c.Input.CheckInterval)
pkg/commands/healthcheck/create.go:	c.CmdClause.Flag("expected-response", "The status code expected from the host").UintVar(c.Input.ExpectedResponse)
pkg/commands/healthcheck/create.go:	c.CmdClause.Flag("window", "The number of most recent healthcheck queries to keep for this healthcheck").UintVar(c.Input.Window)
pkg/commands/healthcheck/create.go:	c.CmdClause.Flag("threshold", "How many healthchecks must succeed to be considered healthy").UintVar(c.Input.Threshold)
pkg/commands/healthcheck/create.go:	c.CmdClause.Flag("initial", "When loading a config, the initial number of probes to be seen as OK").UintVar(c.Input.Initial)
pkg/commands/backend/create.go:	c.CmdClause.Flag("port", "Port number of the address").UintVar(c.Input.Port)
pkg/commands/backend/create.go:	c.CmdClause.Flag("connect-timeout", "How long to wait for a timeout in milliseconds").UintVar(c.Input.ConnectTimeout)
pkg/commands/backend/create.go:	c.CmdClause.Flag("max-conn", "Maximum number of connections").UintVar(c.Input.MaxConn)
pkg/commands/backend/create.go:	c.CmdClause.Flag("first-byte-timeout", "How long to wait for the first bytes in milliseconds").UintVar(c.Input.FirstByteTimeout)
pkg/commands/backend/create.go:	c.CmdClause.Flag("between-bytes-timeout", "How long to wait between bytes in milliseconds").UintVar(c.Input.BetweenBytesTimeout)
pkg/commands/backend/create.go:	c.CmdClause.Flag("weight", "Weight used to load balance this backend against others").UintVar(c.Input.Weight)

@Integralist
Copy link
Collaborator

Thanks @jfoote for raising this issue. I've fixed the problem in our main branch and will shortly cut a new patch release.

@jfoote
Copy link
Author

jfoote commented Mar 15, 2022

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants