You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have searched for an existing issue, and could not find anything. I believe this is a new bug.
I have read the troubleshooting guide
I have read the troubleshooting guide and I think this is a new bug.
What happened?
I wrote a reconciler hook that registered a Pre hook callback.
It ran, then segfaulted after returning.
The cause is that the Post hook must also be implemented. Otherwise the plugin helper tries to call a null function pointer.
Plugin helper should check that both Pre and Post hooks are non-null and error at registration time. Or it should skip unimplemented hooks.
This was made confusing by the panic handler's swallowing of the stack trace, so all I got was the "error": "panic: runtime error: invalid memory address or nil pointer dereference" but no details. See #33
Cluster resource
No response
Relevant log output
{"level":"info","ts":1719969643.970347,"caller":"pluginhelper/server.go:195","msg":"Panic occurred","error":"runtime error: invalid memory address or nil pointer dereference"}
Code of Conduct
I agree to follow this project's Code of Conduct
The text was updated successfully, but these errors were encountered:
I did not - I used the example plugin as a base but it doesn't implement the reconciler hooks.
I didn't see this anywhere in the docs and examples at the time I was working on it. I expected that the helper would check if the routine was implemented and gracefully, silently skip it if not. That expectation was probably misunderstanding of something fundamental on my part.
I now see that the other implementations do have an unimplemented helper base:
type Implementation struct {
lifecycle.UnimplementedOperatorLifecycleServer
}
whereas mine uses the server type:
type ReconcileHandler struct {
reconciler.ReconcilerHooksServer
}
It would be helpful if the server types had prominent references to the Unimplemented bases in their godoc. A comment in the hello world to mention why it's used wouldn't hurt either.
Is there an existing issue already for this bug?
I have read the troubleshooting guide
What happened?
I wrote a reconciler hook that registered a Pre hook callback.
It ran, then segfaulted after returning.
The cause is that the Post hook must also be implemented. Otherwise the plugin helper tries to call a null function pointer.
Plugin helper should check that both Pre and Post hooks are non-null and error at registration time. Or it should skip unimplemented hooks.
This was made confusing by the panic handler's swallowing of the stack trace, so all I got was the
"error": "panic: runtime error: invalid memory address or nil pointer dereference"
but no details. See #33Cluster resource
No response
Relevant log output
Code of Conduct
The text was updated successfully, but these errors were encountered: