-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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 #12502
Comments
This sounds very similar to #12403, which is due to awnumar/memguard#144 |
@girgen - was this run in a jail or some other type of container? Or was this on a vanilla freebsd system? |
Ah, yes, in a jail. Sorry, forgot to mention that. I run most stuff in jails. |
Is there a way simple, or a least not too hard, way to opt-out that module at buildtime? That would mean to opt out the secret stash feature, but as a short term solution, that would be preferred. My other alternative is to let the start script fail and inform the user to reconfigure the jail if it does not have the Third alternative would be to downgrade the port until the problem is fixed. The first alternativ is preferred. Can we fix a patch for the source code that opts out that module? Best regards, |
The panic occurs during an Using err := unix.Mlockall(unix.MCL_FUTURE | unix.MCL_CURRENT) But not sure how that reacts on non-linux/unix systems, need to play with this further. |
Mm, yeah, something like package core
import (
"golang.org/x/sys/unix"
"github.com/awnumar/memcall"
)
func init() {
err := unix.Mlockall(unix.MCL_FUTURE | unix.MCL_CURRENT)
if (err != nil) { but then what? :) How can I opt out in that case? 🤔 |
My first goal was to try to see how that library could not panic, which would allow us to continue using the library. The opt-out would then not be necessary, as we can safely import it and would only need to throw and error if someone tried to use the secret-store features when the jail/container/etc. did not have the correct privilege. For now, I believe what you should document is the need to add the least amount of privileges. I think that is the |
Adding Details from my issue (for posterity/relevance): Running FreeBSD 13.1 RELEASE (telegraf-1.25), problems started suddenly around a month ago. Configs have been untouched for a very long time, but telegraf updates are automated.
Errors above are identical to those seen in issue #12403. |
Hi, While this is workaround, I would still like to pursue the idea of actually change the code to afvoid using the mlock. Is the mlock really necessary? |
The memguard library is used by Telegraf in the secret store functionality and that is not a feature we are going to remove. If you have an idea as to workaround the import of the library when not necessary please do put up a PR. |
Relevant telegraf.conf
The text was updated successfully, but these errors were encountered: