github-vet / github-vet/rangeloop-pointer-findings
lf-edge/eve: pkg/pillar/cmd/zedrouter/zedrouter.go; 8 LoC
- Dominant language
- No language data
- Stars
- 0
- Forks
- 0
- PR merge metrics
- PR metrics pending
Description
Found a possible issue in [lf-edge/eve](https://www.github.com/lf-edge/eve) at [pkg/pillar/cmd/zedrouter/zedrouter.go](https://github.com/lf-edge/eve/blob/c5aa09586e41a9fd26b2dcff3c242d7c15a430f5/pkg/pillar/cmd/zedrouter/zedrouter.go#L786-L793)
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 ulConfig at line 791 may start a goroutine
[Click here to see the code in its original context.](https://github.com/lf-edge/eve/blob/c5aa09586e41a9fd26b2dcff3c242d7c15a430f5/pkg/pillar/cmd/zedrouter/zedrouter.go#L786-L793)
Click here to show the 8 line(s) of Go which triggered the analyzer.
```go
for i, ulConfig := range config.UnderlayNetworkList {
ulNum := i + 1
log.Tracef("ulNum %d network %s ACLs %v\n",
ulNum, ulConfig.Network.String(), ulConfig.ACLs)
appNetworkDoActivateUnderlayNetwork(
ctx, config, status, ipsets, &ulConfig, ulNum)
}
```
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 {
"(lookupNetworkInstanceConfig, 2)" -> {"(Get, 1)";}
"(Get, 1)" -> {"(get, 1)";}
"(New, 1)" -> {"(Store, 2)";}
"(createDnsmasqConfiglet, 9)" -> {"(Remove, 1)";}
"(Run, 1)" -> {"(run, 1)";}
"(get, 1)" -> {"(Do, 1)";}
"(Do, 1)" -> {"(Upload, 1)";}
"(Upload, 1)" -> {"(GetDataWithRanges, 2)";"(Run, 1)";}
"(Store, 2)" -> {"(Write, 1)";}
"(Write, 1)" -> {"(Do, 1)";}
"(appNetworkDoActivateUnderlayNetwork, 6)" -> {"(createDnsmasqConfiglet, 9)";"(lookupNetworkInstanceConfig, 2)";"(lookupNetworkInstanceStatus, 2)";"(New, 1)";}
"(Delete, 2)" -> {"(Do, 1)";}
"(GetDataWithRanges, 2)" -> {}
"(run, 1)" -> {"(sendICMP, 2)";}
"(sendICMP, 2)" -> {}
"(lookupNetworkInstanceStatus, 2)" -> {"(Get, 1)";}
"(Remove, 1)" -> {"(Delete, 2)";}
}
```
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: c5aa09586e41a9fd26b2dcff3c242d7c15a430f5
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.