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

EXEC plugin panics on Freebsd (panic: runtime error: index out of range) #1330

Closed
lunetics opened this issue Jun 4, 2016 · 1 comment · Fixed by #1357
Closed

EXEC plugin panics on Freebsd (panic: runtime error: index out of range) #1330

lunetics opened this issue Jun 4, 2016 · 1 comment · Fixed by #1357
Labels
bug unexpected problem or unintended behavior

Comments

@lunetics
Copy link

lunetics commented Jun 4, 2016

I'm getting a crash with latest master build from src on freebsd 10.3 with the exec plugin:

panic: runtime error: index out of range

goroutine 28 [running]:
panic(0x10ac8c0, 0xc820010130)
    /usr/local/go/src/runtime/panic.go:481 +0x3e6
github.com/influxdata/telegraf/plugins/inputs/exec.(*Exec).Gather(0xc8201b6000, 0x801cb6f78, 0xc8200834a0, 0x0, 0x0)
    /root/work/src/github.com/influxdata/telegraf/plugins/inputs/exec/exec.go:181 +0x7b5
github.com/influxdata/telegraf/agent.gatherWithTimeout.func1(0xc820012660, 0xc820176660, 0xc8200834a0)
    /root/work/src/github.com/influxdata/telegraf/agent/agent.go:161 +0x73
created by github.com/influxdata/telegraf/agent.gatherWithTimeout
    /root/work/src/github.com/influxdata/telegraf/agent/agent.go:162 +0xe0

with 13.1 everything works fine. just want that zfs plugin

also tested the config path with:

    commands = ["/bin/echo"]
@lunetics lunetics changed the title EXEC plugin panics on Freebsd EXEC plugin panics on Freebsd (panic: runtime error: index out of range) Jun 4, 2016
@lunetics
Copy link
Author

lunetics commented Jun 4, 2016

Just found out adding a space at the end makes the command work. So commands with no parameter give that panic.

not a GO dev but with not args it shouldn't jump to line 181:

commands, strings.Join([]string{match, cmdAndArgs[1]}, " "))
   commands = ["/bin/echo "]

@sparrc sparrc added the bug unexpected problem or unintended behavior label Jun 4, 2016
sparrc added a commit that referenced this issue Jun 10, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug unexpected problem or unintended behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants