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

Panic when using JSON stdout metric output #714

Closed
na-- opened this issue Jul 17, 2018 · 1 comment · Fixed by #715
Closed

Panic when using JSON stdout metric output #714

na-- opened this issue Jul 17, 2018 · 1 comment · Fixed by #715

Comments

@na--
Copy link
Member

na-- commented Jul 17, 2018

When executing even a very simple script (k6 run -o json samples/http_get.js) with the latest master code, the following panic happens:

...
{"type":"Metric","data":{"name":"vus_max","type":"gauge","contains":"default","tainted":null,"thresholds":[],"submetrics":null,"sub":{"name":"","parent":"","suffix":"","tags":null}},"metric":"vus_max"}
{"type":"Point","data":{"time":"2018-07-17T12:59:17.321885342+03:00","value":1,"tags":null},"metric":"vus_max"}
panic: write /dev/stdout: file already closed

goroutine 1 [running]:
github.com/loadimpact/k6/cmd.fprintf(0xe7a560, 0xc421d260a0, 0xd05fe4, 0x7, 0xc420c0bce0, 0x1, 0x1, 0x50)
	/home/go/src/github.com/loadimpact/k6/cmd/root.go:116 +0xf0
github.com/loadimpact/k6/cmd.glob..func11(0x14c4220, 0xc4204249c0, 0x1, 0x3, 0x0, 0x0)
	/home/go/src/github.com/loadimpact/k6/cmd/run.go:400 +0x332e
github.com/loadimpact/k6/vendor/github.com/spf13/cobra.(*Command).execute(0x14c4220, 0xc420424930, 0x3, 0x3, 0x14c4220, 0xc420424930)
	/home/go/src/github.com/loadimpact/k6/vendor/github.com/spf13/cobra/command.go:698 +0x46d
github.com/loadimpact/k6/vendor/github.com/spf13/cobra.(*Command).ExecuteC(0x14c4000, 0x52, 0xc42000c1a0, 0xc420458000)
	/home/go/src/github.com/loadimpact/k6/vendor/github.com/spf13/cobra/command.go:783 +0x2e4
github.com/loadimpact/k6/vendor/github.com/spf13/cobra.(*Command).Execute(0x14c4000, 0xc420089f78, 0x405d8c)
	/home/go/src/github.com/loadimpact/k6/vendor/github.com/spf13/cobra/command.go:736 +0x2b
github.com/loadimpact/k6/cmd.Execute()
	/home/go/src/github.com/loadimpact/k6/cmd/root.go:87 +0x31
main.main()
	/home/go/src/github.com/loadimpact/k6/main.go:28 +0x20

@na--
Copy link
Member Author

na-- commented Jul 17, 2018

The panic seems to be the result of the fixes I did last week to comply with the latest errcheck changes, but that just means that the issue was there before (trying to write to a closed stdout), we just silently ignored it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant