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

Telegraf SIGSEGV in mikrotik routeros container due to memguard #14157

Closed
sarim opened this issue Oct 22, 2023 · 1 comment
Closed

Telegraf SIGSEGV in mikrotik routeros container due to memguard #14157

sarim opened this issue Oct 22, 2023 · 1 comment
Labels
bug unexpected problem or unintended behavior

Comments

@sarim
Copy link

sarim commented Oct 22, 2023

Relevant telegraf.conf

Not Relevant

Logs from Telegraf

10-23 00:48:11 container,info,debug import successful, container e9d7ed00-bbae-4aa9-903b-0a1fee102ea5
 10-23 00:49:08 container,info,debug panic: runtime error: invalid memory address or nil pointer dereference
 10-23 00:49:08 container,info,debug [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x676450]
 10-23 00:49:08 container,info,debug 
 10-23 00:49:08 container,info,debug goroutine 1 [running]:
 10-23 00:49:08 container,info,debug github.com/awnumar/memguard/core.Purge.func1(0x58413e0?)
 10-23 00:49:08 container,info,debug t/bitnami/blacksmith-sandox/telegraf-1.28.2/pkg/mod/github.com/awnumar/[email protected]/core/exit.go:23 +0x30
 10-23 00:49:08 container,info,debug github.com/awnumar/memguard/core.Purge()
 10-23 00:49:08 container,info,debug t/bitnami/blacksmith-sandox/telegraf-1.28.2/pkg/mod/github.com/awnumar/[email protected]/core/exit.go:51 +0x24
 10-23 00:49:08 container,info,debug github.com/awnumar/memguard/core.Panic(...)
 10-23 00:49:08 container,info,debug t/bitnami/blacksmith-sandox/telegraf-1.28.2/pkg/mod/github.com/awnumar/[email protected]/core/exit.go:85
 10-23 00:49:08 container,info,debug github.com/awnumar/memguard/core.NewBuffer(0x20)
 10-23 00:49:08 container,info,debug t/bitnami/blacksmith-sandox/telegraf-1.28.2/pkg/mod/github.com/awnumar/[email protected]/core/buffer.go:73 +0x410
 10-23 00:49:08 container,info,debug github.com/awnumar/memguard/core.NewCoffer()
 10-23 00:49:08 container,info,debug t/bitnami/blacksmith-sandox/telegraf-1.28.2/pkg/mod/github.com/awnumar/[email protected]/core/coffer.go:31 +0x64
 10-23 00:49:08 container,info,debug github.com/awnumar/memguard/core.init.0()
 10-23 00:49:08 container,info,debug t/bitnami/blacksmith-sandox/telegraf-1.28.2/pkg/mod/github.com/awnumar/[email protected]/core/enclave.go:15 +0x34

System info

Telegraf 1.28.2. Mikrotik Routeros 7.11.2

Docker

Mikrotik doesn't use docker or podman. It has its own container implementation based on linux kernel.

Steps to reproduce

  1. Import telegraf container. Official "telegraf" image or, "bitnami/telegraf"
  2. Run container

Expected behavior

Telegraf runs successfully.

Actual behavior

SIGSEGV

Additional info

I tried the official "telegraf" image from dockerhub. It panics, but doesn't log stacktrace. Then I tried "bitnami/telegraf" container. It showed the stracktrace. I'm guessing the official container is panicing due to same reason.

I know this bug report is kinda pointless as I already found similiar issues. But for sake of completeness and future googlers with terms "telegraf mikrotik", I thought it should be posted.

Relevant:
#13804
#13998

@sarim sarim added the bug unexpected problem or unintended behavior label Oct 22, 2023
@powersj
Copy link
Contributor

powersj commented Oct 23, 2023

Those relevant PRs also link to other issues explaining that this means in a docker environment that the memguard library was unable to lock memory.

Once those relevant PRs are implemented you will have an option to disable this behavior. Additionally, you could ensure you have lockable memory. In either case I am closing this PR as this is already covered by others.

@powersj powersj closed this as not planned Won't fix, can't repro, duplicate, stale Oct 23, 2023
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

No branches or pull requests

2 participants