github-vet / github-vet/rangeloop-pointer-findings
codeamp/circuit: plugins/codeamp/graphql/service_mutation.go; 4 LoC
- Dominant language
- No language data
- Stars
- 0
- Forks
- 0
- PR merge metrics
- PR metrics pending
Description
Found a possible issue in [codeamp/circuit](https://www.github.com/codeamp/circuit) at [plugins/codeamp/graphql/service_mutation.go](https://github.com/codeamp/circuit/blob/06371150b7aaaf104d41907c6f432a795238bf3c/plugins/codeamp/graphql/service_mutation.go#L142-L145)
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 h at line 144 may start a goroutine
[Click here to see the code in its original context.](https://github.com/codeamp/circuit/blob/06371150b7aaaf104d41907c6f432a795238bf3c/plugins/codeamp/graphql/service_mutation.go#L142-L145)
Click here to show the 4 line(s) of Go which triggered the analyzer.
```go
for _, h := range service.LivenessProbe.HttpHeaders {
h.HealthProbeID = service.LivenessProbe.ID
r.DB.Create(&h)
}
```
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 {
"(create, 3)" -> {"(Get, 2)";}
"(roundTrip, 1)" -> {"(awaitOpenSlotForRequest, 1)";}
"(newSocket, 3)" -> {}
"(Add, 1)" -> {"(Call, 3)";}
"(Do, 3)" -> {}
"(newServerConn, 4)" -> {}
"(newServerTransport, 4)" -> {}
"(clientHandshake, 2)" -> {"(newClientTransport, 6)";}
"(createStdioPipes, 2)" -> {}
"(SetExtension, 3)" -> {"(extensionProperties, 1)";}
"(Call, 3)" -> {"(Remove, 1)";}
"(tryUpgrade, 2)" -> {"(DialForUpgrade, 1)";"(ConnectWithRedirects, 5)";}
"(ContainerStart, 4)" -> {"(containerStart, 4)";}
"(Set, 2)" -> {"(Do, 3)";}
"(Remove, 1)" -> {"(Remove, 2)";"(Delete, 2)";}
"(NewContext, 3)" -> {"(newRoutableUntypedAPI, 3)";}
"(DialForUpgrade, 1)" -> {"(dial, 2)";"(WrapRequest, 1)";}
"(RoundTripOpt, 2)" -> {"(roundTrip, 1)";}
"(Connect, 1)" -> {"(newSocket, 3)";}
"(shutdownDaemon, 1)" -> {}
"(Remove, 2)" -> {}
"(Create, 3)" -> {"(create, 3)";}
"(Create, 1)" -> {"(New, 1)";"(Set, 1)";"(Run, 2)";"(Unmarshal, 2)";"(Add, 1)";"(Create, 3)";}
"(Run, 2)" -> {"(Execute, 3)";"(Run, 1)";}
"(setupIO, 5)" -> {"(createTty, 3)";"(createStdioPipes, 2)";}
"(NewDaemon, 4)" -> {}
"(extensionProperties, 1)" -> {"(Init, 4)";}
"(ServeHTTP, 2)" -> {"(NewServer, 3)";"(newServerConn, 4)";"(tryUpgrade, 2)";}
"(updateHealthMonitor, 1)" -> {"(monitor, 4)";}
"(execSelections, 6)" -> {"(execFieldSelection, 5)";}
"(ReturnIterator, 1)" -> {"(Put, 1)";}
"(ListenPipe, 2)" -> {}
"(start, 1)" -> {"(ContainerStart, 4)";"(NewDaemon, 4)";"(shutdownDaemon, 1)";"(handleControlSocketChange, 2)";"(loadListeners, 2)";}
"(ConfigureTransport, 1)" -> {"(configureTransport, 1)";}
"(serverHandshake, 1)" -> {"(newServerTransport, 4)";}
"(createTty, 3)" -> {}
"(initHealthMonitor, 1)" -> {"(updateHealthMonitor, 1)";}
"(apply, 1)" -> {"(Delete, 1)";}
"(RoundTrip, 1)" -> {"(runCancelable, 2)";"(roundTrip, 1)";"(RoundTripOpt, 2)";}
"(awaitOpenSlotForRequest, 1)" -> {}
"(monitorConnection, 1)" -> {}
"(get, 1)" -> {"(New, 3)";"(SetTransportDefaults, 1)";}
"(Run, 1)" -> {"(Start, 1)";"(run, 1)";"(NewContext, 3)";}
"(Put, 1)" -> {"(Remove, 1)";}
"(Delete, 2)" -> {"(Do, 2)";}
"(execSelectionSet, 6)" -> {}
"(UnmarshalNext, 2)" -> {"(unmarshalValue, 3)";}
"(unmarshalValue, 3)" -> {"(SetExtension, 3)";}
"(Set, 1)" -> {"(Set, 2)";"(Scan, 1)";}
"(Execute, 3)" -> {"(execSelections, 6)";}
"(containerStart, 4)" -> {"(initHealthMonitor, 1)";}
"(NewClientConn, 3)" -> {"(clientHandshake, 2)";}
"(Init, 4)" -> {"(ListenPipe, 2)";}
"(newRoutableUntypedAPI, 3)" -> {"(newSecureAPI, 2)";}
"(WrapRequest, 1)" -> {"(RoundTrip, 1)";}
"(NewServerConn, 2)" -> {"(serverHandshake, 1)";}
"(Unmarshal, 1)" -> {"(New, 3)";}
"(Delete, 1)" -> {"(Do, 2)";}
"(SetTransportDefaults, 1)" -> {"(ConfigureTransport, 1)";}
"(newSecureAPI, 2)" -> {"(ServeHTTP, 2)";}
"(Dial, 1)" -> {"(dial, 2)";}
"(apply, 2)" -> {"(Remove, 1)";"(apply, 1)";}
"(Start, 1)" -> {"(start, 1)";}
"(handleControlSocketChange, 2)" -> {}
"(monitor, 4)" -> {}
"(Unmarshal, 2)" -> {"(Set, 1)";"(ReturnIterator, 1)";"(UnmarshalNext, 2)";"(New, 1)";"(Unmarshal, 1)";}
"(run, 1)" -> {"(setupIO, 5)";"(Start, 1)";}
"(configureTLS, 4)" -> {}
"(Scan, 1)" -> {"(Set, 2)";}
"(execFieldSelection, 5)" -> {"(execSelectionSet, 6)";}
"(loadListeners, 2)" -> {"(Init, 4)";}
"(ConnectWithRedirects, 5)" -> {"(Dial, 1)";}
"(New, 1)" -> {"(Connect, 1)";"(apply, 2)";"(get, 1)";}
"(New, 3)" -> {"(monitorConnection, 1)";"(configureTLS, 4)";"(Remove, 1)";}
"(configureTransport, 1)" -> {"(addConnIfNeeded, 3)";}
"(addConnIfNeeded, 3)" -> {}
"(NewServer, 3)" -> {}
"(dial, 2)" -> {"(NewServerConn, 2)";"(NewClientConn, 3)";}
"(runCancelable, 2)" -> {}
"(newClientTransport, 6)" -> {}
"(Get, 2)" -> {"(Do, 2)";}
"(Do, 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: 06371150b7aaaf104d41907c6f432a795238bf3c
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.