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

[RACE Detector]: pkg/policy/api.(*PortProtocol).Sanitize() #13434

Closed
pchaigno opened this issue Oct 7, 2020 · 0 comments · Fixed by #13471
Closed

[RACE Detector]: pkg/policy/api.(*PortProtocol).Sanitize() #13434

pchaigno opened this issue Oct 7, 2020 · 0 comments · Fixed by #13471
Assignees
Labels
kind/bug/race-detector kind/bug This is a bug in the Cilium logic.

Comments

@pchaigno
Copy link
Member

pchaigno commented Oct 7, 2020

2020-10-05T12:57:56.329244789Z WARNING: DATA RACE
2020-10-05T12:57:56.329247922Z Read at 0x00c0019f3630 by goroutine 263:
2020-10-05T12:57:56.329251307Z   runtime.slicecopy()
2020-10-05T12:57:56.329254549Z       /usr/local/go/src/runtime/slice.go:246 +0x0
2020-10-05T12:57:56.329257910Z   github.com/cilium/cilium/pkg/policy/api.(*PortRule).DeepCopyInto()
2020-10-05T12:57:56.329278486Z       /go/src/github.com/cilium/cilium/pkg/policy/api/zz_generated.deepcopy.go:621 +0x8ab
2020-10-05T12:57:56.329282765Z   github.com/cilium/cilium/pkg/policy/api.(*IngressRule).DeepCopyInto()
2020-10-05T12:57:56.329286722Z       /go/src/github.com/cilium/cilium/pkg/policy/api/zz_generated.deepcopy.go:461 +0x19b
2020-10-05T12:57:56.329290385Z   github.com/cilium/cilium/pkg/policy/api.(*Rule).DeepCopyInto()
2020-10-05T12:57:56.329293844Z       /go/src/github.com/cilium/cilium/pkg/policy/api/zz_generated.deepcopy.go:752 +0x873
2020-10-05T12:57:56.329297624Z   github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2.(*CiliumNetworkPolicy).DeepCopyInto()
2020-10-05T12:57:56.329301583Z       /go/src/github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2/zz_generated.deepcopy.go:386 +0x56a
2020-10-05T12:57:56.329318584Z   github.com/cilium/cilium/pkg/k8s/types.(*SlimCNP).DeepCopyInto()
2020-10-05T12:57:56.329321985Z       /go/src/github.com/cilium/cilium/pkg/k8s/types/zz_generated.deepcopy.go:85 +0x124
2020-10-05T12:57:56.329325361Z   github.com/cilium/cilium/pkg/k8s/types.(*SlimCNP).DeepCopy()
2020-10-05T12:57:56.329328930Z       /go/src/github.com/cilium/cilium/pkg/k8s/types/zz_generated.deepcopy.go:96 +0x504
2020-10-05T12:57:56.329332979Z   github.com/cilium/cilium/pkg/k8s.(*CNPStatusUpdateContext).prepareUpdate()
2020-10-05T12:57:56.329337244Z       /go/src/github.com/cilium/cilium/pkg/k8s/cnp.go:146 +0x8b
2020-10-05T12:57:56.329340829Z   github.com/cilium/cilium/pkg/k8s.(*CNPStatusUpdateContext).UpdateStatus()
2020-10-05T12:57:56.329344254Z       /go/src/github.com/cilium/cilium/pkg/k8s/cnp.go:240 +0x578
2020-10-05T12:57:56.329348290Z   github.com/cilium/cilium/pkg/k8s/watchers.(*K8sWatcher).updateCiliumNetworkPolicyV2AnnotationsOnly.func1()
2020-10-05T12:57:56.329351903Z       /go/src/github.com/cilium/cilium/pkg/k8s/watchers/cilium_network_policy.go:343 +0x7d
2020-10-05T12:57:56.329355363Z   github.com/cilium/cilium/pkg/controller.(*Controller).runController()
2020-10-05T12:57:56.329358858Z       /go/src/github.com/cilium/cilium/pkg/controller/controller.go:205 +0xcb0
2020-10-05T12:57:56.329362706Z 
2020-10-05T12:57:56.329365865Z Previous write at 0x00c0019f3630 by goroutine 28:
2020-10-05T12:57:56.329368984Z   github.com/cilium/cilium/pkg/policy/api.(*PortProtocol).Sanitize()
2020-10-05T12:57:56.329372161Z       /go/src/github.com/cilium/cilium/pkg/policy/api/rule_validation.go:393 +0x17e
2020-10-05T12:57:56.329375345Z   github.com/cilium/cilium/pkg/policy/api.(*PortRule).sanitize()
2020-10-05T12:57:56.329378978Z       /go/src/github.com/cilium/cilium/pkg/policy/api/rule_validation.go:345 +0xe9
2020-10-05T12:57:56.329382486Z   github.com/cilium/cilium/pkg/policy/api.(*IngressRule).sanitize()
2020-10-05T12:57:56.329386037Z       /go/src/github.com/cilium/cilium/pkg/policy/api/rule_validation.go:151 +0xc44
2020-10-05T12:57:56.329389290Z   github.com/cilium/cilium/pkg/policy/api.Rule.Sanitize()
2020-10-05T12:57:56.329395931Z       /go/src/github.com/cilium/cilium/pkg/policy/api/rule_validation.go:71 +0x206
2020-10-05T12:57:56.329399450Z   github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2.(*CiliumNetworkPolicy).Parse()
2020-10-05T12:57:56.329403013Z       /go/src/github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2/cnp_types.go:239 +0x6c4
2020-10-05T12:57:56.329406438Z   github.com/cilium/cilium/pkg/k8s/watchers.(*K8sWatcher).addCiliumNetworkPolicyV2()
2020-10-05T12:57:56.329409544Z       /go/src/github.com/cilium/cilium/pkg/k8s/watchers/cilium_network_policy.go:192 +0x3d2
2020-10-05T12:57:56.329412692Z   github.com/cilium/cilium/pkg/k8s/watchers.(*K8sWatcher).updateCiliumNetworkPolicyV2()
2020-10-05T12:57:56.329416100Z       /go/src/github.com/cilium/cilium/pkg/k8s/watchers/cilium_network_policy.go:312 +0xf7c
2020-10-05T12:57:56.329419414Z   github.com/cilium/cilium/pkg/k8s/watchers.(*K8sWatcher).ciliumNetworkPoliciesInit.func2()
2020-10-05T12:57:56.329422544Z       /go/src/github.com/cilium/cilium/pkg/k8s/watchers/cilium_network_policy.go:156 +0x26e
2020-10-05T12:57:56.329425926Z   k8s.io/client-go/tools/cache.ResourceEventHandlerFuncs.OnUpdate()
2020-10-05T12:57:56.329429583Z       /go/src/github.com/cilium/cilium/vendor/k8s.io/client-go/tools/cache/controller.go:234 +0xa5
2020-10-05T12:57:56.329433115Z   k8s.io/client-go/tools/cache.(*ResourceEventHandlerFuncs).OnUpdate()
2020-10-05T12:57:56.329438196Z       <autogenerated>:1 +0x2e
2020-10-05T12:57:56.329441912Z   github.com/cilium/cilium/pkg/k8s/informer.NewInformerWithStore.func1()
2020-10-05T12:57:56.329445331Z       /go/src/github.com/cilium/cilium/pkg/k8s/informer/informer.go:114 +0x389
2020-10-05T12:57:56.329448884Z   k8s.io/client-go/tools/cache.(*DeltaFIFO).Pop()
2020-10-05T12:57:56.329452256Z       /go/src/github.com/cilium/cilium/vendor/k8s.io/client-go/tools/cache/delta_fifo.go:501 +0x3ab
2020-10-05T12:57:56.329455522Z   k8s.io/client-go/tools/cache.(*controller).processLoop()
2020-10-05T12:57:56.329458980Z       /go/src/github.com/cilium/cilium/vendor/k8s.io/client-go/tools/cache/controller.go:179 +0x83
2020-10-05T12:57:56.329462211Z   k8s.io/client-go/tools/cache.(*controller).processLoop-fm()
2020-10-05T12:57:56.329465492Z       /go/src/github.com/cilium/cilium/vendor/k8s.io/client-go/tools/cache/controller.go:177 +0x44
2020-10-05T12:57:56.329469072Z   k8s.io/apimachinery/pkg/util/wait.BackoffUntil.func1()
2020-10-05T12:57:56.329472442Z       /go/src/github.com/cilium/cilium/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:155 +0x75
2020-10-05T12:57:56.329475720Z   k8s.io/apimachinery/pkg/util/wait.BackoffUntil()
2020-10-05T12:57:56.329479250Z       /go/src/github.com/cilium/cilium/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:156 +0xba
2020-10-05T12:57:56.329483157Z   k8s.io/apimachinery/pkg/util/wait.JitterUntil()
2020-10-05T12:57:56.329487008Z       /go/src/github.com/cilium/cilium/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:133 +0x114
2020-10-05T12:57:56.329495114Z   k8s.io/apimachinery/pkg/util/wait.Until()
2020-10-05T12:57:56.329499412Z       /go/src/github.com/cilium/cilium/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:90 +0x4a7
2020-10-05T12:57:56.329503675Z   k8s.io/client-go/tools/cache.(*controller).Run()
2020-10-05T12:57:56.329507553Z       /go/src/github.com/cilium/cilium/vendor/k8s.io/client-go/tools/cache/controller.go:150 +0x449
2020-10-05T12:57:56.329511339Z 
2020-10-05T12:57:56.329514610Z Goroutine 263 (running) created at:
2020-10-05T12:57:56.329518326Z   github.com/cilium/cilium/pkg/controller.(*Manager).updateController()
2020-10-05T12:57:56.329522651Z       /go/src/github.com/cilium/cilium/pkg/controller/manager.go:120 +0x1029
2020-10-05T12:57:56.329526394Z   github.com/cilium/cilium/pkg/controller.(*Manager).UpdateController()
2020-10-05T12:57:56.329530384Z       /go/src/github.com/cilium/cilium/pkg/controller/manager.go:59 +0xbe4
2020-10-05T12:57:56.329534359Z   github.com/cilium/cilium/pkg/k8s/watchers.(*K8sWatcher).addCiliumNetworkPolicyV2()
2020-10-05T12:57:56.329538371Z       /go/src/github.com/cilium/cilium/pkg/k8s/watchers/cilium_network_policy.go:225 +0x9f0
2020-10-05T12:57:56.329543962Z   github.com/cilium/cilium/pkg/k8s/watchers.(*K8sWatcher).ciliumNetworkPoliciesInit.func1()
2020-10-05T12:57:56.329548341Z       /go/src/github.com/cilium/cilium/pkg/k8s/watchers/cilium_network_policy.go:131 +0x1c6
2020-10-05T12:57:56.329552773Z   k8s.io/client-go/tools/cache.ResourceEventHandlerFuncs.OnAdd()
2020-10-05T12:57:56.329556767Z       /go/src/github.com/cilium/cilium/vendor/k8s.io/client-go/tools/cache/controller.go:227 +0x8f
2020-10-05T12:57:56.329560751Z   k8s.io/client-go/tools/cache.(*ResourceEventHandlerFuncs).OnAdd()
2020-10-05T12:57:56.329564254Z       <autogenerated>:1 +0x2a
2020-10-05T12:57:56.329568307Z   github.com/cilium/cilium/pkg/k8s/informer.NewInformerWithStore.func1()
2020-10-05T12:57:56.329572383Z       /go/src/github.com/cilium/cilium/pkg/k8s/informer/informer.go:119 +0x2a9
2020-10-05T12:57:56.329576023Z   k8s.io/client-go/tools/cache.(*DeltaFIFO).Pop()
2020-10-05T12:57:56.329579558Z       /go/src/github.com/cilium/cilium/vendor/k8s.io/client-go/tools/cache/delta_fifo.go:501 +0x3ab
2020-10-05T12:57:56.329583170Z   k8s.io/client-go/tools/cache.(*controller).processLoop()
2020-10-05T12:57:56.329587030Z       /go/src/github.com/cilium/cilium/vendor/k8s.io/client-go/tools/cache/controller.go:179 +0x83
2020-10-05T12:57:56.329591737Z   k8s.io/client-go/tools/cache.(*controller).processLoop-fm()
2020-10-05T12:57:56.329597015Z       /go/src/github.com/cilium/cilium/vendor/k8s.io/client-go/tools/cache/controller.go:177 +0x44
2020-10-05T12:57:56.329602233Z   k8s.io/apimachinery/pkg/util/wait.BackoffUntil.func1()
2020-10-05T12:57:56.329607275Z       /go/src/github.com/cilium/cilium/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:155 +0x75
2020-10-05T12:57:56.329612575Z   k8s.io/apimachinery/pkg/util/wait.BackoffUntil()
2020-10-05T12:57:56.329623136Z       /go/src/github.com/cilium/cilium/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:156 +0xba
2020-10-05T12:57:56.329628691Z   k8s.io/apimachinery/pkg/util/wait.JitterUntil()
2020-10-05T12:57:56.329633696Z       /go/src/github.com/cilium/cilium/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:133 +0x114
2020-10-05T12:57:56.329638844Z   k8s.io/apimachinery/pkg/util/wait.Until()
2020-10-05T12:57:56.329642565Z       /go/src/github.com/cilium/cilium/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:90 +0x4a7
2020-10-05T12:57:56.329646320Z   k8s.io/client-go/tools/cache.(*controller).Run()
2020-10-05T12:57:56.329650179Z       /go/src/github.com/cilium/cilium/vendor/k8s.io/client-go/tools/cache/controller.go:150 +0x449
2020-10-05T12:57:56.329654145Z 
2020-10-05T12:57:56.329657686Z Goroutine 28 (running) created at:
2020-10-05T12:57:56.329661298Z   github.com/cilium/cilium/pkg/k8s/watchers.(*K8sWatcher).ciliumNetworkPoliciesInit()
2020-10-05T12:57:56.329664699Z       /go/src/github.com/cilium/cilium/pkg/k8s/watchers/cilium_network_policy.go:177 +0x76e
2020-10-05T12:57:56.329668285Z   github.com/cilium/cilium/pkg/k8s/watchers.(*K8sWatcher).EnableK8sWatcher()
2020-10-05T12:57:56.329673591Z       /go/src/github.com/cilium/cilium/pkg/k8s/watchers/watcher.go:480 +0x3c4
2020-10-05T12:57:56.329677357Z   github.com/cilium/cilium/pkg/k8s/watchers.(*K8sWatcher).InitK8sSubsystem()
2020-10-05T12:57:56.329681281Z       /go/src/github.com/cilium/cilium/pkg/k8s/watchers/watcher.go:376 +0x94
2020-10-05T12:57:56.329685301Z   github.com/cilium/cilium/daemon/cmd.NewDaemon()
2020-10-05T12:57:56.329689133Z       /go/src/github.com/cilium/cilium/daemon/cmd/daemon.go:563 +0x28e6
2020-10-05T12:57:56.329692818Z   github.com/cilium/cilium/daemon/cmd.runDaemon()
2020-10-05T12:57:56.329696721Z       /go/src/github.com/cilium/cilium/daemon/cmd/daemon_main.go:1335 +0x664
2020-10-05T12:57:56.329700181Z   github.com/cilium/cilium/daemon/cmd.glob..func1()
2020-10-05T12:57:56.329703694Z       /go/src/github.com/cilium/cilium/daemon/cmd/daemon_main.go:124 +0x18f
2020-10-05T12:57:56.329707278Z   github.com/spf13/cobra.(*Command).execute()
2020-10-05T12:57:56.329711035Z       /go/src/github.com/cilium/cilium/vendor/github.com/spf13/cobra/command.go:846 +0x906
2020-10-05T12:57:56.329714411Z   github.com/spf13/cobra.(*Command).ExecuteC()
2020-10-05T12:57:56.329718111Z       /go/src/github.com/cilium/cilium/vendor/github.com/spf13/cobra/command.go:950 +0x4b2
2020-10-05T12:57:56.329722069Z   github.com/spf13/cobra.(*Command).Execute()
2020-10-05T12:57:56.329725666Z       /go/src/github.com/cilium/cilium/vendor/github.com/spf13/cobra/command.go:887 +0x88
2020-10-05T12:57:56.329729338Z   github.com/cilium/cilium/daemon/cmd.Execute()
2020-10-05T12:57:56.329731705Z       /go/src/github.com/cilium/cilium/daemon/cmd/daemon_main.go:149 +0x69
2020-10-05T12:57:56.329734024Z   main.main()
2020-10-05T12:57:56.329739443Z       /go/src/github.com/cilium/cilium/daemon/main.go:22 +0x2f
2020-10-05T12:57:56.329741839Z   runtime.main()
2020-10-05T12:57:56.329744110Z       /usr/local/go/src/runtime/proc.go:204 +0x208
2020-10-05T12:57:56.329746390Z   github.com/cilium/ebpf.init()
2020-10-05T12:57:56.329748894Z       /go/src/github.com/cilium/cilium/vendor/github.com/cilium/ebpf/prog.go:362 +0x3f8
2020-10-05T12:57:56.329751286Z   github.com/cilium/ebpf.init()
2020-10-05T12:57:56.329753519Z       /go/src/github.com/cilium/cilium/vendor/github.com/cilium/ebpf/syscalls.go:392 +0x38b
2020-10-05T12:57:56.329755912Z   github.com/cilium/ebpf.init()
2020-10-05T12:57:56.329758127Z       /go/src/github.com/cilium/cilium/vendor/github.com/cilium/ebpf/syscalls.go:216 +0x31d
2020-10-05T12:57:56.329760443Z   github.com/cilium/ebpf.init()
2020-10-05T12:57:56.329762655Z       /go/src/github.com/cilium/cilium/vendor/github.com/cilium/ebpf/syscalls.go:188 +0x2b0
2020-10-05T12:57:56.329764969Z   runtime.doInit()
2020-10-05T12:57:56.329767250Z       /usr/local/go/src/runtime/proc.go:5625 +0x89
2020-10-05T12:57:56.329769533Z   github.com/cilium/ebpf/internal/btf.init()
2020-10-05T12:57:56.329771831Z       /go/src/github.com/cilium/cilium/vendor/github.com/cilium/ebpf/internal/btf/btf.go:656 +0x18f

https://jenkins.cilium.io/view/Race%20Detection/job/Ginkgo-CI-Tests-k8s1.19-Pipeline-Race-Detection/6/testReport/junit/Suite-k8s-1/19/K8sPolicyTest_Basic_Test_Validate_CNP_update_Enforces_connectivity_correctly_when_the_same_L3_L4_CNP_is_updated/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug/race-detector kind/bug This is a bug in the Cilium logic.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants