github-vet / github-vet/rangeloop-pointer-findings
evenfound/even-go: node/ipfs/dag.go; 3 LoC
- Dominant language
- No language data
- Stars
- 0
- Forks
- 0
- PR merge metrics
- PR metrics pending
Description
Found a possible issue in [evenfound/even-go](https://www.github.com/evenfound/even-go) at [node/ipfs/dag.go](https://github.com/evenfound/even-go/blob/c57a2f453aefd666cc5ef9f51c7af2d807729130/node/ipfs/dag.go#L64-L66)
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 id at line 65 may start a goroutine
[Click here to see the code in its original context.](https://github.com/evenfound/even-go/blob/c57a2f453aefd666cc5ef9f51c7af2d807729130/node/ipfs/dag.go#L64-L66)
Click here to show the 3 line(s) of Go which triggered the analyzer.
```go
for _, id := range graph {
nd.DAG.Remove(context.Background(), &id)
}
```
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 {
"(Synchronise, 4)" -> {"(synchronise, 4)";}
"(Write, 1)" -> {"(Call, 5)";"(completeRequest, 3)";"(New, 2)";}
"(Get, 2)" -> {"(Get, 3)";"(get, 5)";"(Has, 2)";}
"(openDB, 1)" -> {}
"(announce, 2)" -> {"(checkKnownNode, 2)";}
"(findProvidersAsyncRoutine, 4)" -> {"(findProvidersSingle, 3)";}
"(syncWithPeer, 3)" -> {"(processFastSyncContent, 1)";"(fetchHeight, 1)";"(findAncestor, 2)";"(fetchHeaders, 3)";}
"(Decode, 1)" -> {"(NewStream, 2)";"(Add, 2)";"(New, 1)";}
"(Do, 3)" -> {}
"(readDataObj, 2)" -> {"(Open, 1)";}
"(DialInProc, 1)" -> {}
"(checkKnownNode, 2)" -> {}
"(startCompact, 1)" -> {}
"(NewBlockChain, 6)" -> {}
"(run, 4)" -> {"(subMatch, 4)";}
"(has, 5)" -> {"(get, 4)";}
"(watchNetwork, 1)" -> {}
"(synchronise, 1)" -> {"(Synchronise, 4)";}
"(findProvidersSingle, 3)" -> {"(sendRequest, 3)";}
"(ctxReadMsg, 2)" -> {}
"(Query, 1)" -> {"(query, 1)";"(New, 1)";}
"(newRequestDistributor, 2)" -> {}
"(start, 2)" -> {}
"(Has, 2)" -> {"(has, 5)";}
"(forward, 1)" -> {"(enqueue, 1)";}
"(GETModerators, 2)" -> {}
"(query, 1)" -> {}
"(New, 3)" -> {"(run, 2)";}
"(get, 6)" -> {}
"(New, 6)" -> {}
"(get, 4)" -> {"(GETModerators, 2)";"(GETIPNS, 2)";"(GETClosestPeers, 2)";}
"(Do, 1)" -> {"(dial, 2)";}
"(Start, 1)" -> {"(start, 2)";"(Register, 1)";"(DialInProc, 1)";"(forward, 1)";}
"(deleteNow, 3)" -> {"(Write, 1)";}
"(NewProtocolManager, 15)" -> {"(New, 6)";"(newLightFetcher, 1)";}
"(sendRequest, 3)" -> {"(SendRequest, 2)";}
"(NewStream, 2)" -> {}
"(add, 2)" -> {}
"(decodeIndex, 2)" -> {"(NewStream, 2)";}
"(flushMemtable, 1)" -> {}
"(NewProtocolManager, 8)" -> {"(handle, 1)";"(New, 6)";}
"(Open, 2)" -> {"(openDB, 1)";}
"(Pin, 4)" -> {"(Resolve, 4)";}
"(run, 1)" -> {"(FindProvidersAsync, 3)";}
"(Add, 2)" -> {"(add, 2)";"(Add, 3)";}
"(delete, 1)" -> {"(delete, 5)";}
"(Start, 0)" -> {"(CheckTxnRcpt, 2)";"(Start, 1)";"(run, 1)";}
"(New, 8)" -> {"(newWorker, 8)";}
"(Dial, 1)" -> {"(SetupConn, 3)";}
"(SetupConn, 3)" -> {"(setupConn, 3)";}
"(doProtoHandshake, 1)" -> {}
"(Handshake, 4)" -> {}
"(Client, 2)" -> {"(newSession, 3)";}
"(Delete, 1)" -> {"(Delete, 2)";"(deleteNow, 3)";"(Has, 2)";"(New, 1)";"(Do, 1)";"(delete, 1)";"(decodeIndex, 2)";}
"(delete, 5)" -> {}
"(NewTxPool, 3)" -> {}
"(Get, 3)" -> {"(get, 6)";"(Do, 3)";}
"(newLightFetcher, 1)" -> {}
"(subMatch, 4)" -> {"(run, 5)";}
"(run, 5)" -> {}
"(Run, 2)" -> {"(watchNetwork, 1)";}
"(fetchHeight, 1)" -> {}
"(findAncestor, 2)" -> {}
"(Remove, 2)" -> {"(hash, 1)";"(Get, 1)";"(Delete, 1)";"(Update, 1)";}
"(dial, 2)" -> {"(Dial, 1)";"(SetupConn, 3)";}
"(get, 5)" -> {"(get, 4)";}
"(Add, 3)" -> {"(Pin, 4)";}
"(handleMsg, 1)" -> {"(synchronise, 1)";"(announce, 2)";}
"(fetchHeaders, 3)" -> {}
"(hash, 1)" -> {"(Write, 1)";"(Open, 1)";}
"(Delete, 2)" -> {"(delete, 1)";}
"(FindProvidersAsync, 3)" -> {"(findProvidersAsyncRoutine, 4)";}
"(GETClosestPeers, 2)" -> {"(Query, 2)";}
"(ctxWriteMsg, 2)" -> {}
"(Server, 2)" -> {"(newSession, 3)";}
"(SendRequest, 2)" -> {"(ctxWriteMsg, 2)";"(ctxReadMsg, 2)";}
"(Update, 1)" -> {"(New, 1)";}
"(init, 1)" -> {"(Run, 1)";}
"(doRequest, 5)" -> {}
"(Resolve, 4)" -> {}
"(enqueue, 1)" -> {}
"(NewPeer, 2)" -> {"(Run, 2)";}
"(NotifyPeer, 2)" -> {}
"(NewConn, 2)" -> {"(Server, 2)";"(Client, 2)";}
"(Get, 1)" -> {"(Decode, 1)";"(New, 1)";"(Do, 1)";"(Merge, 1)";"(Add, 2)";"(Get, 2)";"(readDataObj, 2)";"(Query, 1)";}
"(completeRequest, 3)" -> {}
"(CheckTxnRcpt, 2)" -> {}
"(Register, 1)" -> {}
"(handle, 1)" -> {"(Handshake, 4)";"(handleMsg, 1)";"(announce, 2)";}
"(processFastSyncContent, 1)" -> {}
"(setupConn, 3)" -> {"(doProtoHandshake, 1)";"(NewConn, 2)";}
"(New, 1)" -> {"(New, 2)";"(New, 3)";"(init, 1)";}
"(New, 2)" -> {"(NewBlockChain, 6)";"(Start, 1)";"(NewTxPool, 3)";"(New, 8)";"(newRequestDistributor, 2)";"(NewProtocolManager, 8)";"(NewProtocolManager, 15)";}
"(Merge, 1)" -> {"(add, 2)";}
"(doWrites, 1)" -> {}
"(GETIPNS, 2)" -> {"(Resolve, 4)";}
"(Query, 2)" -> {}
"(newSession, 3)" -> {}
"(synchronise, 4)" -> {"(syncWithPeer, 3)";}
"(Open, 1)" -> {"(flushMemtable, 1)";"(doWrites, 1)";"(Open, 2)";"(Start, 0)";"(startCompact, 1)";}
"(Call, 5)" -> {"(run, 4)";}
"(newWorker, 8)" -> {}
"(Run, 1)" -> {"(NewPeer, 2)";"(NotifyPeer, 2)";}
"(run, 2)" -> {"(doRequest, 5)";}
}
```
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: c57a2f453aefd666cc5ef9f51c7af2d807729130
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.