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

Segfault when no access on directory #115

Closed
GeoffreyFrogeye opened this issue Jun 11, 2020 · 1 comment
Closed

Segfault when no access on directory #115

GeoffreyFrogeye opened this issue Jun 11, 2020 · 1 comment

Comments

@GeoffreyFrogeye
Copy link

Context

Specifiying a path in the input section where the user running grok_exporter doesn't have rights to open a folder in the path e.g. /var/log/software/software.log where the user don't have access to the software folder.

Actual behavior

It segfaults:

Starting server on http://machinename:9144/metrics
panic: runtime error: invalid memory address or nil pointer dereference
	panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x89f652]

goroutine 15 [running]:
github.com/fstab/grok_exporter/tailer/fswatcher.(*watcher).unwatchDir(0xc000195cb8, 0x0, 0x28, 0x8)
	/go/src/github.com/fstab/grok_exporter/tailer/fswatcher/fswatcher_linux.go:38 +0x42
github.com/fstab/grok_exporter/tailer/fswatcher.(*fileTailer).shutdown(0xc000241440)
	/go/src/github.com/fstab/grok_exporter/tailer/fswatcher/fswatcher.go:211 +0xbb
panic(0x96ab60, 0x108f0b0)
	/usr/local/go/src/runtime/panic.go:679 +0x1b2
github.com/fstab/grok_exporter/tailer/fswatcher.(*Dir).Path(...)
	/go/src/github.com/fstab/grok_exporter/tailer/fswatcher/file_linux.go:29
github.com/fstab/grok_exporter/tailer/fswatcher.runFileTailer.func1(0xc000241440, 0xadcce0, 0xc000259e30, 0xc0002567d0, 0x9e0001)
	/go/src/github.com/fstab/grok_exporter/tailer/fswatcher/fswatcher.go:146 +0x19f
created by github.com/fstab/grok_exporter/tailer/fswatcher.runFileTailer
	/go/src/github.com/fstab/grok_exporter/tailer/fswatcher/fswatcher.go:129 +0x212

Expected behaviour

Get an error in the lines of Permission denied

Info

From release : grok_exporter-1.0.0.RC3.linux-amd64.zip

OS: Debian 9

@fstab
Copy link
Owner

fstab commented Jun 12, 2020

Thanks a lot for reporting. Fixed it.

@fstab fstab closed this as completed Jun 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants