-
Notifications
You must be signed in to change notification settings - Fork 571
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
invalid memory address or nil pointer dereference #481
Comments
It seems Pod parameter may be nil - see the following from delegateAdd().
However, GetReference() checks obj against nil at the beginning:
|
Looking at staging/src/k8s.io/client-go/tools/reference/ref.go from k8s, the following code:
is not in vendor/k8s.io/client-go/tools/reference/ref.go Probably the golang version is a hurdle to adopting newer k8s release for multus . Do you have some suggestion how vendor/k8s.io/client-go/tools/reference/ref.go should evolve ? Thanks |
fix-get-ref.txt is the application of the following from k8s commit 399d09ce4ad1728fcecdce09503a07cf1bfecef6 to vendor/k8s.io/client-go/tools/reference/ref.go But it seems with the above patch, obj.GetObjectKind() would be called without obj being changed (compared to what multus has now). The panic would still likely occur. |
One option I can think of is to add recovery around the calls to Eventf:
|
@tedyu Thank you for your report and analysis! Let me try to fix that. |
Now trying to update lib to v1.18.0, including vendored packages.... |
k8s 1.18 is on go 1.13 Not sure about the impact for upgrading golang version. I ran multus test suite which passed. Not sure if the kubeClient.Eventf() call is exercised. Thanks |
@tedyu Currently we don't test the kubeClient.Eventf() because it invokes just Eventf of client-go, so I'm going to add some test in its fix. BTW, in intel/multus-cni uses go1.13 to build multus-cni. Which one do you mention (that builds with go1.12)? OpenShift or some? |
oh, I got it. you mentioned that container build (Dockerfile)... |
w.r.t. golang version, I saw the following in go.mod:
I took a look at vendor/k8s.io/api/core/v1/generated.pb.go but didn't find (*Pod).GetObjectKind Please publish your test so that we know the crash can be reproduced locally. Thanks |
@tedyu thank you for your advice! sure. I'll add test first. |
Contemplating possible cause for nil dereference, that may happen if Pod.GetObjectKind tries to dereference some pointer. Looking at GetObjectKind methods in k8s, one example is the following:
Not sure if this applies to Pod.GetObjectKind since I haven't found its body. |
I am not sure but GetReference() invokes GetObjectKind() here, so it might be the one. So the candidate flows seems to be |
To troubleshooting k8snetworkplumbingwg#481, adds error message for further analysis.
To troubleshooting #481, adds error message for further analysis.
To troubleshooting #481, adds error message for further analysis.
To troubleshooting #481, adds error message for further analysis.
What happend:
What you expected to happen:
Logging event shouldn't crash.
How to reproduce it (as minimally and precisely as possible):
Anything else we need to know?:
See masters-journal in:
https://gcsweb-ci.svc.ci.openshift.org/gcs/origin-ci-test/logs/release-openshift-ocp-installer-e2e-gcp-4.5/798/artifacts/e2e-gcp/nodes/
Environment:
image path and image ID (from 'docker images')
kubectl version
):kubectl get net-attach-def -o yaml
)kubectl get pod <podname> -o yaml
)The text was updated successfully, but these errors were encountered: