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

puyangsky/PKU-Kubernetes: test/e2e/federated-service.go; 3 LoC

Open
#10,231 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 [puyangsky/PKU-Kubernetes](https://www.github.com/puyangsky/PKU-Kubernetes) at [test/e2e/federated-service.go](https://github.com/puyangsky/PKU-Kubernetes/blob/82efc9291d4771781c738a3753c855e1e499e5bb/test/e2e/federated-service.go#L101-L103)

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 102 may start a goroutine

[Click here to see the code in its original context.](https://github.com/puyangsky/PKU-Kubernetes/blob/82efc9291d4771781c738a3753c855e1e499e5bb/test/e2e/federated-service.go#L101-L103)

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

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

```

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 {
"(Start, 1)" -> {"(start, 1)";}
"(httpDo, 3)" -> {}
"(Add, 1)" -> {"(Has, 1)";"(merge, 2)";"(Create, 2)";"(New, 1)";"(Create, 3)";"(Do, 3)";}
"(List, 2)" -> {}
"(InstallAPIs, 1)" -> {"(Run, 1)";"(getExtensionResources, 1)";}
"(Run, 2)" -> {"(run, 2)";"(runExecutor, 5)";"(runKubelet, 7)";"(watchServices, 1)";}
"(pushLostTask, 3)" -> {"(statusUpdated, 3)";}
"(statusUpdated, 3)" -> {"(StatusUpdate, 2)";}
"(clientHandshake, 2)" -> {"(newClientTransport, 6)";}
"(Send, 2)" -> {"(send, 2)";}
"(New, 2)" -> {"(Add, 1)";"(Clone, 1)";"(New, 5)";}
"(Do, 3)" -> {}
"(startNode, 3)" -> {"(StartNode, 2)";}
"(Clone, 1)" -> {"(New, 1)";}
"(Send, 3)" -> {"(Send, 2)";}
"(unmarshal, 2)" -> {"(Copy, 2)";}
"(DeclineOffer, 2)" -> {"(LaunchTasks, 3)";}
"(StartControllers, 2)" -> {}
"(dialWithoutProxy, 1)" -> {"(Dial, 3)";}
"(send, 2)" -> {"(httpDo, 3)";}
"(StartNode, 2)" -> {}
"(RestartNode, 1)" -> {}
"(restartAsStandaloneNode, 2)" -> {"(RestartNode, 1)";}
"(Add, 2)" -> {"(Do, 2)";}
"(ServeHTTP, 2)" -> {"(tryUpgrade, 6)";"(tryUpgrade, 2)";"(handleHttps, 2)";}
"(CreateAndInitKubelet, 1)" -> {"(NewMainKubelet, 66)";}
"(NewMainKubelet, 66)" -> {"(NewDockerManager, 24)";"(New, 15)";}
"(Remove, 1)" -> {"(New, 1)";}
"(StartControllers, 4)" -> {}
"(NewServer, 1)" -> {"(startNode, 3)";"(restartNode, 2)";"(restartAsStandaloneNode, 2)";}
"(Run, 1)" -> {"(StartControllers, 4)";"(StartControllers, 2)";"(NewSSHTunnelList, 4)";"(Start, 1)";"(Run, 2)";}
"(getExtensionResources, 1)" -> {}
"(NewSerializedImagePuller, 3)" -> {}
"(RoundTrip, 1)" -> {"(Write, 1)";"(dial, 1)";}
"(Create, 2)" -> {"(IDFromName, 2)";"(New, 1)";}
"(start, 1)" -> {}
"(NewWatcher, 1)" -> {}
"(send, 3)" -> {"(Send, 3)";}
"(LaunchTasks, 3)" -> {"(send, 3)";"(pushLostTask, 3)";}
"(Create, 3)" -> {"(Create, 2)";"(New, 1)";}
"(Dial, 3)" -> {"(NewClientConn, 3)";}
"(Set, 2)" -> {"(Do, 3)";}
"(configureTransport, 1)" -> {"(addConnIfNeeded, 3)";}
"(newClient, 1)" -> {"(NewLease, 1)";"(NewWatcher, 1)";}
"(Has, 1)" -> {"(Do, 3)";}
"(IDFromName, 2)" -> {"(List, 2)";}
"(handleHttps, 2)" -> {"(Server, 2)";}
"(run, 2)" -> {"(RunKubelet, 1)";}
"(restartNode, 2)" -> {"(RestartNode, 1)";}
"(NewLease, 1)" -> {}
"(tryUpgrade, 6)" -> {}
"(dial, 1)" -> {"(dialWithoutProxy, 1)";}
"(watchServices, 1)" -> {}
"(Server, 2)" -> {"(NewServer, 1)";}
"(get, 1)" -> {"(SetTransportDefaults, 1)";}
"(merge, 2)" -> {"(unmarshal, 2)";}
"(startKubelet, 3)" -> {}
"(New, 15)" -> {"(NewSerializedImagePuller, 3)";}
"(New, 1)" -> {"(newClient, 1)";"(DeclineOffer, 2)";"(InstallAPIs, 1)";}
"(StatusUpdate, 2)" -> {}
"(ConfigureTransport, 1)" -> {"(configureTransport, 1)";}
"(NewSSHTunnelList, 4)" -> {}
"(Init, 1)" -> {"(NewConn, 1)";}
"(RunKubelet, 1)" -> {"(startKubelet, 3)";}
"(NewClientConn, 3)" -> {"(clientHandshake, 2)";}
"(Get, 1)" -> {"(New, 2)";"(Add, 1)";"(Do, 2)";"(Name, 1)";"(Add, 2)";"(get, 1)";"(Remove, 1)";}
"(SetTransportDefaults, 1)" -> {"(ConfigureTransport, 1)";}
"(Do, 2)" -> {"(RoundTrip, 1)";"(Write, 1)";"(New, 1)";}
"(Name, 1)" -> {"(Set, 2)";}
"(addConnIfNeeded, 3)" -> {}
"(NewConn, 1)" -> {}
"(newClientTransport, 6)" -> {}
"(clusterIsReadyOrFail, 2)" -> {"(Get, 1)";}
"(Write, 1)" -> {"(Copy, 2)";}
"(tryUpgrade, 2)" -> {}
"(runExecutor, 5)" -> {"(Init, 1)";}
"(runKubelet, 7)" -> {"(CreateAndInitKubelet, 1)";}
"(NewDockerManager, 24)" -> {"(NewSerializedImagePuller, 3)";}
"(Copy, 2)" -> {"(ServeHTTP, 2)";}
"(New, 5)" -> {"(New, 1)";}
}

```

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: 82efc9291d4771781c738a3753c855e1e499e5bb

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.