github-vet / github-vet/rangeloop-pointer-findings

ZJUGodwei/K8Srely: src/k8s.io/kubernetes/federation/test/e2e/apiserver.go; 3 LoC

Open
#9,144 0 comments 0 reactions 0 assignees View on GitHub
fresh tiny
Dominant language
No language data
Stars
0
Forks
0
PR merge metrics
PR metrics pending

Description

Found a possible issue in [ZJUGodwei/K8Srely](https://www.github.com/ZJUGodwei/K8Srely) at [src/k8s.io/kubernetes/federation/test/e2e/apiserver.go](https://github.com/ZJUGodwei/K8Srely/blob/999c38701ab5232e11a283881b2013cc903db33b/src/k8s.io/kubernetes/federation/test/e2e/apiserver.go#L55-L57)

Below is the message reported by the analyzer for this snippet of code. Beware that the analyzer only reports the first
issue it finds, so please do not limit your consideration to the contents of the below message.

> function call which takes a reference to context at line 56 may start a goroutine

[Click here to see the code in its original context.](https://github.com/ZJUGodwei/K8Srely/blob/999c38701ab5232e11a283881b2013cc903db33b/src/k8s.io/kubernetes/federation/test/e2e/apiserver.go#L55-L57)

Click here to show the 3 line(s) of Go which triggered the analyzer.

```go
for _, context := range contexts {
createClusterObjectOrFail(f, &context, testClusterPrefix)
}

```

Click here to show extra information the analyzer produced.

```
The following graphviz dot graph describes paths through the callgraph that could lead to a function calling a goroutine:
digraph G {
"(Delete, 2)" -> {"(processRaftRequest, 2)";}
"(Put, 2)" -> {"(processRaftRequest, 2)";}
"(run, 1)" -> {"(SetUp, 1)";}
"(NewServer, 1)" -> {"(startNode, 3)";"(restartNode, 2)";"(restartAsStandaloneNode, 2)";}
"(Server, 2)" -> {"(NewServer, 1)";"(newStreamInterceptor, 1)";}
"(Add, 1)" -> {"(Do, 3)";"(add, 1)";}
"(add, 1)" -> {"(newWatchBroadcasts, 1)";"(post, 1)";"(newWatchBroadcast, 3)";}
"(get, 1)" -> {"(SetTransportDefaults, 1)";}
"(newStreamInterceptor, 1)" -> {"(monitorLeader, 1)";}
"(StartNode, 2)" -> {}
"(restartAsStandaloneNode, 2)" -> {"(RestartNode, 1)";}
"(SendRequest, 3)" -> {"(Do, 3)";}
"(CreateServerChain, 2)" -> {"(CreateNodeDialer, 1)";"(NonBlockingRun, 3)";"(createAggregatorServer, 3)";}
"(Register, 2)" -> {"(addEndpoint, 1)";}
"(tryUpgrade, 2)" -> {}
"(SetUp, 1)" -> {"(StartCluster, 1)";}
"(newWatchBroadcasts, 1)" -> {}
"(UpdateTransport, 3)" -> {"(updateTransport, 4)";}
"(Dial, 3)" -> {"(NewClientConn, 3)";}
"(New, 2)" -> {"(Add, 1)";"(Start, 1)";}
"(run, 2)" -> {"(UpdateTransport, 3)";"(RunKubelet, 4)";"(New, 4)";}
"(List, 1)" -> {"(List, 2)";}
"(List, 2)" -> {}
"(decode, 1)" -> {"(Write, 1)";}
"(processRaftRequest, 2)" -> {"(Register, 1)";}
"(addCluster, 1)" -> {}
"(toResources, 1)" -> {"(Insert, 1)";"(Has, 1)";}
"(Namespace, 1)" -> {"(Decode, 1)";}
"(NewCIDRRangeAllocator, 5)" -> {}
"(addEndpoint, 1)" -> {}
"(NewLease, 1)" -> {}
"(Copy, 2)" -> {"(ServeHTTP, 2)";}
"(Insert, 1)" -> {"(Add, 1)";}
"(unmarshal, 2)" -> {"(Copy, 2)";}
"(startMasterOrDie, 3)" -> {"(NewServer, 1)";}
"(serveInsecurely, 3)" -> {"(RunServer, 3)";}
"(CreateNodeDialer, 1)" -> {"(New, 4)";}
"(StartControllers, 3)" -> {}
"(Has, 1)" -> {"(Do, 3)";}
"(Update, 1)" -> {"(Add, 1)";"(Get, 2)";"(Set, 2)";}
"(ConfigureTransport, 1)" -> {"(configureTransport, 1)";}
"(Install, 1)" -> {"(Add, 1)";}
"(ServeHTTP, 2)" -> {"(tryUpgrade, 2)";"(tryUpgrade, 7)";"(handleHttps, 2)";"(RoundTrip, 1)";}
"(RestartNode, 1)" -> {}
"(Run, 2)" -> {"(List, 1)";"(CreateServerChain, 2)";"(run, 1)";"(StartControllers, 6)";"(StartBackoffGC, 2)";"(Add, 1)";"(Write, 1)";"(run, 2)";"(NonBlockingRun, 2)";}
"(Set, 2)" -> {"(Do, 3)";}
"(SetTransportDefaults, 1)" -> {"(ConfigureTransport, 1)";}
"(StartBackoffGC, 2)" -> {}
"(NewFederatedInformer, 3)" -> {"(addCluster, 1)";}
"(post, 1)" -> {"(RoundTrip, 1)";}
"(awaitOpenSlotForRequest, 1)" -> {}
"(newClient, 1)" -> {"(NewLease, 1)";"(dial, 2)";}
"(mungeSpec, 1)" -> {"(Has, 1)";}
"(RunKubelet, 4)" -> {"(startKubelet, 4)";}
"(New, 4)" -> {"(New, 6)";}
"(New, 6)" -> {"(NewCIDRRangeAllocator, 5)";}
"(StartCluster, 1)" -> {"(RunAMaster, 1)";}
"(addConnIfNeeded, 3)" -> {}
"(DialURL, 2)" -> {"(Dial, 3)";}
"(Apply, 1)" -> {"(Put, 2)";"(Get, 2)";}
"(InstallAPIGroup, 1)" -> {"(Add, 1)";}
"(NonBlockingRun, 2)" -> {"(NonBlockingRun, 3)";"(RegisterAllAdmissionPlugins, 1)";}
"(Decode, 1)" -> {"(decode, 1)";"(DecodeElement, 2)";}
"(Encode, 2)" -> {"(Write, 1)";}
"(startKubelet, 4)" -> {}
"(clientHandshake, 2)" -> {"(newClientTransport, 6)";}
"(restartNode, 2)" -> {"(RestartNode, 1)";}
"(RegisterAllAdmissionPlugins, 1)" -> {"(Register, 1)";}
"(dial, 2)" -> {"(DialURL, 2)";}
"(NewClientConn, 3)" -> {"(clientHandshake, 2)";}
"(startNode, 3)" -> {"(StartNode, 2)";}
"(updateTransport, 4)" -> {}
"(Register, 1)" -> {"(Register, 2)";}
"(Create, 1)" -> {"(Apply, 1)";"(Update, 1)";"(mungeSpec, 1)";"(Namespace, 1)";"(New, 1)";"(toResources, 1)";}
"(Start, 1)" -> {"(Run, 1)";"(Add, 1)";"(SendRequest, 3)";"(Set, 2)";}
"(StartControllers, 6)" -> {}
"(Do, 3)" -> {}
"(createAggregatorServer, 3)" -> {}
"(Hash, 1)" -> {"(Write, 1)";}
"(tryUpgrade, 7)" -> {}
"(RoundTrip, 1)" -> {"(awaitOpenSlotForRequest, 1)";}
"(newWatchBroadcast, 3)" -> {}
"(handleHttps, 2)" -> {"(Server, 2)";}
"(New, 1)" -> {"(get, 1)";"(Delete, 2)";"(Start, 1)";"(Run, 2)";"(New, 2)";"(NewFederatedInformer, 3)";"(InstallAPIGroup, 1)";"(SetTransportDefaults, 1)";"(Run, 1)";"(newClient, 1)";"(List, 1)";"(Update, 1)";"(Install, 1)";}
"(Run, 1)" -> {"(StartBackoffGC, 2)";"(Add, 1)";"(Write, 1)";"(Hash, 1)";"(StartControllers, 3)";"(NewSSHTunnelList, 4)";"(Encode, 2)";"(run, 1)";"(Run, 2)";}
"(NewSSHTunnelList, 4)" -> {}
"(Get, 2)" -> {"(Do, 3)";}
"(NonBlockingRun, 3)" -> {"(serveInsecurely, 3)";}
"(configureTransport, 1)" -> {"(addConnIfNeeded, 3)";}
"(monitorLeader, 1)" -> {}
"(createClusterObjectOrFail, 3)" -> {"(Create, 1)";}
"(Write, 1)" -> {"(Copy, 2)";}
"(DecodeElement, 2)" -> {"(unmarshal, 2)";}
"(RunServer, 3)" -> {}
"(RunAMaster, 1)" -> {"(startMasterOrDie, 3)";}
"(newClientTransport, 6)" -> {}
}

```

Leave a reaction on this issue to contribute to the project by classifying this instance as a **Bug** :-1:, **Mitigated** :+1:, or **Desirable Behavior** :rocket:
See the descriptions of the classifications [here](https://github.com/github-vet/rangeclosure-findings#how-can-i-help) for more information.

commit ID: 999c38701ab5232e11a283881b2013cc903db33b

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.