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

insane07/nyota: backend/api/loginHandler.go; 3 LoC

Open
#7,748 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 [insane07/nyota](https://www.github.com/insane07/nyota) at [backend/api/loginHandler.go](https://github.com/insane07/nyota/blob/0c5a7d22dc61b5bddb6d722ef8d56c2bdd1d571c/backend/api/loginHandler.go#L31-L33)

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 localUser at line 32 may start a goroutine

[Click here to see the code in its original context.](https://github.com/insane07/nyota/blob/0c5a7d22dc61b5bddb6d722ef8d56c2bdd1d571c/backend/api/loginHandler.go#L31-L33)

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

```go
for _, localUser := range users {
svc.Store.UpsertUser(nil, &localUser)
}

```

Click here to show extra information the analyzer produced.

```
The following paths through the callgraph could lead to a goroutine:
(UpsertUser, 2) -> (Insert, 1) -> (insert, 3) -> (PostInsert, 1) -> (Do, 1) -> (StoreUint32, 2) -> (cmdShard, 1)
(UpsertUser, 2) -> (execTx, 3) -> (exec, 1) -> (postExecuteWorkaround, 0) -> (New, 1) -> (make, 2) -> (Debugf, 4) -> (OpenFile, 3)
(UpsertUser, 2) -> (Insert, 1) -> (compress, 0) -> (copy, 2) -> (Remove, 1) -> (removeBlock, 1) -> (Clear, 0) -> (gtk_tree_view_column_clear, 1) -> (newConn, 1)
(UpsertUser, 2) -> (Insert, 1) -> (first, 0) -> (init, 0) -> (ServeHTTP, 2) -> (ServePage, 2) -> (applyTemplateToResponseWriter, 3) -> (linksByStart, 1) -> (newConn, 1)
(UpsertUser, 2) -> (execTx, 3) -> (exec, 1) -> (postExecuteWorkaround, 0) -> (New, 1) -> (make, 2) -> (Debugf, 4) -> (OpenFile, 3) -> (Prompt, 1) -> (PromptWithSuggestion, 3) -> (inputWaiting, 0)
(UpsertUser, 2) -> (Insert, 1) -> (first, 0) -> (init, 0) -> (newSyslogger, 3) -> (New, 2) -> (gate, 1) -> (Deserialize, 2) -> (LoadInformation, 1)
(UpsertUser, 2) -> (Insert, 1) -> (first, 0) -> (init, 0) -> (newSyslogger, 3) -> (New, 2) -> (gate, 1) -> (Deserialize, 2) -> (Record, 3)
(UpsertUser, 2) -> (Insert, 1) -> (first, 0) -> (init, 0) -> (New, 1) -> (PSubscribe, 0) -> (Debugf, 4) -> (receiveMessage, 1) -> (dial, 0) -> (MasterAddr, 0) -> (setSentinel, 1)
(UpsertUser, 2) -> (Insert, 1) -> (compress, 0) -> (copy, 2) -> (Close, 0) -> (Printf, 3) -> (Replace, 4)
(UpsertUser, 2) -> (Insert, 1) -> (insert, 3) -> (PostInsert, 1) -> (New, 1) -> (PSubscribe, 0) -> (Debugf, 4)
(UpsertUser, 2) -> (Insert, 1) -> (first, 0) -> (init, 0) -> (Register, 1)
(UpsertUser, 2) -> (Insert, 1) -> (first, 0) -> (init, 0) -> (RedisOptions, 1) -> (Fatalf, 3) -> (Get, 1) -> (MoveToFront, 1)
(UpsertUser, 2) -> (Insert, 1) -> (first, 0) -> (init, 0) -> (Do, 1) -> (StoreUint32, 2) -> (FileLine, 1) -> (shardByKey, 1)
(UpsertUser, 2) -> (Insert, 1) -> (first, 0) -> (init, 0) -> (main, 0) -> (outf, 3) -> (GOROOT, 0) -> (IsUpper, 1) -> (Listen, 3)
(UpsertUser, 2) -> (Insert, 1) -> (first, 0) -> (init, 0) -> (New, 2) -> (Sort, 1) -> (Deserialize, 2) -> (NewConn, 0) -> (continueDir, 1)
(UpsertUser, 2) -> (Insert, 1) -> (first, 0) -> (init, 0) -> (main, 0) -> (outf, 3) -> (GOROOT, 0) -> (IsUpper, 1) -> (dial, 0) -> (MasterAddr, 0) -> (setSentinel, 1)
(UpsertUser, 2) -> (execTx, 3) -> (exec, 1) -> (postExecuteWorkaround, 0) -> (New, 1)
(UpsertUser, 2) -> (Insert, 1) -> (first, 0) -> (init, 0) -> (main, 0)
(UpsertUser, 2) -> (Insert, 1) -> (first, 0) -> (init, 0) -> (main, 0) -> (outf, 3) -> (GOROOT, 0) -> (IsUpper, 1) -> (allPackages, 3)
(UpsertUser, 2) -> (Insert, 1) -> (first, 0) -> (init, 0) -> (main, 0) -> (outf, 3) -> (GOROOT, 0) -> (IsUpper, 1) -> (Collect, 1)
(UpsertUser, 2) -> (Insert, 1) -> (compress, 0) -> (copy, 2) -> (Close, 0) -> (Printf, 3) -> (Replace, 4) -> (remove, 2) -> (dial, 0) -> (MasterAddr, 0) -> (setSentinel, 1)
(UpsertUser, 2) -> (Insert, 1) -> (first, 0) -> (init, 0) -> (New, 1) -> (PSubscribe, 0) -> (Debugf, 4)
(UpsertUser, 2) -> (Debugf, 2) -> (Printf, 2) -> (Prefix, 0) -> (New, 1) -> (make, 2) -> (Debugf, 4) -> (Debugf, 4)
(UpsertUser, 2) -> (Insert, 1) -> (first, 0) -> (init, 0) -> (New, 1) -> (PSubscribe, 0) -> (Debugf, 4) -> (receiveMessage, 1)
(UpsertUser, 2) -> (Insert, 1) -> (first, 0) -> (init, 0) -> (New, 2) -> (Sort, 1) -> (Deserialize, 2) -> (NewConn, 0) -> (LoadInformation, 1)
(UpsertUser, 2) -> (Insert, 1) -> (first, 0) -> (init, 0) -> (main, 0) -> (outf, 3) -> (GOROOT, 0) -> (IsUpper, 1) -> (callSSA, 6) -> (runFrame, 1) -> (visitInstr, 2)
(UpsertUser, 2) -> (Insert, 1) -> (insert, 3) -> (PostInsert, 1) -> (Close, 0) -> (Name, 0)
(UpsertUser, 2) -> (Insert, 1) -> (compress, 0) -> (copy, 2) -> (Close, 0) -> (Printf, 3) -> (Replace, 4) -> (remove, 2)
(UpsertUser, 2) -> (Insert, 1) -> (first, 0) -> (init, 0) -> (New, 2) -> (Sort, 1) -> (Deserialize, 2) -> (NewConn, 0)
(UpsertUser, 2) -> (Insert, 1) -> (first, 0) -> (init, 0) -> (main, 0) -> (outf, 3) -> (GOROOT, 0) -> (IsUpper, 1) -> (newConn, 1)
(UpsertUser, 2) -> (Insert, 1) -> (first, 0) -> (init, 0) -> (main, 0) -> (outf, 3) -> (GOROOT, 0) -> (IsUpper, 1) -> (Clone, 1) -> (Merge, 2)
(UpsertUser, 2) -> (Debugf, 2) -> (Printf, 2) -> (Prefix, 0) -> (New, 1) -> (make, 2) -> (Debugf, 4) -> (Debugf, 4) -> (Prompt, 1) -> (PromptWithSuggestion, 3) -> (inputWaiting, 0)
(UpsertUser, 2) -> (Insert, 1) -> (first, 0) -> (init, 0) -> (newSyslogger, 3) -> (New, 2) -> (gate, 1)
(UpsertUser, 2) -> (Insert, 1) -> (first, 0) -> (init, 0) -> (Init, 0) -> (refreshMetadataLoop, 0) -> (extractMetadata, 1) -> (IndexRune, 2)
(UpsertUser, 2) -> (execTx, 3) -> (exec, 1) -> (postExecuteWorkaround, 0) -> (New, 1) -> (make, 2) -> (Debugf, 4) -> (OpenFile, 3) -> (newConn, 1)
(UpsertUser, 2) -> (Insert, 1) -> (compress, 0) -> (copy, 2) -> (Close, 0) -> (Printf, 3)
(UpsertUser, 2) -> (Insert, 1) -> (first, 0) -> (init, 0) -> (, 0) -> (Suite, 1) -> (receiveMessage, 1)
(UpsertUser, 2) -> (Insert, 1) -> (first, 0) -> (init, 0) -> (Do, 1) -> (StoreUint32, 2) -> (FileLine, 1)
(UpsertUser, 2) -> (Insert, 1) -> (first, 0) -> (init, 0) -> (ServeHTTP, 2) -> (ServePage, 2) -> (applyTemplateToResponseWriter, 3) -> (linksByStart, 1)
(UpsertUser, 2) -> (Insert, 1) -> (first, 0) -> (init, 0) -> (main, 0) -> (outf, 3) -> (GOROOT, 0) -> (IsUpper, 1) -> (LoadInformation, 1)
(UpsertUser, 2) -> (Insert, 1) -> (first, 0) -> (init, 0) -> (newSyslogger, 3) -> (New, 2) -> (gate, 1) -> (Deserialize, 2) -> (LoadBinaryInfoPE, 2)
(UpsertUser, 2) -> (Insert, 1) -> (first, 0) -> (init, 0) -> (New, 2) -> (Sort, 1)
(UpsertUser, 2) -> (Insert, 1) -> (first, 0) -> (init, 0) -> (Find, 0) -> (StorePointer, 2) -> (getprocaddress, 2)
(UpsertUser, 2) -> (Insert, 1) -> (first, 0) -> (init, 0) -> (newSyslogger, 3) -> (New, 2) -> (gate, 1) -> (Deserialize, 2) -> (Listen, 3)
(UpsertUser, 2) -> (Insert, 1) -> (first, 0) -> (init, 0) -> (newSyslogger, 3) -> (New, 2) -> (gate, 1) -> (Deserialize, 2) -> (LoadBinaryInfoMacho, 2)
(UpsertUser, 2) -> (Insert, 1) -> (first, 0) -> (init, 0) -> (New, 1) -> (PSubscribe, 0) -> (Debugf, 4) -> (receiveMessage, 1) -> (newConn, 1)
(UpsertUser, 2) -> (Insert, 1) -> (first, 0) -> (init, 0) -> (New, 2) -> (Sort, 1) -> (Deserialize, 2) -> (NewConn, 0) -> (dial, 0) -> (MasterAddr, 0) -> (setSentinel, 1)
(UpsertUser, 2) -> (Debugf, 2) -> (Printf, 2) -> (Prefix, 0) -> (New, 1) -> (make, 2) -> (Debugf, 4)
(UpsertUser, 2) -> (Insert, 1) -> (first, 0) -> (init, 0) -> (Register, 1) -> (HandleFunc, 2) -> (Path, 1)
(UpsertUser, 2) -> (Insert, 1) -> (first, 0) -> (init, 0) -> (main, 0) -> (outf, 3) -> (GOROOT, 0) -> (IsUpper, 1) -> (Continue, 0)
(UpsertUser, 2) -> (Insert, 1) -> (first, 0) -> (init, 0) -> (newSyslogger, 3) -> (New, 2) -> (gate, 1) -> (Deserialize, 2) -> (Continue, 0) -> (continueDir, 1)
(UpsertUser, 2) -> (Insert, 1) -> (first, 0) -> (init, 0) -> (main, 0) -> (outf, 3) -> (GOROOT, 0) -> (IsUpper, 1) -> (PromptWithSuggestion, 3) -> (inputWaiting, 0) -> (tabPrinter, 1)
(UpsertUser, 2) -> (Insert, 1) -> (first, 0) -> (init, 0) -> (Register, 1) -> (HandleFunc, 2) -> (Path, 1) -> (Join, 1) -> (dial, 0) -> (MasterAddr, 0) -> (setSentinel, 1)
(UpsertUser, 2) -> (Insert, 1) -> (compress, 0) -> (copy, 2) -> (Remove, 1) -> (removeBlock, 1) -> (Clear, 0)
(UpsertUser, 2) -> (Insert, 1) -> (first, 0) -> (init, 0) -> (Set, 2) -> (MakeHasher, 0) -> (hashFor, 1) -> (Dir, 0)
(UpsertUser, 2) -> (Insert, 1) -> (first, 0) -> (init, 0) -> (main, 0) -> (outf, 3) -> (GOROOT, 0) -> (IsUpper, 1) -> (InstrumentHandlerFuncWithOpts, 2) -> (WithLabelValues, 2)
(UpsertUser, 2) -> (Insert, 1) -> (first, 0) -> (init, 0) -> (main, 0) -> (outf, 3) -> (GOROOT, 0) -> (IsUpper, 1) -> (Continue, 0) -> (continueDir, 1)
(UpsertUser, 2) -> (Insert, 1) -> (first, 0) -> (init, 0) -> (Register, 1) -> (HandleFunc, 2)
(UpsertUser, 2) -> (Insert, 1) -> (first, 0) -> (init, 0) -> (RunIndexer, 0) -> (Sleep, 1) -> (GC, 0) -> (getEdgeSegmentIDs, 0)
(UpsertUser, 2) -> (Debugf, 2) -> (Printf, 2) -> (Prefix, 0) -> (New, 1) -> (make, 2) -> (Debugf, 4) -> (Debugf, 4) -> (newConn, 1)
(UpsertUser, 2) -> (Insert, 1) -> (first, 0) -> (init, 0) -> (main, 0) -> (outf, 3) -> (GOROOT, 0) -> (IsUpper, 1) -> (InstrumentHandlerFunc, 2) -> (InstrumentHandlerFuncWithOpts, 2) -> (WithLabelValues, 2)
(UpsertUser, 2) -> (Insert, 1) -> (first, 0) -> (init, 0) -> (NewRediStore, 5) -> (dial, 3) -> (StoreUint32, 2) -> (cmdShard, 1)
(UpsertUser, 2) -> (Insert, 1) -> (first, 0) -> (init, 0) -> (main, 0) -> (outf, 3) -> (GOROOT, 0) -> (IsUpper, 1) -> (fixImports, 3)
(UpsertUser, 2) -> (Insert, 1) -> (first, 0) -> (init, 0) -> (main, 0) -> (outf, 3) -> (GOROOT, 0) -> (IsUpper, 1) -> (newDirTree, 4)
(UpsertUser, 2) -> (execTx, 3) -> (exec, 1) -> (postExecuteWorkaround, 0) -> (New, 1) -> (make, 2) -> (Debugf, 4) -> (OpenFile, 3) -> (dial, 0) -> (MasterAddr, 0) -> (setSentinel, 1)
(UpsertUser, 2) -> (Insert, 1) -> (insert, 3) -> (PostInsert, 1) -> (New, 1)
(UpsertUser, 2) -> (Insert, 1) -> (insert, 1) -> (wordMask, 1) -> (copy, 2) -> (Copy, 2) -> (Open, 0)
(UpsertUser, 2) -> (Insert, 1) -> (first, 0) -> (init, 0) -> (ServeHTTP, 2) -> (ServePage, 2) -> (applyTemplateToResponseWriter, 3)
(UpsertUser, 2) -> (Insert, 1) -> (compress, 0) -> (copy, 2) -> (Close, 0) -> (Printf, 3) -> (Replace, 4) -> (remove, 2) -> (newConn, 1)
(UpsertUser, 2) -> (Insert, 1) -> (first, 0) -> (init, 0) -> (main, 0) -> (outf, 3) -> (GOROOT, 0) -> (IsUpper, 1) -> (LoadBinaryInfoElf, 2)
(UpsertUser, 2) -> (Insert, 1) -> (first, 0) -> (init, 0) -> (ServeHTTP, 2) -> (ServePage, 2) -> (applyTemplateToResponseWriter, 3) -> (linksByStart, 1) -> (dial, 0) -> (MasterAddr, 0) -> (setSentinel, 1)
(UpsertUser, 2) -> (Insert, 1) -> (first, 0) -> (init, 0) -> (main, 0) -> (outf, 3) -> (GOROOT, 0) -> (IsUpper, 1) -> (Record, 3)
(UpsertUser, 2) -> (Insert, 1) -> (first, 0) -> (init, 0) -> (main, 0) -> (outf, 3)
(UpsertUser, 2) -> (Insert, 1) -> (first, 0) -> (init, 0) -> (NewClient, 1) -> (newClient, 2) -> (NewConnPool, 5)
(UpsertUser, 2) -> (Insert, 1) -> (first, 0) -> (init, 0) -> (main, 0) -> (outf, 3) -> (GOROOT, 0)
(UpsertUser, 2) -> (Insert, 1) -> (first, 0) -> (init, 0) -> (main, 0) -> (outf, 3) -> (GOROOT, 0) -> (IsUpper, 1) -> (LoadBinaryInfoPE, 2)
(UpsertUser, 2) -> (Insert, 1) -> (first, 0) -> (init, 0) -> (main, 0) -> (outf, 3) -> (GOROOT, 0) -> (IsUpper, 1) -> (Prompt, 1) -> (PromptWithSuggestion, 3) -> (inputWaiting, 0)
(UpsertUser, 2) -> (Insert, 1) -> (first, 0) -> (init, 0) -> (RunIndexer, 0) -> (Sleep, 1) -> (GC, 0)
(UpsertUser, 2) -> (Insert, 1) -> (first, 0) -> (init, 0) -> (Register, 1) -> (HandleFunc, 2) -> (Path, 1) -> (Join, 1)
(UpsertUser, 2) -> (Insert, 1) -> (first, 0) -> (init, 0) -> (Init, 0)
(UpsertUser, 2) -> (Insert, 1) -> (first, 0) -> (init, 0) -> (, 0) -> (Suite, 1) -> (receiveMessage, 1) -> (IsNetworkError, 1) -> (MasterAddr, 0) -> (setSentinel, 1)
(UpsertUser, 2) -> (Insert, 1) -> (first, 0) -> (init, 0) -> (main, 0) -> (outf, 3) -> (GOROOT, 0) -> (IsUpper, 1) -> (parallel, 3)
(UpsertUser, 2) -> (Insert, 1) -> (first, 0) -> (init, 0) -> (, 0) -> (Suite, 1) -> (receiveMessage, 1) -> (IsNetworkError, 1) -> (newConn, 1)
(UpsertUser, 2) -> (Insert, 1) -> (first, 0) -> (init, 0) -> (main, 0) -> (outf, 3) -> (GOROOT, 0) -> (IsUpper, 1) -> (PromptWithSuggestion, 3) -> (inputWaiting, 0)
(UpsertUser, 2) -> (Insert, 1) -> (first, 0) -> (init, 0) -> (, 0) -> (Suite, 1) -> (receiveMessage, 1) -> (IsNetworkError, 1) -> (MasterAddr, 0) -> (setSentinel, 1) -> (listen, 1)
(UpsertUser, 2) -> (execTx, 3) -> (Begin, 0) -> (trace, 2) -> (BeginTx, 2) -> (watchCancel, 1)
(UpsertUser, 2) -> (Insert, 1) -> (first, 0) -> (init, 0) -> (main, 0) -> (outf, 3) -> (GOROOT, 0) -> (IsUpper, 1) -> (Gather, 0)
(UpsertUser, 2) -> (Insert, 1) -> (first, 0) -> (init, 0) -> (, 0) -> (Suite, 1) -> (receiveMessage, 1) -> (IsNetworkError, 1) -> (dial, 0) -> (MasterAddr, 0) -> (setSentinel, 1)
(UpsertUser, 2) -> (Insert, 1) -> (first, 0) -> (init, 0)
(UpsertUser, 2) -> (Insert, 1) -> (first, 0) -> (init, 0) -> (Find, 0) -> (StorePointer, 2) -> (getprocaddress, 2) -> (ByteSliceFromString, 1)
(UpsertUser, 2) -> (Insert, 1) -> (first, 0) -> (init, 0) -> (newSyslogger, 3) -> (New, 2) -> (gate, 1) -> (Deserialize, 2) -> (Continue, 0)
(UpsertUser, 2) -> (Insert, 1) -> (insert, 3) -> (PostInsert, 1) -> (String, 0) -> (ToJSON, 0) -> (relString, 2)
(UpsertUser, 2) -> (Debugf, 2) -> (Printf, 2) -> (Prefix, 0) -> (New, 1)
(UpsertUser, 2) -> (Insert, 1) -> (first, 0) -> (init, 0) -> (main, 0) -> (outf, 3) -> (GOROOT, 0) -> (IsUpper, 1) -> (LoadBinaryInfoMacho, 2)
(UpsertUser, 2) -> (Insert, 1) -> (first, 0) -> (init, 0) -> (, 0) -> (Suite, 1) -> (receiveMessage, 1) -> (IsNetworkError, 1)
(UpsertUser, 2) -> (Insert, 1) -> (first, 0) -> (init, 0) -> (New, 2) -> (Sort, 1) -> (Deserialize, 2) -> (NewConn, 0) -> (newConn, 1)
(UpsertUser, 2) -> (Insert, 1) -> (compress, 0) -> (copy, 2) -> (Open, 1) -> (Open, 0) -> (Split, 1) -> (lookupLocal, 1) -> (Prepare, 1) -> (gname, 0)
(UpsertUser, 2) -> (execTx, 3) -> (exec, 1) -> (postExecuteWorkaround, 0) -> (New, 1) -> (make, 2) -> (Debugf, 4)
(UpsertUser, 2) -> (Insert, 1) -> (first, 0) -> (init, 0) -> (Unmarshal, 2) -> (unmarshal, 3) -> (newDecoder, 1) -> (Palette, 1) -> (prepareCopyIn, 1)
(UpsertUser, 2) -> (Insert, 1) -> (first, 0) -> (init, 0) -> (newSyslogger, 3) -> (New, 2) -> (gate, 1) -> (Deserialize, 2) -> (LoadBinaryInfoElf, 2)
(UpsertUser, 2) -> (Insert, 1) -> (first, 0) -> (init, 0) -> (f, 2)
(UpsertUser, 2) -> (Insert, 1) -> (first, 0) -> (init, 0) -> (, 0) -> (Suite, 1)
(UpsertUser, 2) -> (Debugf, 2) -> (Printf, 2) -> (Prefix, 0) -> (String, 0) -> (ToJSON, 0) -> (relString, 2)
(UpsertUser, 2) -> (Insert, 1) -> (first, 0) -> (init, 0) -> (main, 0) -> (outf, 3) -> (GOROOT, 0) -> (IsUpper, 1) -> (callSSA, 6) -> (runFrame, 1) -> (visitInstr, 2) -> (typeAssert, 3)
(UpsertUser, 2) -> (Insert, 1) -> (first, 0) -> (init, 0) -> (New, 1)
(UpsertUser, 2) -> (Insert, 1) -> (first, 0) -> (init, 0) -> (main, 0) -> (outf, 3) -> (GOROOT, 0) -> (IsUpper, 1)
(UpsertUser, 2) -> (Insert, 1) -> (first, 0) -> (init, 0) -> (Register, 1) -> (HandleFunc, 2) -> (Path, 1) -> (Join, 1) -> (newConn, 1)
(UpsertUser, 2) -> (Debugf, 2) -> (Printf, 2) -> (Prefix, 0) -> (New, 1) -> (make, 2) -> (Debugf, 4) -> (Debugf, 4) -> (dial, 0) -> (MasterAddr, 0) -> (setSentinel, 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: 0c5a7d22dc61b5bddb6d722ef8d56c2bdd1d571c

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.