github-vet / github-vet/rangeloop-pointer-findings
evergreen-ci/evergreen: units/event_notifier.go; 18 LoC
- Dominant language
- No language data
- Stars
- 0
- Forks
- 0
- PR merge metrics
- PR metrics pending
Description
Found a possible issue in [evergreen-ci/evergreen](https://www.github.com/evergreen-ci/evergreen) at [units/event_notifier.go](https://github.com/evergreen-ci/evergreen/blob/a30fb318ff554bfa7becbbbc3d5ad63e356be156/units/event_notifier.go#L135-L152)
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 e at line 138 may start a goroutine
[Click here to see the code in its original context.](https://github.com/evergreen-ci/evergreen/blob/a30fb318ff554bfa7becbbbc3d5ad63e356be156/units/event_notifier.go#L135-L152)
Click here to show the 18 line(s) of Go which triggered the analyzer.
```go
for e := range input {
n, err := j.tryProcessOneEvent(&e)
catcher.Add(err)
catcher.Add(logger.MarkProcessed(&e))
if err = notification.InsertMany(n...); err != nil {
grip.Error(message.WrapError(err, message.Fields{
"job_id": j.ID(),
"job_type": j.Type().Name,
"source": "events-processing",
"notifications": n,
"message": "can't insert notifications",
}))
catcher.Add(err)
}
catcher.Add(dispatchNotifications(ctx, n, j.q, j.flags))
}
```
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 {
"(ServeHTTP, 2)" -> {"(serveBiDirectionalStream, 2)";"(Do, 3)";"(ServeHTTP, 3)";"(applyTemplate, 3)";}
"(fixImports, 3)" -> {}
"(Push, 1)" -> {"(PushContext, 2)";}
"(ServeHTTP, 3)" -> {"(Execute, 2)";}
"(reconcileTaskState, 4)" -> {"(startTask, 3)";}
"(copyPipes, 7)" -> {}
"(putBuf, 1)" -> {"(Put, 1)";}
"(serverAuthenticate, 1)" -> {"(Verify, 2)";}
"(Prune, 3)" -> {"(Process, 3)";}
"(ListenPipe, 2)" -> {}
"(Set, 1)" -> {"(Search, 2)";}
"(NewSigner, 4)" -> {"(New, 2)";}
"(Sign, 1)" -> {"(Send, 0)";"(New, 3)";"(New, 2)";}
"(update, 3)" -> {"(Update, 1)";"(fetchAndCheckout, 4)";}
"(newOracle, 4)" -> {"(Create, 2)";}
"(MakeLoggerWithContext, 3)" -> {}
"(UpdateRootCA, 1)" -> {}
"(Do, 3)" -> {"(Start, 1)";"(Prepare, 1)";}
"(newLeaseUpdater, 3)" -> {}
"(loadListeners, 2)" -> {"(Init, 4)";}
"(Create, 2)" -> {"(append, 1)";"(createIO, 5)";"(CopyConsole, 6)";"(CreateProcess, 2)";}
"(pullSchema2Layers, 4)" -> {}
"(sendTestLogToCedar, 4)" -> {"(NewLoggerWithContext, 4)";}
"(implements, 1)" -> {"(Build, 1)";}
"(Update, 1)" -> {"(ConcurrentUpdate, 4)";}
"(Solve, 3)" -> {"(Exec, 6)";}
"(pullOCI, 4)" -> {"(pullSchema2Layers, 4)";}
"(Run, 1)" -> {"(Execute, 2)";"(stop, 1)";"(wait, 1)";"(Run, 2)";"(GetDockerLogs, 5)";"(ViewAndWatch, 3)";"(WaitForCluster, 2)";"(UpdateNode, 1)";}
"(CreateNode, 1)" -> {"(Send, 0)";}
"(NewClient, 2)" -> {"(Apply, 1)";"(NewClient, 1)";}
"(handleNodeConflict, 2)" -> {}
"(Send, 0)" -> {"(Run, 1)";"(Remove, 1)";}
"(openNewMongoDriver, 4)" -> {"(start, 2)";}
"(Execute, 2)" -> {"(Decrypt, 2)";}
"(New, 1)" -> {"(newV2Client, 4)";"(Read, 2)";"(New, 2)";"(NewSigner, 4)";"(New, 3)";"(newSession, 3)";"(Get, 2)";"(Load, 2)";"(CreateNode, 1)";"(Parse, 1)";"(Init, 0)";"(Unmarshal, 2)";"(apply, 2)";"(Log, 1)";"(Sign, 1)";"(verifySplunkConnection, 1)";"(build, 1)";"(Open, 1)";"(Join, 2)";"(Ping, 1)";"(New, 5)";"(run, 1)";"(Get, 1)";"(Add, 1)";"(enableCSM, 3)";"(NewServer, 1)";"(Marshal, 1)";"(Get, 0)";"(NewClient, 2)";}
"(fetchAndCheckout, 4)" -> {"(FetchContext, 2)";"(SetReference, 1)";}
"(Join, 2)" -> {"(GetMember, 1)";}
"(validateInfo, 1)" -> {"(Validate, 2)";}
"(release, 1)" -> {"(Remove, 2)";}
"(handleControlSocketChange, 2)" -> {}
"(runFrame, 1)" -> {"(visitInstr, 2)";}
"(Get, 1)" -> {"(Do, 2)";"(Get, 0)";"(Get, 3)";"(Add, 2)";"(Get, 2)";"(ServeHTTP, 2)";"(Load, 1)";"(Remove, 1)";"(get, 1)";"(doRequest, 2)";"(Open, 1)";}
"(Remove, 2)" -> {"(SetReference, 1)";}
"(startTask, 3)" -> {"(logStats, 2)";"(runPreTaskCommands, 2)";"(runTaskCommands, 2)";"(taskManager, 3)";}
"(createIO, 5)" -> {"(newDirectIO, 2)";}
"(send, 3)" -> {}
"(WriteLogEntry, 1)" -> {"(Write, 1)";}
"(Pull, 3)" -> {"(pullV2Repository, 3)";}
"(runOrError, 1)" -> {"(Start, 1)";}
"(Unmarshal, 2)" -> {"(Set, 1)";"(Put, 1)";}
"(Release, 1)" -> {"(release, 1)";"(Update, 1)";"(Remove, 1)";}
"(ContainerLogs, 3)" -> {}
"(New, 3)" -> {"(Pull, 1)";"(configureTLS, 4)";"(Release, 1)";"(newOracle, 4)";}
"(insert, 4)" -> {}
"(Build, 1)" -> {"(ForEachPackage, 2)";}
"(newBasicProcess, 2)" -> {}
"(UpdateNode, 1)" -> {"(aliveNode, 3)";}
"(callSSA, 6)" -> {"(runFrame, 1)";}
"(Ping, 1)" -> {"(doRequest, 2)";"(Get, 3)";}
"(newStdioPipes, 1)" -> {"(ListenPipe, 2)";}
"(runPreTaskCommands, 2)" -> {"(runCommands, 4)";}
"(Exec, 6)" -> {}
"(parsePackageFiles, 2)" -> {"(parseFiles, 6)";}
"(RoundTripOpt, 2)" -> {"(roundTrip, 1)";}
"(WaitForCluster, 2)" -> {"(Watch, 2)";}
"(validateSnapshot, 1)" -> {"(Validate, 2)";}
"(WatchFrom, 3)" -> {}
"(taskManager, 3)" -> {"(newTaskManager, 3)";}
"(Solve, 2)" -> {"(Solve, 3)";}
"(Walk, 3)" -> {"(Push, 1)";}
"(newServer, 2)" -> {"(NewServerConn, 2)";}
"(superviseManager, 5)" -> {"(runManager, 5)";}
"(doRequest, 2)" -> {"(Do, 3)";}
"(newBlockingProcess, 2)" -> {}
"(Copy, 2)" -> {"(Create, 1)";"(copyPipes, 7)";}
"(remove, 1)" -> {"(Remove, 2)";}
"(start, 1)" -> {"(handleControlSocketChange, 2)";"(createIO, 5)";"(CopyConsole, 6)";"(loadListeners, 2)";"(ContainerStart, 4)";"(Exec, 4)";"(NewDaemon, 3)";"(shutdownDaemon, 1)";}
"(worker, 4)" -> {}
"(start, 2)" -> {}
"(CopyConsole, 6)" -> {}
"(ViewAndWatch, 3)" -> {"(Watch, 2)";}
"(Verify, 3)" -> {"(verify, 3)";}
"(Decrypt, 1)" -> {"(Open, 4)";}
"(Validate, 2)" -> {"(Walk, 3)";}
"(call, 5)" -> {"(callSSA, 6)";}
"(Spec, 1)" -> {"(FromURL, 2)";}
"(monitor, 4)" -> {}
"(Parse, 1)" -> {"(Open, 1)";"(Walk, 2)";}
"(Log, 1)" -> {"(Add, 2)";"(Write, 1)";"(WriteMessage, 1)";"(WriteLogEntry, 1)";"(Encode, 1)";}
"(Watch, 2)" -> {"(WatchFrom, 3)";}
"(runManager, 5)" -> {}
"(StartTLS, 1)" -> {}
"(GetDockerLogs, 4)" -> {"(ContainerLogs, 3)";}
"(applyTemplate, 3)" -> {"(Execute, 2)";}
"(UpdateCluster, 2)" -> {"(Update, 1)";}
"(Update, 4)" -> {}
"(Put, 1)" -> {"(Create, 1)";"(Remove, 1)";}
"(runCommandSet, 7)" -> {"(Execute, 4)";}
"(Init, 1)" -> {"(startTask, 3)";"(Update, 1)";}
"(fetchPack, 4)" -> {"(UploadPack, 2)";}
"(Process, 3)" -> {"(fixImports, 2)";"(fixImports, 3)";}
"(Update, 2)" -> {"(reconcileTaskState, 4)";"(Create, 2)";"(Update, 1)";}
"(Get, 0)" -> {"(remove, 1)";"(run, 4)";"(Do, 2)";}
"(Push, 2)" -> {"(Remove, 2)";}
"(NewClient, 3)" -> {"(Prepare, 1)";}
"(initHandlers, 1)" -> {"(Remove, 1)";}
"(Interpret, 5)" -> {"(call, 5)";}
"(Verify, 2)" -> {"(Verify, 3)";}
"(verify, 3)" -> {"(fulfill, 3)";}
"(openNewMongoGroupDriver, 5)" -> {"(start, 2)";}
"(newServerTransport, 4)" -> {}
"(NewProcess, 2)" -> {"(newBlockingProcess, 2)";"(newBasicProcess, 2)";}
"(WriteMessage, 1)" -> {"(Write, 1)";}
"(write, 3)" -> {"(Prune, 3)";}
"(Decrypt, 2)" -> {"(Decrypt, 1)";"(Open, 4)";}
"(enableCSM, 3)" -> {"(Start, 2)";}
"(newSerfQueries, 4)" -> {}
"(FetchContext, 2)" -> {"(fetch, 2)";}
"(PushContext, 2)" -> {"(pushHashes, 5)";}
"(sendTestLogs, 5)" -> {"(sendTestLog, 4)";}
"(newSession, 5)" -> {}
"(build, 1)" -> {"(Open, 1)";"(openNewMongoGroupDriver, 5)";"(openNewMongoDriver, 4)";}
"(SetUpTest, 1)" -> {}
"(initializeSubsystem, 3)" -> {"(Create, 2)";}
"(useExistingTask, 3)" -> {"(DelayStart, 6)";}
"(updateHealthMonitor, 1)" -> {"(monitor, 4)";}
"(TryDial, 1)" -> {"(TryDialWithAddr, 2)";}
"(Subscribe, 2)" -> {}
"(Run, 2)" -> {"(SetUpTest, 1)";"(serve, 3)";"(Update, 4)";"(Watch, 2)";"(worker, 3)";"(Solve, 2)";"(TearDownSuite, 1)";"(SetUpSuite, 1)";}
"(newVertex, 5)" -> {"(load, 1)";}
"(PullContext, 2)" -> {"(fetch, 2)";}
"(Open, 1)" -> {"(start, 2)";}
"(Marshal, 1)" -> {"(Put, 1)";"(Encode, 1)";"(Get, 1)";"(Get, 0)";}
"(roundTrip, 1)" -> {"(awaitOpenSlotForRequest, 1)";}
"(GetDockerLogs, 5)" -> {"(GetDockerLogs, 4)";}
"(pullSchema2, 4)" -> {"(pullSchema2Layers, 4)";}
"(Init, 0)" -> {"(run, 3)";"(Add, 1)";"(Get, 0)";}
"(Create, 1)" -> {"(StartTLS, 1)";"(Run, 2)";"(newMemberlist, 1)";"(newSerfQueries, 4)";"(NewSnapshotter, 8)";}
"(ForEachPackage, 2)" -> {"(allPackages, 3)";"(allPackages, 4)";}
"(awaitOpenSlotForRequest, 1)" -> {}
"(logStats, 2)" -> {}
"(TearDownSuite, 1)" -> {}
"(serveBiDirectionalStream, 2)" -> {}
"(Set, 4)" -> {"(Do, 2)";}
"(Write, 1)" -> {"(Copy, 2)";"(write, 3)";}
"(newSession, 3)" -> {"(initHandlers, 1)";}
"(NewClientConn, 3)" -> {"(clientHandshake, 2)";}
"(Remove, 1)" -> {"(Search, 2)";"(Search, 1)";"(Remove, 2)";}
"(shutdownDaemon, 1)" -> {}
"(CreateProcess, 2)" -> {"(NewProcess, 2)";}
"(worker, 3)" -> {"(useExistingTask, 3)";"(updateTask, 4)";}
"(load, 2)" -> {"(Insert, 2)";}
"(get, 1)" -> {"(load, 1)";}
"(validateContainer, 1)" -> {"(Validate, 2)";}
"(List, 2)" -> {"(Walk, 3)";}
"(fetch, 2)" -> {"(fetchPack, 4)";}
"(remoteID, 1)" -> {"(Write, 1)";}
"(Open, 4)" -> {"(Verify, 3)";}
"(NewLoggerWithContext, 4)" -> {"(MakeLoggerWithContext, 3)";}
"(NewServer, 1)" -> {"(newServer, 2)";}
"(run, 1)" -> {"(newSession, 5)";"(Update, 2)";"(Dial, 1)";"(superviseManager, 5)";"(run, 4)";"(Write, 1)";"(Set, 1)";"(send, 3)";"(UpdateTaskStatus, 3)";"(Start, 1)";"(Subscribe, 2)";"(runAgent, 4)";"(Add, 1)";"(UpdateRootCA, 1)";"(Init, 1)";"(Do, 3)";}
"(Apply, 2)" -> {"(Update, 1)";"(Run, 2)";}
"(pull, 4)" -> {"(Pull, 3)";}
"(sendTestLogsAndResults, 6)" -> {"(sendTestLog, 4)";}
"(parseAndUploadResults, 4)" -> {"(sendTestLog, 4)";}
"(Apply, 1)" -> {"(Remove, 1)";}
"(runTaskCommands, 2)" -> {"(runCommands, 4)";}
"(run, 3)" -> {"(start, 2)";}
"(append, 1)" -> {}
"(NewSnapshotter, 8)" -> {}
"(Upgrade, 7)" -> {"(pull, 4)";}
"(runAgent, 4)" -> {}
"(load, 1)" -> {"(parsePackageFiles, 2)";}
"(Search, 1)" -> {"(Execute, 2)";}
"(executeOneFile, 5)" -> {"(sendTestLog, 4)";}
"(Load, 1)" -> {"(Create, 1)";}
"(GetMember, 1)" -> {"(Send, 0)";}
"(serve, 3)" -> {}
"(ContainerStart, 4)" -> {"(containerStart, 4)";}
"(apply, 2)" -> {"(Update, 2)";"(Remove, 1)";"(Apply, 2)";}
"(fixImports, 2)" -> {}
"(verifySplunkConnection, 1)" -> {"(Copy, 2)";}
"(Walk, 2)" -> {"(List, 2)";}
"(pullV2Tag, 3)" -> {"(pullSchema2, 4)";"(pullOCI, 4)";}
"(Add, 1)" -> {"(Push, 2)";"(Search, 2)";"(Insert, 2)";"(Load, 1)";"(Open, 1)";"(Put, 1)";}
"(FromURL, 2)" -> {"(Dial, 3)";}
"(sendTestLog, 4)" -> {"(sendTestLogToCedar, 4)";}
"(configureTLS, 4)" -> {}
"(Load, 2)" -> {"(load, 2)";"(newVertex, 5)";"(remoteID, 1)";"(Load, 1)";"(Get, 1)";"(Unmarshal, 2)";"(Release, 1)";}
"(Pull, 8)" -> {"(pull, 4)";}
"(Execute, 4)" -> {"(sendTestLogsAndResults, 6)";"(sendTestLogs, 5)";"(parseAndUploadResults, 4)";"(executeOneFile, 5)";}
"(New, 5)" -> {"(NewClient, 5)";}
"(SetReference, 1)" -> {}
"(updateTask, 4)" -> {"(DelayStart, 6)";}
"(visitInstr, 2)" -> {}
"(Read, 2)" -> {"(Put, 1)";}
"(ConcurrentUpdate, 4)" -> {}
"(SetUpSuite, 1)" -> {"(SetUpTest, 1)";"(WaitUntilStatus, 2)";}
"(Get, 3)" -> {"(Do, 3)";}
"(wait, 1)" -> {}
"(pushHashes, 5)" -> {}
"(validateImage, 1)" -> {"(Validate, 2)";}
"(newV2Client, 4)" -> {}
"(Encode, 1)" -> {"(Copy, 2)";"(Put, 1)";"(Write, 1)";}
"(NewClient, 1)" -> {"(NewClient, 3)";}
"(newDirectIO, 2)" -> {"(newStdioPipes, 1)";}
"(Start, 2)" -> {"(Start, 1)";}
"(UploadPack, 2)" -> {}
"(aliveNode, 3)" -> {"(NotifyConflict, 2)";}
"(Dial, 1)" -> {"(TryDial, 1)";}
"(fulfill, 3)" -> {}
"(RoundTrip, 1)" -> {"(start, 1)";"(roundTrip, 1)";"(RoundTripOpt, 2)";}
"(run, 4)" -> {"(Import, 1)";"(Create, 2)";"(Interpret, 5)";}
"(WaitUntilStatus, 2)" -> {}
"(Pull, 1)" -> {"(PullContext, 2)";}
"(Init, 2)" -> {"(SetReference, 1)";}
"(NewDaemon, 3)" -> {}
"(newClientTransport, 6)" -> {}
"(Search, 2)" -> {"(Execute, 2)";}
"(Init, 4)" -> {"(ListenPipe, 2)";}
"(NotifyConflict, 2)" -> {"(handleNodeConflict, 2)";}
"(NewServerConn, 2)" -> {"(serverHandshake, 1)";}
"(serverHandshake, 1)" -> {"(newServerTransport, 4)";"(serverAuthenticate, 1)";}
"(initHealthMonitor, 1)" -> {"(updateHealthMonitor, 1)";}
"(TryDialWithAddr, 2)" -> {"(NewClientConn, 3)";}
"(UpdateTaskStatus, 3)" -> {}
"(Start, 1)" -> {"(start, 1)";"(CopyConsole, 6)";"(worker, 4)";}
"(Insert, 2)" -> {"(insert, 4)";}
"(newMemberlist, 1)" -> {"(NewNetTransport, 1)";}
"(Get, 2)" -> {"(Do, 3)";"(get, 1)";"(New, 2)";"(Start, 1)";"(Do, 2)";"(implements, 1)";"(openNewMongoGroupDriver, 5)";}
"(clientHandshake, 2)" -> {"(newClientTransport, 6)";}
"(Update, 3)" -> {"(Set, 4)";"(Do, 2)";"(Encode, 1)";"(Unmarshal, 2)";"(validateSnapshot, 1)";"(UpdateCluster, 2)";"(putBuf, 1)";"(validateContainer, 1)";"(validateInfo, 1)";"(validateImage, 1)";"(Update, 2)";"(runOrError, 1)";"(update, 3)";"(Get, 1)";}
"(Prepare, 1)" -> {"(Upgrade, 7)";"(Pull, 8)";}
"(newTaskManager, 3)" -> {"(newTaskManager, 4)";}
"(stop, 1)" -> {}
"(allPackages, 3)" -> {}
"(DelayStart, 6)" -> {}
"(MarkProcessed, 1)" -> {"(New, 1)";"(Update, 3)";}
"(NewClient, 5)" -> {}
"(runCommands, 4)" -> {"(runCommandSet, 7)";}
"(pullV2Repository, 3)" -> {"(pullV2Tag, 3)";}
"(parseFiles, 6)" -> {}
"(NewNetTransport, 1)" -> {}
"(Exec, 4)" -> {"(Exec, 2)";}
"(Exec, 2)" -> {"(Solve, 3)";}
"(New, 2)" -> {"(initializeSubsystem, 3)";"(load, 1)";"(Update, 1)";"(Init, 2)";}
"(Do, 2)" -> {"(RoundTrip, 1)";"(Put, 1)";"(Write, 1)";}
"(Add, 2)" -> {"(Remove, 1)";"(Push, 2)";"(Spec, 1)";}
"(Import, 1)" -> {"(newLeaseUpdater, 3)";}
"(allPackages, 4)" -> {}
"(newTaskManager, 4)" -> {}
"(containerStart, 4)" -> {"(initHealthMonitor, 1)";}
"(Dial, 3)" -> {"(NewClientConn, 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: a30fb318ff554bfa7becbbbc3d5ad63e356be156
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.