github-vet / github-vet/rangeloop-pointer-findings

ovh/cds: engine/cdn/test/test.go; 3 LoC

Open
#7,369 0 comments 0 reactions 0 assignees View on GitHub
fresh tiny
Dominant language
No language data
Stars
0
Forks
0
PR merge metrics
PR metrics pending

Description

Found a possible issue in [ovh/cds](https://www.github.com/ovh/cds) at [engine/cdn/test/test.go](https://github.com/ovh/cds/blob/56af877c7efa9dabf3a12147d7ae8e1caa6d69db/engine/cdn/test/test.go#L25-L27)

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 u at line 26 may start a goroutine

[Click here to see the code in its original context.](https://github.com/ovh/cds/blob/56af877c7efa9dabf3a12147d7ae8e1caa6d69db/engine/cdn/test/test.go#L25-L27)

Click here to show the 3 line(s) of Go which triggered the analyzer.

```go
for _, u := range units {
storage.DeleteUnit(t, m, db, &u)
}

```

Click here to show extra information the analyzer produced.

```
The following paths through the callgraph could lead to a goroutine:
(DeleteUnit, 4) -> (Delete, 2) -> (New, 1) -> (init, 0) -> (, 0) -> (Distribution, 9) -> (genMarkdownTreeCustom, 4) -> (GenMarkdownCustom, 3) -> (WorkflowRunCraft, 2) -> (workflowRunCraft, 2) -> (UpdateCraftedWorkflowRun, 2) -> (updateParentWorkflowRun, 2) -> (UpdateParentWorkflowRun, 6) -> (UpdateOutgoingHookRunStatus, 7) -> (computeAndUpdateWorkflowRunStatus, 3)
(DeleteUnit, 4) -> (Delete, 2) -> (New, 1) -> (init, 0) -> (Initialize, 2) -> (Flush, 0) -> (Distribution, 9) -> (genMarkdownTreeCustom, 4) -> (askForGettingStaticFiles, 2) -> (buildFromSource, 1) -> (execCommand, 1)
(DeleteUnit, 4) -> (Delete, 2) -> (New, 1) -> (init, 0) -> (, 0) -> (Distribution, 9) -> (genMarkdownTreeCustom, 4) -> (GenMarkdownCustom, 3) -> (CommonServe, 2) -> (Create, 2) -> (workerRegister, 3) -> (Path, 0) -> (ComputeWorkerModelPath, 2)
(DeleteUnit, 4) -> (Delete, 2) -> (New, 1) -> (init, 0) -> (, 0) -> (Distribution, 9) -> (genMarkdownTreeCustom, 4) -> (GenMarkdownCustom, 3) -> (downloadHandler, 2)
(DeleteUnit, 4) -> (Delete, 2) -> (New, 1) -> (init, 0) -> (Initialize, 2) -> (Flush, 0) -> (Distribution, 9) -> (genMarkdownTreeCustom, 4) -> (Serve, 1) -> (int32, 1) -> (QueueJobSetVersion, 3) -> (StatusText, 1) -> (queueDirectArtifactUpload, 5) -> (FormDataContentType, 0) -> (ObjectTempUrl, 5) -> (ContainerUpdate, 2)
(DeleteUnit, 4) -> (Delete, 2) -> (New, 1) -> (init, 0) -> (Initialize, 2) -> (Flush, 0) -> (Distribution, 9) -> (genMarkdownTreeCustom, 4) -> (Serve, 1)
(DeleteUnit, 4) -> (Delete, 2) -> (New, 1) -> (init, 0) -> (, 0) -> (Distribution, 9) -> (genMarkdownTreeCustom, 4) -> (GenMarkdownCustom, 3) -> (CommonServe, 2)
(DeleteUnit, 4) -> (Delete, 2) -> (WithStack, 1) -> (callers, 0) -> (init, 0) -> (UTC, 0) -> (Interface, 0) -> (Valid, 1) -> (Serve, 1) -> (int32, 1) -> (QueueJobSetVersion, 3) -> (StatusText, 1) -> (queueDirectArtifactUpload, 5) -> (FormDataContentType, 0) -> (ObjectTempUrl, 5)
(DeleteUnit, 4) -> (Delete, 2) -> (New, 1) -> (init, 0) -> (, 0) -> (Distribution, 9) -> (genMarkdownTreeCustom, 4) -> (GenMarkdownCustom, 3) -> (WorkflowRunCraft, 2) -> (workflowRunCraft, 2) -> (UpdateCraftedWorkflowRun, 2)
(DeleteUnit, 4) -> (Delete, 2) -> (WithStack, 1) -> (callers, 0) -> (init, 0) -> (UTC, 0) -> (Interface, 0) -> (Valid, 1) -> (Serve, 1) -> (int32, 1) -> (QueueJobSetVersion, 3) -> (StatusText, 1) -> (queueDirectArtifactUpload, 5)
(DeleteUnit, 4) -> (Delete, 2) -> (New, 1) -> (init, 0) -> (, 0) -> (Distribution, 9) -> (genMarkdownTreeCustom, 4) -> (GenMarkdownCustom, 3) -> (Start, 1) -> (start, 3)
(DeleteUnit, 4) -> (Delete, 2) -> (New, 1) -> (init, 0) -> (, 0) -> (Distribution, 9) -> (genMarkdownTreeCustom, 4) -> (GenMarkdownCustom, 3) -> (WorkflowRunCraft, 2) -> (workflowRunCraft, 2) -> (UpdateCraftedWorkflowRun, 2) -> (updateParentWorkflowRun, 2)
(DeleteUnit, 4) -> (Delete, 2) -> (New, 1) -> (init, 0) -> (, 0) -> (Distribution, 9) -> (genMarkdownTreeCustom, 4)
(DeleteUnit, 4) -> (Delete, 2) -> (New, 1) -> (init, 0) -> (, 0) -> (Distribution, 9) -> (genMarkdownTreeCustom, 4) -> (GenMarkdownCustom, 3) -> (Initialize, 3)
(DeleteUnit, 4) -> (Delete, 2) -> (WithStack, 1) -> (callers, 0) -> (init, 0) -> (UTC, 0) -> (Interface, 0) -> (Valid, 1) -> (Run, 4) -> (Exec, 4)
(DeleteUnit, 4) -> (Delete, 2) -> (New, 1) -> (init, 0) -> (, 0) -> (Distribution, 9) -> (genMarkdownTreeCustom, 4) -> (GenMarkdownCustom, 3) -> (CommonServe, 2) -> (Create, 2)
(DeleteUnit, 4) -> (Delete, 2) -> (WithStack, 1) -> (callers, 0) -> (init, 0) -> (UTC, 0) -> (Interface, 0) -> (Valid, 1) -> (Start, 2) -> (Start, 1) -> (start, 3)
(DeleteUnit, 4) -> (Delete, 2) -> (New, 1) -> (init, 0) -> (Initialize, 2) -> (Flush, 0) -> (Distribution, 9) -> (genMarkdownTreeCustom, 4) -> (Serve, 1) -> (int32, 1) -> (QueueJobSetVersion, 3) -> (StatusText, 1)
(DeleteUnit, 4) -> (Delete, 2) -> (WithStack, 1) -> (callers, 0) -> (init, 0) -> (UTC, 0) -> (Interface, 0) -> (Valid, 1) -> (Serve, 1) -> (int32, 1) -> (QueueJobSetVersion, 3) -> (StatusText, 1) -> (queueDirectArtifactUpload, 5) -> (FormDataContentType, 0) -> (ObjectTempUrl, 5) -> (ContainerUpdate, 2)
(DeleteUnit, 4) -> (Delete, 2) -> (New, 1) -> (init, 0) -> (Initialize, 2)
(DeleteUnit, 4) -> (Delete, 2) -> (New, 1) -> (init, 0) -> (Initialize, 2) -> (Flush, 0) -> (Distribution, 9) -> (genMarkdownTreeCustom, 4)
(DeleteUnit, 4) -> (Delete, 2) -> (WithStack, 1) -> (callers, 0) -> (init, 0) -> (UTC, 0) -> (Interface, 0) -> (Valid, 1) -> (Do, 1)
(DeleteUnit, 4) -> (Delete, 2) -> (New, 1) -> (init, 0) -> (, 0) -> (Distribution, 9) -> (genMarkdownTreeCustom, 4) -> (GenMarkdownCustom, 3) -> (runScheduler, 1) -> (deleteTaskExecutionsRoutine, 1) -> (deleteTask, 2) -> (DeleteTask, 2) -> (RemoveGerritRepoHook, 3)
(DeleteUnit, 4) -> (Delete, 2) -> (New, 1) -> (init, 0)
(DeleteUnit, 4) -> (Delete, 2) -> (New, 1) -> (init, 0) -> (Initialize, 2) -> (Flush, 0)
(DeleteUnit, 4) -> (Delete, 2) -> (WithStack, 1) -> (callers, 0) -> (init, 0) -> (UTC, 0) -> (Interface, 0) -> (Valid, 1) -> (askForGettingStaticFiles, 2) -> (buildFromSource, 1) -> (execCommand, 1)
(DeleteUnit, 4) -> (Delete, 2) -> (WithStack, 1) -> (callers, 0) -> (init, 0) -> (UTC, 0) -> (Interface, 0) -> (Valid, 1) -> (Serve, 1) -> (int32, 1) -> (QueueJobSetVersion, 3)
(DeleteUnit, 4) -> (Delete, 2) -> (New, 1) -> (init, 0) -> (, 0) -> (Distribution, 9) -> (genMarkdownTreeCustom, 4) -> (GenMarkdownCustom, 3) -> (serviceAPIHeartbeat, 1) -> (serviceAPIHeartbeatUpdate, 2) -> (UpsertStatus, 3) -> (InsertCapabilityForModelID, 3) -> (UpdateSecret, 3)
(DeleteUnit, 4) -> (Delete, 2) -> (WithStack, 1) -> (callers, 0) -> (init, 0) -> (UTC, 0) -> (Interface, 0) -> (Valid, 1) -> (Serve, 1) -> (int32, 1) -> (QueueJobSetVersion, 3) -> (StatusText, 1) -> (queueDirectArtifactUpload, 5) -> (FormDataContentType, 0)
(DeleteUnit, 4) -> (Delete, 2) -> (New, 1) -> (init, 0) -> (, 0) -> (Distribution, 9) -> (genMarkdownTreeCustom, 4) -> (GenMarkdownCustom, 3) -> (Exec, 4)
(DeleteUnit, 4) -> (Delete, 2) -> (New, 1) -> (init, 0) -> (Initialize, 2) -> (Flush, 0) -> (Distribution, 9) -> (genMarkdownTreeCustom, 4) -> (Start, 2) -> (Start, 1) -> (start, 3)
(DeleteUnit, 4) -> (Delete, 2) -> (WithStack, 1) -> (callers, 0) -> (init, 0) -> (UTC, 0) -> (Interface, 0) -> (Valid, 1) -> (Serve, 1) -> (int32, 1)
(DeleteUnit, 4) -> (Delete, 2) -> (New, 1) -> (init, 0) -> (, 0) -> (Distribution, 9) -> (genMarkdownTreeCustom, 4) -> (GenMarkdownCustom, 3) -> (RunsSecrets, 2) -> (migrateRuns, 2)
(DeleteUnit, 4) -> (Delete, 2) -> (New, 1) -> (init, 0) -> (, 0) -> (Distribution, 9) -> (genMarkdownTreeCustom, 4) -> (GenMarkdownCustom, 3) -> (runTasks, 1) -> (startTasks, 1) -> (startTask, 2) -> (startGerritHookTask, 1)
(DeleteUnit, 4) -> (Delete, 2) -> (New, 1) -> (init, 0) -> (Initialize, 2) -> (Flush, 0) -> (Distribution, 9) -> (genMarkdownTreeCustom, 4) -> (Serve, 1) -> (int32, 1) -> (QueueJobSetVersion, 3) -> (StatusText, 1) -> (queueDirectArtifactUpload, 5) -> (FormDataContentType, 0) -> (ObjectTempUrl, 5)
(DeleteUnit, 4) -> (Delete, 2) -> (WithStack, 1) -> (callers, 0) -> (init, 0) -> (UTC, 0) -> (Interface, 0)
(DeleteUnit, 4) -> (Delete, 2) -> (New, 1) -> (init, 0) -> (Initialize, 2) -> (Flush, 0) -> (Distribution, 9)
(DeleteUnit, 4) -> (Delete, 2) -> (New, 1) -> (init, 0) -> (Initialize, 2) -> (Flush, 0) -> (Distribution, 9) -> (genMarkdownTreeCustom, 4) -> (Do, 1)
(DeleteUnit, 4) -> (Delete, 2) -> (New, 1) -> (init, 0) -> (Initialize, 2) -> (Flush, 0) -> (Distribution, 9) -> (genMarkdownTreeCustom, 4) -> (Serve, 1) -> (int32, 1) -> (QueueJobSetVersion, 3)
(DeleteUnit, 4) -> (Delete, 2) -> (New, 1) -> (init, 0) -> (Initialize, 2) -> (Flush, 0) -> (Distribution, 9) -> (genMarkdownTreeCustom, 4) -> (Serve, 1) -> (int32, 1) -> (QueueJobSetVersion, 3) -> (StatusText, 1) -> (queueDirectArtifactUpload, 5)
(DeleteUnit, 4) -> (Delete, 2) -> (New, 1) -> (init, 0) -> (, 0) -> (Distribution, 9) -> (genMarkdownTreeCustom, 4) -> (GenMarkdownCustom, 3) -> (CommonServe, 2) -> (Create, 2) -> (workerRegister, 3) -> (Path, 0) -> (ComputeWorkerModelPath, 2) -> (getModels, 1)
(DeleteUnit, 4) -> (Delete, 2) -> (WithStack, 1) -> (callers, 0) -> (init, 0) -> (UTC, 0)
(DeleteUnit, 4) -> (Delete, 2) -> (WithStack, 1) -> (callers, 0) -> (init, 0) -> (UTC, 0) -> (Interface, 0) -> (Valid, 1) -> (Serve, 1)
(DeleteUnit, 4) -> (Delete, 2) -> (New, 1) -> (init, 0) -> (Initialize, 2) -> (Flush, 0) -> (Distribution, 9) -> (genMarkdownTreeCustom, 4) -> (Serve, 1) -> (int32, 1)
(DeleteUnit, 4) -> (Delete, 2) -> (WithStack, 1) -> (callers, 0) -> (init, 0)
(DeleteUnit, 4) -> (Delete, 2) -> (New, 1) -> (init, 0) -> (, 0) -> (Distribution, 9) -> (genMarkdownTreeCustom, 4) -> (GenMarkdownCustom, 3)
(DeleteUnit, 4) -> (Delete, 2) -> (New, 1) -> (init, 0) -> (Initialize, 2) -> (Flush, 0) -> (Distribution, 9) -> (genMarkdownTreeCustom, 4) -> (Run, 4) -> (Exec, 4)
(DeleteUnit, 4) -> (Delete, 2) -> (New, 1) -> (init, 0) -> (, 0) -> (Distribution, 9) -> (genMarkdownTreeCustom, 4) -> (GenMarkdownCustom, 3) -> (runScheduler, 1) -> (deleteTaskExecutionsRoutine, 1) -> (deleteTask, 2) -> (DeleteTask, 2)
(DeleteUnit, 4) -> (Delete, 2) -> (New, 1) -> (init, 0) -> (, 0) -> (Distribution, 9) -> (genMarkdownTreeCustom, 4) -> (GenMarkdownCustom, 3) -> (WorkflowRunCraft, 2) -> (workflowRunCraft, 2) -> (UpdateCraftedWorkflowRun, 2) -> (updateParentWorkflowRun, 2) -> (UpdateParentWorkflowRun, 6)
(DeleteUnit, 4) -> (Delete, 2) -> (New, 1) -> (init, 0) -> (, 0) -> (Distribution, 9) -> (genMarkdownTreeCustom, 4) -> (GenMarkdownCustom, 3) -> (runTasks, 1) -> (startTasks, 1) -> (startTask, 2) -> (startGerritHookTask, 1) -> (RegisterGerritRepoHook, 3)
(DeleteUnit, 4) -> (Delete, 2) -> (New, 1) -> (init, 0) -> (Initialize, 2) -> (Flush, 0) -> (Distribution, 9) -> (genMarkdownTreeCustom, 4) -> (Serve, 1) -> (int32, 1) -> (QueueJobSetVersion, 3) -> (StatusText, 1) -> (queueDirectArtifactUpload, 5) -> (FormDataContentType, 0)
(DeleteUnit, 4) -> (Delete, 2) -> (New, 1) -> (init, 0) -> (, 0) -> (Distribution, 9) -> (genMarkdownTreeCustom, 4) -> (GenMarkdownCustom, 3) -> (CommonServe, 2) -> (Create, 2) -> (workerRegister, 3) -> (Path, 0) -> (ComputeWorkerModelPath, 2) -> (getModels, 1) -> (Reconfigure, 2)
(DeleteUnit, 4) -> (Delete, 2) -> (WithStack, 1) -> (callers, 0) -> (init, 0) -> (UTC, 0) -> (Interface, 0) -> (Valid, 1)
(DeleteUnit, 4) -> (Delete, 2) -> (New, 1) -> (init, 0) -> (, 0) -> (Distribution, 9) -> (genMarkdownTreeCustom, 4) -> (GenMarkdownCustom, 3) -> (runScheduler, 1)
(DeleteUnit, 4) -> (Delete, 2) -> (New, 1) -> (init, 0) -> (, 0) -> (Distribution, 9) -> (genMarkdownTreeCustom, 4) -> (GenMarkdownCustom, 3) -> (buildFromSource, 1) -> (execCommand, 1)
(DeleteUnit, 4) -> (Delete, 2) -> (WithStack, 1) -> (callers, 0) -> (init, 0) -> (UTC, 0) -> (Interface, 0) -> (Valid, 1) -> (Serve, 1) -> (int32, 1) -> (QueueJobSetVersion, 3) -> (StatusText, 1)
(DeleteUnit, 4) -> (Delete, 2) -> (New, 1) -> (init, 0) -> (, 0) -> (Distribution, 9) -> (genMarkdownTreeCustom, 4) -> (GenMarkdownCustom, 3) -> (Run, 4) -> (Exec, 4)
(DeleteUnit, 4) -> (Delete, 2) -> (New, 1) -> (init, 0) -> (, 0) -> (Distribution, 9) -> (genMarkdownTreeCustom, 4) -> (GenMarkdownCustom, 3) -> (uploadHandler, 2) -> (RunArtifactUpload, 4)

```

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: 56af877c7efa9dabf3a12147d7ae8e1caa6d69db

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.