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: runtime error: invalid memory address or nil pointer dereference #14118

Closed
S-Paul opened this issue Oct 16, 2023 · 4 comments
Closed

panic: runtime error: invalid memory address or nil pointer dereference #14118

S-Paul opened this issue Oct 16, 2023 · 4 comments
Labels
bug unexpected problem or unintended behavior

Comments

@S-Paul
Copy link

S-Paul commented Oct 16, 2023

Relevant telegraf.conf

[global_tags]
[agent]
  interval = "10s"
  round_interval = true
  metric_batch_size = 1000
  metric_buffer_limit = 10000
  collection_jitter = "0s"
  flush_interval = "10s"
  flush_jitter = "0s"
  precision = ""
  hostname = ""
  omit_hostname = false

Logs from Telegraf

Oct 16 13:05:54 vs112 telegraf[369890]: panic: runtime error: invalid memory address or nil pointer dereference
Oct 16 13:05:54 vs112 telegraf[369890]: [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0xae4174]
Oct 16 13:05:54 vs112 telegraf[369890]: goroutine 1 [running]:
Oct 16 13:05:54 vs112 telegraf[369890]: github.com/awnumar/memguard/core.Purge.func1(0xc000043c70)
Oct 16 13:05:54 vs112 telegraf[369890]: #011/go/pkg/mod/github.com/awnumar/[email protected]/core/exit.go:23 +0x34
Oct 16 13:05:54 vs112 telegraf[369890]: github.com/awnumar/memguard/core.Purge()
Oct 16 13:05:54 vs112 telegraf[369890]: #011/go/pkg/mod/github.com/awnumar/[email protected]/core/exit.go:51 +0x1e
Oct 16 13:05:54 vs112 telegraf[369890]: github.com/awnumar/memguard/core.Panic(...)
Oct 16 13:05:54 vs112 telegraf[369890]: #011/go/pkg/mod/github.com/awnumar/[email protected]/core/exit.go:85
Oct 16 13:05:54 vs112 telegraf[369890]: github.com/awnumar/memguard/core.NewBuffer(0x20)
Oct 16 13:05:54 vs112 telegraf[369890]: #011/go/pkg/mod/github.com/awnumar/[email protected]/core/buffer.go:73 +0x51c
Oct 16 13:05:54 vs112 telegraf[369890]: github.com/awnumar/memguard/core.NewCoffer()
Oct 16 13:05:54 vs112 telegraf[369890]: #011/go/pkg/mod/github.com/awnumar/[email protected]/core/coffer.go:30 +0x2d
Oct 16 13:05:54 vs112 telegraf[369890]: github.com/awnumar/memguard/core.init.0()
Oct 16 13:05:54 vs112 telegraf[369890]: #011/go/pkg/mod/github.com/awnumar/[email protected]/core/enclave.go:15 +0x29
Oct 16 13:05:54 vs112 systemd[1]: telegraf.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
Oct 16 13:05:54 vs112 systemd[1]: telegraf.service: Failed with result 'exit-code'.
Oct 16 13:05:54 vs112 systemd[1]: Failed to start Telegraf.

System info

Telegraf 1.25 - 1.28, Almalinux 8, x86_64

Docker

No response

Steps to reproduce

  1. Install latest telegraf from repo
  2. Start telegraf systemd-unit or "telegraf --test -config /etc/telegraf/telegraf.conf -config-directory /etc/telegraf/telegraf.d"
  3. Got error...
    ...

Expected behavior

I expect "ok"

Actual behavior

I got error

Additional info

Last working telegraf version on AlmaLinux 8 - 1.24.4-1

@S-Paul S-Paul added the bug unexpected problem or unintended behavior label Oct 16, 2023
@powersj
Copy link
Contributor

powersj commented Oct 16, 2023

Hi,

The error is coming from the memguard library we use to store secrets. The stack trace can happen when memguard was unable to lock memory. This matches previous issues (e.g. #12502, #12838)

If you are running in a container you may need to add the --capability=CAP_IPC_LOCK.

@powersj powersj added the waiting for response waiting for response from contributor label Oct 16, 2023
@S-Paul
Copy link
Author

S-Paul commented Oct 17, 2023 via email

@telegraf-tiger telegraf-tiger bot removed the waiting for response waiting for response from contributor label Oct 17, 2023
@powersj
Copy link
Contributor

powersj commented Oct 17, 2023

What we have seen from users is they add that flag to the nspawn command: awnumar/memguard#144 (comment)

@powersj powersj closed this as not planned Won't fix, can't repro, duplicate, stale Oct 17, 2023
@S-Paul
Copy link
Author

S-Paul commented Oct 17, 2023 via email

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