github-vet / github-vet/rangeloop-pointer-findings
quangtamle/NSM_lab: Labs/skydive/ovs/ovsdb/ovsdb.go; 11 LoC
- Dominant language
- No language data
- Stars
- 0
- Forks
- 0
- PR merge metrics
- PR metrics pending
Description
Found a possible issue in [quangtamle/NSM_lab](https://www.github.com/quangtamle/NSM_lab) at [Labs/skydive/ovs/ovsdb/ovsdb.go](https://github.com/quangtamle/NSM_lab/blob/7809bb3f1fac3eedb360db560f99545391913756/Labs/skydive/ovs/ovsdb/ovsdb.go#L294-L304)
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 row at line 297 may start a goroutine
[Click here to see the code in its original context.](https://github.com/quangtamle/NSM_lab/blob/7809bb3f1fac3eedb360db560f99545391913756/Labs/skydive/ovs/ovsdb/ovsdb.go#L294-L304)
Click here to show the 11 line(s) of Go which triggered the analyzer.
```go
for interfaceUUID, row := range updates.Rows {
if !reflect.DeepEqual(row.New, empty) {
if _, ok := o.interfaceCache[interfaceUUID]; ok {
o.interfaceUpdated(interfaceUUID, &row)
} else {
o.interfaceAdded(interfaceUUID, &row)
}
} else {
o.interfaceDeleted(interfaceUUID, &row)
}
}
```
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 {
"(OnOvsInterfaceAdd, 3)" -> {"(AddLayer2Link, 4)";}
"(AddEdge, 1)" -> {"(EdgeAdded, 1)";}
"(addConnIfNeeded, 3)" -> {}
"(AddLink, 5)" -> {"(AddEdge, 1)";}
"(SetTransportDefaults, 1)" -> {"(ConfigureTransport, 1)";}
"(interfaceUpdated, 2)" -> {"(OnOvsInterfaceUpdate, 3)";}
"(AddLayer2Link, 4)" -> {"(AddLink, 5)";}
"(EdgeAdded, 1)" -> {"(createEdge, 1)";}
"(New, 1)" -> {"(get, 1)";}
"(ConfigureTransport, 1)" -> {"(configureTransport, 1)";}
"(configureTransport, 1)" -> {"(addConnIfNeeded, 3)";}
"(OnOvsInterfaceUpdate, 3)" -> {"(OnOvsInterfaceAdd, 3)";}
"(createEdge, 1)" -> {"(New, 1)";}
"(get, 1)" -> {"(SetTransportDefaults, 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: 7809bb3f1fac3eedb360db560f99545391913756
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.