github-vet / github-vet/rangeloop-pointer-findings
weibocom/dockerf: cluster/context/context.go; 4 LoC
- Dominant language
- No language data
- Stars
- 0
- Forks
- 0
- PR merge metrics
- PR metrics pending
Description
Found a possible issue in [weibocom/dockerf](https://www.github.com/weibocom/dockerf) at [cluster/context/context.go](https://github.com/weibocom/dockerf/blob/f5cc93898678e7de83634bd79291b78180d790b2/cluster/context/context.go#L215-L218)
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 description at line 217 may start a goroutine
[Click here to see the code in its original context.](https://github.com/weibocom/dockerf/blob/f5cc93898678e7de83634bd79291b78180d790b2/cluster/context/context.go#L215-L218)
Click here to show the 4 line(s) of Go which triggered the analyzer.
```go
for _, description := range descriptions {
log.Debugf("deploy service discovery container. group:%s", description.Group)
ctx.deployContainersByDescription(&description)
}
```
Click here to show extra information the analyzer produced.
```
The following dot graph describes paths through the callgraph that could lead to a function calling a goroutine:
digraph G {
"(Read, 1)" -> {"(getChunk, 0)";"(Stop, 0)";}
"(Serve, 1)" -> {"(Accept, 0)";"(serve, 0)";}
"(DialWithTimeout, 2)" -> {"(DialWithInfo, 1)";}
"(newCluster, 5)" -> {"(syncServersLoop, 0)";}
"(server, 2)" -> {"(newServer, 4)";}
"(stopContainer, 2)" -> {"(unregisterService, 3)";}
"(Serve, 2)" -> {"(Accept, 0)";"(serve, 0)";}
"(Authenticate, 4)" -> {"(vagetbackendauth, 2)";}
"(newServerTransport, 4)" -> {}
"(newServer, 4)" -> {}
"(makeLog, 3)" -> {"(Append, 1)";}
"(serveContent, 6)" -> {}
"(vagetbackendauth, 2)" -> {"(NewTicker, 1)";}
"(syncServersLoop, 0)" -> {"(syncServersIteration, 1)";}
"(UnRegister, 2)" -> {}
"(registerServiceByContainer, 2)" -> {"(Register, 2)";}
"(Redirect, 4)" -> {"(Index, 2)";}
"(acquireSocket, 0)" -> {"(AcquireSocket, 2)";}
"(serve, 0)" -> {"(handleRecord, 1)";}
"(Start, 0)" -> {"(Serve, 1)";"(Serve, 2)";}
"(newMux, 1)" -> {}
"(Register, 2)" -> {}
"(readSetCookies, 1)" -> {"(Index, 2)";}
"(NewTicker, 1)" -> {}
"(readMachineId, 0)" -> {"(Hostname, 0)";}
"(OutputWithPty, 1)" -> {"(session, 1)";"(CombinedOutput, 1)";}
"(CombinedOutput, 1)" -> {"(Run, 1)";}
"(newClientTransport, 6)" -> {}
"(DialWithInfo, 1)" -> {"(newCluster, 5)";}
"(unregisterService, 3)" -> {"(UnRegister, 2)";}
"(NewClient, 3)" -> {}
"(GetState, 0)" -> {"(Authenticate, 4)";"(NewClient, 3)";}
"(dialConn, 1)" -> {"(dial, 2)";}
"(RunSSHCommandFromDriver, 2)" -> {"(Output, 1)";}
"(dial, 4)" -> {}
"(serverHandshake, 1)" -> {"(newServerTransport, 4)";}
"(Wipe, 0)" -> {"(Session, 0)";}
"(removeStoppedContainerByGroup, 1)" -> {"(Wait, 0)";}
"(Sort, 1)" -> {"(Index, 2)";}
"(getConn, 2)" -> {"(dialConn, 1)";}
"(AcquireSocket, 2)" -> {"(Connect, 1)";}
"(Run, 1)" -> {"(Start, 1)";}
"(Close, 0)" -> {"(Stop, 0)";"(acquireSocket, 0)";"(insertChunk, 1)";}
"(copyResponse, 2)" -> {"(flushLoop, 0)";}
"(Start, 1)" -> {"(start, 0)";}
"(syncServersIteration, 1)" -> {"(server, 2)";}
"(Dial, 1)" -> {"(DialWithTimeout, 2)";}
"(Stop, 0)" -> {"(Authenticate, 4)";"(NewClient, 3)";"(GetState, 0)";}
"(serveFile, 5)" -> {"(serveContent, 6)";}
"(flushLoop, 0)" -> {"(NewTicker, 1)";}
"(NewServerConn, 2)" -> {"(serverHandshake, 1)";}
"(Session, 0)" -> {"(Dial, 1)";}
"(readCookies, 2)" -> {"(Index, 2)";}
"(Hostname, 0)" -> {"(SSHCommand, 1)";}
"(dial, 2)" -> {"(Dial, 2)";"(NewClientConn, 3)";"(NewServerConn, 2)";}
"(scaleInContainersByDescription, 1)" -> {"(stopContainer, 2)";"(Wait, 0)";}
"(, 0)" -> {"(Write, 1)";"(Redirect, 4)";"(Cookies, 0)";"(readMachineId, 0)";}
"(insertChunk, 1)" -> {}
"(Wait, 0)" -> {"(Close, 0)";}
"(logf, 2)" -> {"(argsForLog, 1)";}
"(Dial, 3)" -> {"(Dial, 2)";"(NewClientConn, 3)";}
"(SSHCommand, 1)" -> {"(Output, 1)";"(RunSSHCommandFromDriver, 2)";"(OutputWithPty, 1)";}
"(Output, 1)" -> {"(CombinedOutput, 1)";"(Run, 1)";"(session, 1)";}
"(Write, 1)" -> {"(Read, 1)";"(Close, 0)";"(insertChunk, 1)";}
"(Debugf, 2)" -> {"(makeLog, 3)";"(logf, 2)";}
"(ServeHTTP, 2)" -> {"(Start, 0)";"(RoundTrip, 1)";"(copyResponse, 2)";"(serveFile, 5)";}
"(getChunk, 0)" -> {}
"(argsForLog, 1)" -> {"(Sort, 1)";}
"(startContainer, 2)" -> {"(registerServiceByContainer, 2)";}
"(newSocket, 3)" -> {}
"(NewSession, 0)" -> {"(newSession, 2)";}
"(deployRunningContainersByDescription, 1)" -> {"(, 0)";"(stopContainer, 2)";"(startContainer, 2)";}
"(RoundTrip, 1)" -> {"(getConn, 2)";}
"(handleRecord, 1)" -> {}
"(NewClientConn, 3)" -> {"(newMux, 1)";"(clientHandshake, 2)";}
"(scaleOutContainersByDescription, 1)" -> {"(Wait, 0)";}
"(Connect, 1)" -> {"(newSocket, 3)";}
"(Accept, 0)" -> {}
"(Dial, 2)" -> {"(dial, 4)";}
"(clientHandshake, 2)" -> {"(newClientTransport, 6)";}
"(newSession, 2)" -> {}
"(start, 0)" -> {"(Wipe, 0)";}
"(deployContainersByDescription, 1)" -> {"(removeStoppedContainerByGroup, 1)";"(Debugf, 2)";"(deployRunningContainersByDescription, 1)";"(scaleOutContainersByDescription, 1)";"(scaleInContainersByDescription, 1)";}
"(Append, 1)" -> {"(Close, 0)";"(Write, 1)";}
"(Index, 2)" -> {"(ServeHTTP, 2)";}
"(Cookies, 0)" -> {"(readCookies, 2)";"(readSetCookies, 1)";}
"(session, 1)" -> {"(NewSession, 0)";"(Dial, 3)";}
}
```
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: f5cc93898678e7de83634bd79291b78180d790b2
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.