Open rgmz opened 4 months ago
FWIW, I was able to eliminate all races by doing the following:
engine.go
go-re2
in favour of the stdlib's regex
packageCloned data passed to the EscapedUnicode
decoder
diff --git a/pkg/decoders/escaped_unicode.go b/pkg/decoders/escaped_unicode.go
--- a/pkg/decoders/escaped_unicode.go
+++ b/pkg/decoders/escaped_unicode.go
@@ -1,6 +1,7 @@
package decoders
import (
+ "bytes"
"regexp"
"strconv"
"unicode/utf8"
@@ -30,19 +31,29 @@ func (d *EscapedUnicode) FromChunk(chunk *sources.Chunk) *DecodableChunk {
}
matched := false
- if codePointPat.Match(chunk.Data) {
+ chunkData := bytes.Clone(chunk.Data)
+ if codePointPat.Match(chunkData) {
matched = true
- chunk.Data = decodeCodePoint(chunk.Data)
+ chunkData = decodeCodePoint(chunkData)
}
if escapePat.Match(chunk.Data) {
matched = true
- chunk.Data = decodeEscaped(chunk.Data)
+ chunkData = decodeEscaped(chunkData)
}
if matched {
decodableChunk := &DecodableChunk{
DecoderType: detectorspb.DecoderType_ESCAPED_UNICODE,
- Chunk: chunk,
+ Chunk: &sources.Chunk{
+ Data: chunkData,
+ SourceName: chunk.SourceName,
+ SourceID: chunk.SourceID,
+ JobID: chunk.JobID,
+ SecretID: chunk.SecretID,
+ SourceMetadata: chunk.SourceMetadata,
+ SourceType: chunk.SourceType,
+ Verify: chunk.Verify,
+ },
}
return decodableChunk
} else {
caflou
and ldap
to avoid touching global variables inside the FromData()
flow
diff --git a/pkg/detectors/ldap/ldap.go b/pkg/detectors/ldap/ldap.go
--- a/pkg/detectors/ldap/ldap.go
+++ b/pkg/detectors/ldap/ldap.go
@@ -6,23 +6,27 @@ import (
+func init() {
+ ldap.DefaultTimeout = 5 * time.Second
+}
+
var (
// Make sure that your group is surrounded in boundary characters such as below to reduce false positives.
uriPat = regexp.MustCompile(`\b(?i)ldaps?://[\S]+\b`)
@@ -127,8 +131,6 @@ func isErrDeterminate(err error) bool {
func verifyLDAP(username, password string, ldapURL *url.URL) error {
// Tests with non-TLS, TLS, and STARTTLS
uri := ldapURL.String()
switch ldapURL.Scheme {
diff --git a/pkg/detectors/caflou/caflou.go b/pkg/detectors/caflou/caflou.go --- a/pkg/detectors/caflou/caflou.go +++ b/pkg/detectors/caflou/caflou.go @@ -13,14 +13,14 @@ import ( "github.com/trufflesecurity/trufflehog/v3/pkg/pb/detectorspb" )
-type Scanner struct{} +type Scanner struct {
client *http.Client +}
// Ensure the Scanner satisfies the interface at compile time. var _ detectors.Detector = (*Scanner)(nil)
var (
// Make sure that your group is surrounded in boundary characters such as below to reduce false positives.
keyPat = regexp.MustCompile(detectors.PrefixRegex([]string{"caflou"}) + `\b([a-bA-Z0-9\S]{155})\b`)
) @@ -49,8 +49,12 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result }
if verify {
req, err := http.NewRequestWithContext(ctx, "GET", "https://app.caflou.com/api/v1/accounts", nil)
if err != nil {
continue
Obviously, #2 is probably the most ??? issue.
Another one:
==================
WARNING: DATA RACE
Write at 0x00c0058cf208 by goroutine 22192:
github.com/trufflesecurity/trufflehog/v3/pkg/sources/github.(*Source).setScanOptions()
/home/user/dev/github.com/trufflesecurity/thog2/pkg/sources/github/github.go:104 +0xe4
github.com/trufflesecurity/trufflehog/v3/pkg/sources/github.(*Source).cloneAndScanRepo()
/home/user/dev/github.com/trufflesecurity/thog2/pkg/sources/github/github.go:841 +0x7c4
github.com/trufflesecurity/trufflehog/v3/pkg/sources/github.(*Source).scan.func1()
/home/user/dev/github.com/trufflesecurity/thog2/pkg/sources/github/github.go:751 +0x42b
golang.org/x/sync/errgroup.(*Group).Go.func1()
/home/user/go/pkg/mod/golang.org/x/sync@v0.7.0/errgroup/errgroup.go:78 +0x91
Previous read at 0x00c0058cf208 by goroutine 17836:
github.com/trufflesecurity/trufflehog/v3/pkg/sources/git.(*Git).ScanStaged()
/home/user/dev/github.com/trufflesecurity/thog2/pkg/sources/git/git.go:850 +0x219
github.com/trufflesecurity/trufflehog/v3/pkg/sources/git.(*Git).ScanRepo()
/home/user/dev/github.com/trufflesecurity/thog2/pkg/sources/git/git.go:979 +0x1f6
github.com/trufflesecurity/trufflehog/v3/pkg/sources/github.(*Source).cloneAndScanRepo()
/home/user/dev/github.com/trufflesecurity/thog2/pkg/sources/github/github.go:844 +0x865
github.com/trufflesecurity/trufflehog/v3/pkg/sources/github.(*Source).scan.func1()
/home/user/dev/github.com/trufflesecurity/thog2/pkg/sources/github/github.go:751 +0x42b
golang.org/x/sync/errgroup.(*Group).Go.func1()
/home/user/go/pkg/mod/golang.org/x/sync@v0.7.0/errgroup/errgroup.go:78 +0x91
Goroutine 22192 (running) created at:
golang.org/x/sync/errgroup.(*Group).Go()
/home/user/go/pkg/mod/golang.org/x/sync@v0.7.0/errgroup/errgroup.go:75 +0x124
github.com/trufflesecurity/trufflehog/v3/pkg/sources/github.(*Source).scan()
/home/user/dev/github.com/trufflesecurity/thog2/pkg/sources/github/github.go:723 +0x508
github.com/trufflesecurity/trufflehog/v3/pkg/sources/github.(*Source).Chunks()
/home/user/dev/github.com/trufflesecurity/thog2/pkg/sources/github/github.go:386 +0x44a
github.com/trufflesecurity/trufflehog/v3/pkg/sources.(*SourceManager).runWithoutUnits()
/home/user/dev/github.com/trufflesecurity/thog2/pkg/sources/source_manager.go:311 +0x39d
github.com/trufflesecurity/trufflehog/v3/pkg/sources.(*SourceManager).run()
/home/user/dev/github.com/trufflesecurity/thog2/pkg/sources/source_manager.go:286 +0xa44
github.com/trufflesecurity/trufflehog/v3/pkg/sources.(*SourceManager).Run.func1()
/home/user/dev/github.com/trufflesecurity/thog2/pkg/sources/source_manager.go:162 +0x41a
Goroutine 17836 (running) created at:
golang.org/x/sync/errgroup.(*Group).Go()
/home/user/go/pkg/mod/golang.org/x/sync@v0.7.0/errgroup/errgroup.go:75 +0x124
github.com/trufflesecurity/trufflehog/v3/pkg/sources/github.(*Source).scan()
/home/user/dev/github.com/trufflesecurity/thog2/pkg/sources/github/github.go:723 +0x508
github.com/trufflesecurity/trufflehog/v3/pkg/sources/github.(*Source).Chunks()
/home/user/dev/github.com/trufflesecurity/thog2/pkg/sources/github/github.go:386 +0x44a
github.com/trufflesecurity/trufflehog/v3/pkg/sources.(*SourceManager).runWithoutUnits()
/home/user/dev/github.com/trufflesecurity/thog2/pkg/sources/source_manager.go:311 +0x39d
github.com/trufflesecurity/trufflehog/v3/pkg/sources.(*SourceManager).run()
/home/user/dev/github.com/trufflesecurity/thog2/pkg/sources/source_manager.go:286 +0xa44
github.com/trufflesecurity/trufflehog/v3/pkg/sources.(*SourceManager).Run.func1()
/home/user/dev/github.com/trufflesecurity/thog2/pkg/sources/source_manager.go:162 +0x41a
==================
==================
WARNING: DATA RACE
Write at 0x00c0058cf218 by goroutine 22192:
github.com/trufflesecurity/trufflehog/v3/pkg/sources/github.(*Source).setScanOptions()
/home/user/dev/github.com/trufflesecurity/thog2/pkg/sources/github/github.go:105 +0x147
github.com/trufflesecurity/trufflehog/v3/pkg/sources/github.(*Source).cloneAndScanRepo()
/home/user/dev/github.com/trufflesecurity/thog2/pkg/sources/github/github.go:841 +0x7c4
github.com/trufflesecurity/trufflehog/v3/pkg/sources/github.(*Source).scan.func1()
/home/user/dev/github.com/trufflesecurity/thog2/pkg/sources/github/github.go:751 +0x42b
golang.org/x/sync/errgroup.(*Group).Go.func1()
/home/user/go/pkg/mod/golang.org/x/sync@v0.7.0/errgroup/errgroup.go:78 +0x91
Previous read at 0x00c0058cf218 by goroutine 17836:
github.com/trufflesecurity/trufflehog/v3/pkg/sources/git.(*Git).ScanStaged()
/home/user/dev/github.com/trufflesecurity/thog2/pkg/sources/git/git.go:853 +0x390
github.com/trufflesecurity/trufflehog/v3/pkg/sources/git.(*Git).ScanRepo()
/home/user/dev/github.com/trufflesecurity/thog2/pkg/sources/git/git.go:979 +0x1f6
github.com/trufflesecurity/trufflehog/v3/pkg/sources/github.(*Source).cloneAndScanRepo()
/home/user/dev/github.com/trufflesecurity/thog2/pkg/sources/github/github.go:844 +0x865
github.com/trufflesecurity/trufflehog/v3/pkg/sources/github.(*Source).scan.func1()
/home/user/dev/github.com/trufflesecurity/thog2/pkg/sources/github/github.go:751 +0x42b
golang.org/x/sync/errgroup.(*Group).Go.func1()
/home/user/go/pkg/mod/golang.org/x/sync@v0.7.0/errgroup/errgroup.go:78 +0x91
Goroutine 22192 (running) created at:
golang.org/x/sync/errgroup.(*Group).Go()
/home/user/go/pkg/mod/golang.org/x/sync@v0.7.0/errgroup/errgroup.go:75 +0x124
github.com/trufflesecurity/trufflehog/v3/pkg/sources/github.(*Source).scan()
/home/user/dev/github.com/trufflesecurity/thog2/pkg/sources/github/github.go:723 +0x508
github.com/trufflesecurity/trufflehog/v3/pkg/sources/github.(*Source).Chunks()
/home/user/dev/github.com/trufflesecurity/thog2/pkg/sources/github/github.go:386 +0x44a
github.com/trufflesecurity/trufflehog/v3/pkg/sources.(*SourceManager).runWithoutUnits()
/home/user/dev/github.com/trufflesecurity/thog2/pkg/sources/source_manager.go:311 +0x39d
github.com/trufflesecurity/trufflehog/v3/pkg/sources.(*SourceManager).run()
/home/user/dev/github.com/trufflesecurity/thog2/pkg/sources/source_manager.go:286 +0xa44
github.com/trufflesecurity/trufflehog/v3/pkg/sources.(*SourceManager).Run.func1()
/home/user/dev/github.com/trufflesecurity/thog2/pkg/sources/source_manager.go:162 +0x41a
Goroutine 17836 (running) created at:
golang.org/x/sync/errgroup.(*Group).Go()
/home/user/go/pkg/mod/golang.org/x/sync@v0.7.0/errgroup/errgroup.go:75 +0x124
github.com/trufflesecurity/trufflehog/v3/pkg/sources/github.(*Source).scan()
/home/user/dev/github.com/trufflesecurity/thog2/pkg/sources/github/github.go:723 +0x508
github.com/trufflesecurity/trufflehog/v3/pkg/sources/github.(*Source).Chunks()
/home/user/dev/github.com/trufflesecurity/thog2/pkg/sources/github/github.go:386 +0x44a
github.com/trufflesecurity/trufflehog/v3/pkg/sources.(*SourceManager).runWithoutUnits()
/home/user/dev/github.com/trufflesecurity/thog2/pkg/sources/source_manager.go:311 +0x39d
github.com/trufflesecurity/trufflehog/v3/pkg/sources.(*SourceManager).run()
/home/user/dev/github.com/trufflesecurity/thog2/pkg/sources/source_manager.go:286 +0xa44
github.com/trufflesecurity/trufflehog/v3/pkg/sources.(*SourceManager).Run.func1()
/home/user/dev/github.com/trufflesecurity/thog2/pkg/sources/source_manager.go:162 +0x41a
==================
Another one. This seems to occur when there's a nested archive that takes a while to read.
==================
WARNING: DATA RACE
Write at 0x00c0044321d0 by goroutine 162778:
github.com/trufflesecurity/trufflehog/v3/pkg/buffers/buffer.(*readCloser).Close()
/home/user/dev/github.com/trufflesecurity/thog2/pkg/buffers/buffer/buffer.go:93 +0x6b
github.com/trufflesecurity/trufflehog/v3/pkg/readers.(*BufferedFileReader).Close()
/home/user/dev/github.com/trufflesecurity/thog2/pkg/readers/bufferedfilereader.go:50 +0x42
github.com/trufflesecurity/trufflehog/v3/pkg/handlers.(*archiveHandler).openArchive.(*archiveHandler).extractorHandler.func1.deferwrap2()
/home/user/dev/github.com/trufflesecurity/thog2/pkg/handlers/archive.go:196 +0x33
runtime.deferreturn()
/home/user/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.22.2.linux-amd64/src/runtime/panic.go:602 +0x5d
github.com/mholt/archiver/v4.Zip.Extract()
/home/user/go/pkg/mod/github.com/mholt/archiver/v4@v4.0.0-alpha.8.0.20240408183022-de08bfa4c558/zip.go:226 +0x58a
github.com/mholt/archiver/v4.(*Zip).Extract()
<autogenerated>:1 +0xf7
github.com/trufflesecurity/trufflehog/v3/pkg/handlers.(*archiveHandler).openArchive()
/home/user/dev/github.com/trufflesecurity/thog2/pkg/handlers/archive.go:116 +0x5c5
github.com/trufflesecurity/trufflehog/v3/pkg/handlers.(*archiveHandler).HandleFile.func1()
/home/user/dev/github.com/trufflesecurity/thog2/pkg/handlers/archive.go:66 +0x29e
Previous read at 0x00c0044321d0 by goroutine 163765:
github.com/trufflesecurity/trufflehog/v3/pkg/buffers/buffer.(*readCloser).Read()
/home/user/dev/github.com/trufflesecurity/thog2/pkg/buffers/buffer/buffer.go:102 +0x44
github.com/trufflesecurity/trufflehog/v3/pkg/readers.(*BufferedFileReader).Read()
/home/user/dev/github.com/trufflesecurity/thog2/pkg/readers/bufferedfilereader.go:56 +0x69
bufio.(*Reader).Read()
/home/user/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.22.2.linux-amd64/src/bufio/bufio.go:227 +0x2ab
bufio.(*Reader).fill()
/home/user/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.22.2.linux-amd64/src/bufio/bufio.go:110 +0x2af
bufio.(*Reader).Peek()
/home/user/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.22.2.linux-amd64/src/bufio/bufio.go:148 +0xc6
github.com/trufflesecurity/trufflehog/v3/pkg/sources.readInChunks.func1()
/home/user/dev/github.com/trufflesecurity/thog2/pkg/sources/chunker.go:140 +0x21d
Goroutine 162778 (running) created at:
github.com/trufflesecurity/trufflehog/v3/pkg/handlers.(*archiveHandler).HandleFile()
/home/user/dev/github.com/trufflesecurity/thog2/pkg/handlers/archive.go:53 +0x1a4
github.com/trufflesecurity/trufflehog/v3/pkg/handlers.HandleFile()
/home/user/dev/github.com/trufflesecurity/thog2/pkg/handlers/handlers.go:197 +0x68f
github.com/trufflesecurity/trufflehog/v3/pkg/sources/git.(*Git).handleBinary()
/home/user/dev/github.com/trufflesecurity/thog2/pkg/sources/git/git.go:1305 +0x1014
github.com/trufflesecurity/trufflehog/v3/pkg/sources/git.(*Git).ScanCommits()
/home/user/dev/github.com/trufflesecurity/thog2/pkg/sources/git/git.go:694 +0x163d
github.com/trufflesecurity/trufflehog/v3/pkg/sources/git.(*Git).ScanRepo()
/home/user/dev/github.com/trufflesecurity/thog2/pkg/sources/git/git.go:975 +0x17e
github.com/trufflesecurity/trufflehog/v3/pkg/sources/github.(*Source).cloneAndScanRepo()
/home/user/dev/github.com/trufflesecurity/thog2/pkg/sources/github/github.go:844 +0x865
github.com/trufflesecurity/trufflehog/v3/pkg/sources/github.(*Source).scan.func1()
/home/user/dev/github.com/trufflesecurity/thog2/pkg/sources/github/github.go:751 +0x42b
golang.org/x/sync/errgroup.(*Group).Go.func1()
/home/user/go/pkg/mod/golang.org/x/sync@v0.7.0/errgroup/errgroup.go:78 +0x91
Goroutine 163765 (finished) created at:
github.com/trufflesecurity/trufflehog/v3/pkg/sources.readInChunks()
/home/user/dev/github.com/trufflesecurity/thog2/pkg/sources/chunker.go:131 +0x332
github.com/trufflesecurity/trufflehog/v3/pkg/sources.NewChunkReader.createReaderFn.func1()
/home/user/dev/github.com/trufflesecurity/thog2/pkg/sources/chunker.go:122 +0x52
github.com/trufflesecurity/trufflehog/v3/pkg/handlers.(*defaultHandler).handleNonArchiveContent()
/home/user/dev/github.com/trufflesecurity/thog2/pkg/handlers/default.go:98 +0x352
github.com/trufflesecurity/trufflehog/v3/pkg/handlers.(*archiveHandler).openArchive()
/home/user/dev/github.com/trufflesecurity/thog2/pkg/handlers/archive.go:92 +0x15b
github.com/trufflesecurity/trufflehog/v3/pkg/handlers.(*archiveHandler).openArchive.(*archiveHandler).extractorHandler.func1()
/home/user/dev/github.com/trufflesecurity/thog2/pkg/handlers/archive.go:201 +0xc51
github.com/mholt/archiver/v4.Zip.Extract()
/home/user/go/pkg/mod/github.com/mholt/archiver/v4@v4.0.0-alpha.8.0.20240408183022-de08bfa4c558/zip.go:226 +0x58a
github.com/mholt/archiver/v4.(*Zip).Extract()
<autogenerated>:1 +0xf7
github.com/trufflesecurity/trufflehog/v3/pkg/handlers.(*archiveHandler).openArchive()
/home/user/dev/github.com/trufflesecurity/thog2/pkg/handlers/archive.go:116 +0x5c5
github.com/trufflesecurity/trufflehog/v3/pkg/handlers.(*archiveHandler).HandleFile.func1()
/home/user/dev/github.com/trufflesecurity/thog2/pkg/handlers/archive.go:66 +0x29e
==================
hi @rgmz , i was wondering if you're encountered this error while running go build -race
on this repo before
# github.com/trufflesecurity/trufflehog/v3
ld: warning: '/private/var/folders/zp/f2pjs1x57rg0hqy5cf2ffvqr0000gq/T/go-link-1268426122/000060.o' has malformed LC_DYSYMTAB, expected 98 undefined symbols to start at index 1626, found 95 undefined symbols starting at index 1626
No. That seems to be a warning but nothing serious, per https://github.com/golang/go/issues/61229.
Please review the Community Note before submitting
TruffleHog Version
HEAD
Steps to Reproduce
git clone https://github.com/trufflesecurity/trufflehog.git
go build -race
./trufflehog github --repo="https://github.com/trufflesecurity/trufflehog.git" --only-verified
Description
Go reports 2084 data races in this particular instance. I've grouped and condensed a few of the main causes into
<details>
blocks for the sake of legibility, however, this may not tell the entire picture.1. overseer / main.go (click here to expand)
``` ================== WARNING: DATA RACE Read at 0x00c000f46900 by goroutine 80: github.com/jpillora/overseer.(*parent).handleSignal() /home/user/go/pkg/mod/github.com/trufflesecurity/overseer@v1.2.7/proc_parent.go:135 +0x1da github.com/jpillora/overseer.(*parent).setupSignalling.func1() /home/user/go/pkg/mod/github.com/trufflesecurity/overseer@v1.2.7/proc_parent.go:113 +0x4b Previous write at 0x00c000f46900 by main goroutine: github.com/jpillora/overseer.(*parent).fork() /home/user/go/pkg/mod/github.com/trufflesecurity/overseer@v1.2.7/proc_parent.go:367 +0x111 github.com/jpillora/overseer.(*parent).forkLoop() /home/user/go/pkg/mod/github.com/trufflesecurity/overseer@v1.2.7/proc_parent.go:356 +0x329 github.com/jpillora/overseer.(*parent).run() /home/user/go/pkg/mod/github.com/trufflesecurity/overseer@v1.2.7/proc_parent.go:65 +0x339 github.com/jpillora/overseer.runErr() /home/user/go/pkg/mod/github.com/trufflesecurity/overseer@v1.2.7/overseer.go:164 +0x278 github.com/jpillora/overseer.RunErr() /home/user/go/pkg/mod/github.com/trufflesecurity/overseer@v1.2.7/overseer.go:94 +0x5a4 main.main() /tmp/t2/main.go:294 +0x52c Goroutine 80 (running) created at: github.com/jpillora/overseer.(*parent).setupSignalling() /home/user/go/pkg/mod/github.com/trufflesecurity/overseer@v1.2.7/proc_parent.go:111 +0x1b0 github.com/jpillora/overseer.(*parent).run() /home/user/go/pkg/mod/github.com/trufflesecurity/overseer@v1.2.7/proc_parent.go:56 +0x1e4 github.com/jpillora/overseer.runErr() /home/user/go/pkg/mod/github.com/trufflesecurity/overseer@v1.2.7/overseer.go:164 +0x278 github.com/jpillora/overseer.RunErr() /home/user/go/pkg/mod/github.com/trufflesecurity/overseer@v1.2.7/overseer.go:94 +0x5a4 main.main() /tmp/t2/main.go:294 +0x52c ================== ================== WARNING: DATA RACE Read at 0x00c0000176a0 by goroutine 80: github.com/jpillora/overseer.(*parent).handleSignal() /home/user/go/pkg/mod/github.com/trufflesecurity/overseer@v1.2.7/proc_parent.go:135 +0x21a github.com/jpillora/overseer.(*parent).setupSignalling.func1() /home/user/go/pkg/mod/github.com/trufflesecurity/overseer@v1.2.7/proc_parent.go:113 +0x4b Previous write at 0x00c0000176a0 by main goroutine: os/exec.Command() /home/user/sdk/go1.22.1/src/os/exec/exec.go:377 +0x145 github.com/jpillora/overseer.(*parent).fork() /home/user/go/pkg/mod/github.com/trufflesecurity/overseer@v1.2.7/proc_parent.go:364 +0xf5 github.com/jpillora/overseer.(*parent).forkLoop() /home/user/go/pkg/mod/github.com/trufflesecurity/overseer@v1.2.7/proc_parent.go:356 +0x329 github.com/jpillora/overseer.(*parent).run() /home/user/go/pkg/mod/github.com/trufflesecurity/overseer@v1.2.7/proc_parent.go:65 +0x339 github.com/jpillora/overseer.runErr() /home/user/go/pkg/mod/github.com/trufflesecurity/overseer@v1.2.7/overseer.go:164 +0x278 github.com/jpillora/overseer.RunErr() /home/user/go/pkg/mod/github.com/trufflesecurity/overseer@v1.2.7/overseer.go:94 +0x5a4 main.main() /tmp/t2/main.go:294 +0x52c Goroutine 80 (running) created at: github.com/jpillora/overseer.(*parent).setupSignalling() /home/user/go/pkg/mod/github.com/trufflesecurity/overseer@v1.2.7/proc_parent.go:111 +0x1b0 github.com/jpillora/overseer.(*parent).run() /home/user/go/pkg/mod/github.com/trufflesecurity/overseer@v1.2.7/proc_parent.go:56 +0x1e4 github.com/jpillora/overseer.runErr() /home/user/go/pkg/mod/github.com/trufflesecurity/overseer@v1.2.7/overseer.go:164 +0x278 github.com/jpillora/overseer.RunErr() /home/user/go/pkg/mod/github.com/trufflesecurity/overseer@v1.2.7/overseer.go:94 +0x5a4 main.main() /tmp/t2/main.go:294 +0x52c ================== ================== WARNING: DATA RACE Read at 0x00c001929ad0 by goroutine 80: os.(*Process).signal() /home/user/sdk/go1.22.1/src/os/exec_unix.go:61 +0x53 os.(*Process).Signal() /home/user/sdk/go1.22.1/src/os/exec.go:140 +0x107 github.com/jpillora/overseer.(*parent).sendSignal() /home/user/go/pkg/mod/github.com/trufflesecurity/overseer@v1.2.7/proc_parent.go:161 +0xa8 github.com/jpillora/overseer.(*parent).handleSignal() /home/user/go/pkg/mod/github.com/trufflesecurity/overseer@v1.2.7/proc_parent.go:144 +0x3a4 github.com/jpillora/overseer.(*parent).setupSignalling.func1() /home/user/go/pkg/mod/github.com/trufflesecurity/overseer@v1.2.7/proc_parent.go:113 +0x4b Previous write at 0x00c001929ad0 by main goroutine: os.newProcess() /home/user/sdk/go1.22.1/src/os/exec.go:29 +0x729 os.startProcess() /home/user/sdk/go1.22.1/src/os/exec_posix.go:63 +0x78f os.StartProcess() /home/user/sdk/go1.22.1/src/os/exec.go:111 +0x71 os/exec.(*Cmd).Start() /home/user/sdk/go1.22.1/src/os/exec/exec.go:700 +0xac4 github.com/jpillora/overseer.(*parent).fork() /home/user/go/pkg/mod/github.com/trufflesecurity/overseer@v1.2.7/proc_parent.go:384 +0xb5e github.com/jpillora/overseer.(*parent).forkLoop() /home/user/go/pkg/mod/github.com/trufflesecurity/overseer@v1.2.7/proc_parent.go:356 +0x329 github.com/jpillora/overseer.(*parent).run() /home/user/go/pkg/mod/github.com/trufflesecurity/overseer@v1.2.7/proc_parent.go:65 +0x339 github.com/jpillora/overseer.runErr() /home/user/go/pkg/mod/github.com/trufflesecurity/overseer@v1.2.7/overseer.go:164 +0x278 github.com/jpillora/overseer.RunErr() /home/user/go/pkg/mod/github.com/trufflesecurity/overseer@v1.2.7/overseer.go:94 +0x5a4 main.main() /tmp/t2/main.go:294 +0x52c Goroutine 80 (running) created at: github.com/jpillora/overseer.(*parent).setupSignalling() /home/user/go/pkg/mod/github.com/trufflesecurity/overseer@v1.2.7/proc_parent.go:111 +0x1b0 github.com/jpillora/overseer.(*parent).run() /home/user/go/pkg/mod/github.com/trufflesecurity/overseer@v1.2.7/proc_parent.go:56 +0x1e4 github.com/jpillora/overseer.runErr() /home/user/go/pkg/mod/github.com/trufflesecurity/overseer@v1.2.7/overseer.go:164 +0x278 github.com/jpillora/overseer.RunErr() /home/user/go/pkg/mod/github.com/trufflesecurity/overseer@v1.2.7/overseer.go:94 +0x5a4 main.main() /tmp/t2/main.go:294 +0x52c ================== ================== WARNING: DATA RACE Read at 0x00c001929ae0 by goroutine 80: sync/atomic.LoadInt32() /home/user/sdk/go1.22.1/src/runtime/race_amd64.s:202 +0xb sync/atomic.LoadUint32()2. go-re2 (click here to expand)
``` ================== WARNING: DATA RACE Read at 0x00c000ad4660 by goroutine 1107: github.com/wasilibs/go-re2/internal/alloc.(*mmappedMemory).Reallocate() /home/user/go/pkg/mod/github.com/wasilibs/go-re2@v1.5.3/internal/alloc/alloc.go:74 +0x31 github.com/tetratelabs/wazero/internal/wasm.(*MemoryInstance).Grow() /home/user/go/pkg/mod/github.com/tetratelabs/wazero@v1.7.1/internal/wasm/memory.go:236 +0x112 github.com/tetratelabs/wazero/internal/engine/wazevo.(*callEngine).callWithStack() /home/user/go/pkg/mod/github.com/tetratelabs/wazero@v1.7.1/internal/engine/wazevo/call_engine.go:309 +0x904 github.com/tetratelabs/wazero/internal/engine/wazevo.(*callEngine).CallWithStack() /home/user/go/pkg/mod/github.com/tetratelabs/wazero@v1.7.1/internal/engine/wazevo/call_engine.go:192 +0x16e github.com/wasilibs/go-re2/internal.(*lazyFunction).callWithStack() /home/user/go/pkg/mod/github.com/wasilibs/go-re2@v1.5.3/internal/re2_wazero.go:674 +0x2a9 github.com/wasilibs/go-re2/internal.(*lazyFunction).Call1() /home/user/go/pkg/mod/github.com/wasilibs/go-re2@v1.5.3/internal/re2_wazero.go:633 +0x84 github.com/wasilibs/go-re2/internal.malloc() /home/user/go/pkg/mod/github.com/wasilibs/go-re2@v1.5.3/internal/re2_wazero.go:508 +0x4a github.com/wasilibs/go-re2/internal.(*libre2ABI).reserve() /home/user/go/pkg/mod/github.com/wasilibs/go-re2@v1.5.3/internal/re2_wazero.go:529 +0xce github.com/wasilibs/go-re2/internal.(*libre2ABI).startOperation() /home/user/go/pkg/mod/github.com/wasilibs/go-re2@v1.5.3/internal/re2_wazero.go:236 +0xbe github.com/wasilibs/go-re2/internal.(*Regexp).FindAllStringSubmatch() /home/user/go/pkg/mod/github.com/wasilibs/go-re2@v1.5.3/internal/re2.go:439 +0x5f github.com/trufflesecurity/trufflehog/v3/pkg/detectors/github_oauth2.Scanner.FromData() /tmp/t2/pkg/detectors/github_oauth2/github_oauth2.go:45 +0x9d github.com/trufflesecurity/trufflehog/v3/pkg/detectors/github_oauth2.(*Scanner).FromData()3. decoder (click here to expand)
``` ================== WARNING: DATA RACE Read at 0x00c00c636158 by goroutine 2045: runtime.slicebytetostring() /home/user/sdk/go1.22.1/src/runtime/string.go:81 +0x0 github.com/trufflesecurity/trufflehog/v3/pkg/detectors/circleci.Scanner.FromData() /tmp/t2/pkg/detectors/circleci/circleci.go:31 +0x85 github.com/trufflesecurity/trufflehog/v3/pkg/detectors/circleci.(*Scanner).FromData()4. Detector(s) (click here to expand)
``` ================== WARNING: DATA RACE Write at 0x00000b058d90 by goroutine 756: github.com/trufflesecurity/trufflehog/v3/pkg/detectors/ldap.verifyLDAP() /tmp/t2/pkg/detectors/ldap/ldap.go:130 +0x66 github.com/trufflesecurity/trufflehog/v3/pkg/detectors/ldap.Scanner.FromData() /tmp/t2/pkg/detectors/ldap/ldap.go:71 +0xb2b github.com/trufflesecurity/trufflehog/v3/pkg/detectors/ldap.(*Scanner).FromData()GitHub setScanOptions (click here to expand)
``` ================== WARNING: DATA RACE Write at 0x00c0058cf208 by goroutine 22192: github.com/trufflesecurity/trufflehog/v3/pkg/sources/github.(*Source).setScanOptions() /home/user/dev/github.com/trufflesecurity/thog2/pkg/sources/github/github.go:104 +0xe4 github.com/trufflesecurity/trufflehog/v3/pkg/sources/github.(*Source).cloneAndScanRepo() /home/user/dev/github.com/trufflesecurity/thog2/pkg/sources/github/github.go:841 +0x7c4 github.com/trufflesecurity/trufflehog/v3/pkg/sources/github.(*Source).scan.func1() /home/user/dev/github.com/trufflesecurity/thog2/pkg/sources/github/github.go:751 +0x42b golang.org/x/sync/errgroup.(*Group).Go.func1() /home/user/go/pkg/mod/golang.org/x/sync@v0.7.0/errgroup/errgroup.go:78 +0x91 Previous read at 0x00c0058cf208 by goroutine 17836: github.com/trufflesecurity/trufflehog/v3/pkg/sources/git.(*Git).ScanStaged() /home/user/dev/github.com/trufflesecurity/thog2/pkg/sources/git/git.go:850 +0x219 github.com/trufflesecurity/trufflehog/v3/pkg/sources/git.(*Git).ScanRepo() /home/user/dev/github.com/trufflesecurity/thog2/pkg/sources/git/git.go:979 +0x1f6 github.com/trufflesecurity/trufflehog/v3/pkg/sources/github.(*Source).cloneAndScanRepo() /home/user/dev/github.com/trufflesecurity/thog2/pkg/sources/github/github.go:844 +0x865 github.com/trufflesecurity/trufflehog/v3/pkg/sources/github.(*Source).scan.func1() /home/user/dev/github.com/trufflesecurity/thog2/pkg/sources/github/github.go:751 +0x42b golang.org/x/sync/errgroup.(*Group).Go.func1() /home/user/go/pkg/mod/golang.org/x/sync@v0.7.0/errgroup/errgroup.go:78 +0x91 Goroutine 22192 (running) created at: golang.org/x/sync/errgroup.(*Group).Go() /home/user/go/pkg/mod/golang.org/x/sync@v0.7.0/errgroup/errgroup.go:75 +0x124 github.com/trufflesecurity/trufflehog/v3/pkg/sources/github.(*Source).scan() /home/user/dev/github.com/trufflesecurity/thog2/pkg/sources/github/github.go:723 +0x508 github.com/trufflesecurity/trufflehog/v3/pkg/sources/github.(*Source).Chunks() /home/user/dev/github.com/trufflesecurity/thog2/pkg/sources/github/github.go:386 +0x44a github.com/trufflesecurity/trufflehog/v3/pkg/sources.(*SourceManager).runWithoutUnits() /home/user/dev/github.com/trufflesecurity/thog2/pkg/sources/source_manager.go:311 +0x39d github.com/trufflesecurity/trufflehog/v3/pkg/sources.(*SourceManager).run() /home/user/dev/github.com/trufflesecurity/thog2/pkg/sources/source_manager.go:286 +0xa44 github.com/trufflesecurity/trufflehog/v3/pkg/sources.(*SourceManager).Run.func1() /home/user/dev/github.com/trufflesecurity/thog2/pkg/sources/source_manager.go:162 +0x41a Goroutine 17836 (running) created at: golang.org/x/sync/errgroup.(*Group).Go() /home/user/go/pkg/mod/golang.org/x/sync@v0.7.0/errgroup/errgroup.go:75 +0x124 github.com/trufflesecurity/trufflehog/v3/pkg/sources/github.(*Source).scan() /home/user/dev/github.com/trufflesecurity/thog2/pkg/sources/github/github.go:723 +0x508 github.com/trufflesecurity/trufflehog/v3/pkg/sources/github.(*Source).Chunks() /home/user/dev/github.com/trufflesecurity/thog2/pkg/sources/github/github.go:386 +0x44a github.com/trufflesecurity/trufflehog/v3/pkg/sources.(*SourceManager).runWithoutUnits() /home/user/dev/github.com/trufflesecurity/thog2/pkg/sources/source_manager.go:311 +0x39d github.com/trufflesecurity/trufflehog/v3/pkg/sources.(*SourceManager).run() /home/user/dev/github.com/trufflesecurity/thog2/pkg/sources/source_manager.go:286 +0xa44 github.com/trufflesecurity/trufflehog/v3/pkg/sources.(*SourceManager).Run.func1() /home/user/dev/github.com/trufflesecurity/thog2/pkg/sources/source_manager.go:162 +0x41a ================== ================== WARNING: DATA RACE Write at 0x00c0058cf218 by goroutine 22192: github.com/trufflesecurity/trufflehog/v3/pkg/sources/github.(*Source).setScanOptions() /home/user/dev/github.com/trufflesecurity/thog2/pkg/sources/github/github.go:105 +0x147 github.com/trufflesecurity/trufflehog/v3/pkg/sources/github.(*Source).cloneAndScanRepo() /home/user/dev/github.com/trufflesecurity/thog2/pkg/sources/github/github.go:841 +0x7c4 github.com/trufflesecurity/trufflehog/v3/pkg/sources/github.(*Source).scan.func1() /home/user/dev/github.com/trufflesecurity/thog2/pkg/sources/github/github.go:751 +0x42b golang.org/x/sync/errgroup.(*Group).Go.func1() /home/user/go/pkg/mod/golang.org/x/sync@v0.7.0/errgroup/errgroup.go:78 +0x91 Previous read at 0x00c0058cf218 by goroutine 17836: github.com/trufflesecurity/trufflehog/v3/pkg/sources/git.(*Git).ScanStaged() /home/user/dev/github.com/trufflesecurity/thog2/pkg/sources/git/git.go:853 +0x390 github.com/trufflesecurity/trufflehog/v3/pkg/sources/git.(*Git).ScanRepo() /home/user/dev/github.com/trufflesecurity/thog2/pkg/sources/git/git.go:979 +0x1f6 github.com/trufflesecurity/trufflehog/v3/pkg/sources/github.(*Source).cloneAndScanRepo() /home/user/dev/github.com/trufflesecurity/thog2/pkg/sources/github/github.go:844 +0x865 github.com/trufflesecurity/trufflehog/v3/pkg/sources/github.(*Source).scan.func1() /home/user/dev/github.com/trufflesecurity/thog2/pkg/sources/github/github.go:751 +0x42b golang.org/x/sync/errgroup.(*Group).Go.func1() /home/user/go/pkg/mod/golang.org/x/sync@v0.7.0/errgroup/errgroup.go:78 +0x91 Goroutine 22192 (running) created at: golang.org/x/sync/errgroup.(*Group).Go() /home/user/go/pkg/mod/golang.org/x/sync@v0.7.0/errgroup/errgroup.go:75 +0x124 github.com/trufflesecurity/trufflehog/v3/pkg/sources/github.(*Source).scan() /home/user/dev/github.com/trufflesecurity/thog2/pkg/sources/github/github.go:723 +0x508 github.com/trufflesecurity/trufflehog/v3/pkg/sources/github.(*Source).Chunks() /home/user/dev/github.com/trufflesecurity/thog2/pkg/sources/github/github.go:386 +0x44a github.com/trufflesecurity/trufflehog/v3/pkg/sources.(*SourceManager).runWithoutUnits() /home/user/dev/github.com/trufflesecurity/thog2/pkg/sources/source_manager.go:311 +0x39d github.com/trufflesecurity/trufflehog/v3/pkg/sources.(*SourceManager).run() /home/user/dev/github.com/trufflesecurity/thog2/pkg/sources/source_manager.go:286 +0xa44 github.com/trufflesecurity/trufflehog/v3/pkg/sources.(*SourceManager).Run.func1() /home/user/dev/github.com/trufflesecurity/thog2/pkg/sources/source_manager.go:162 +0x41a Goroutine 17836 (running) created at: golang.org/x/sync/errgroup.(*Group).Go() /home/user/go/pkg/mod/golang.org/x/sync@v0.7.0/errgroup/errgroup.go:75 +0x124 github.com/trufflesecurity/trufflehog/v3/pkg/sources/github.(*Source).scan() /home/user/dev/github.com/trufflesecurity/thog2/pkg/sources/github/github.go:723 +0x508 github.com/trufflesecurity/trufflehog/v3/pkg/sources/github.(*Source).Chunks() /home/user/dev/github.com/trufflesecurity/thog2/pkg/sources/github/github.go:386 +0x44a github.com/trufflesecurity/trufflehog/v3/pkg/sources.(*SourceManager).runWithoutUnits() /home/user/dev/github.com/trufflesecurity/thog2/pkg/sources/source_manager.go:311 +0x39d github.com/trufflesecurity/trufflehog/v3/pkg/sources.(*SourceManager).run() /home/user/dev/github.com/trufflesecurity/thog2/pkg/sources/source_manager.go:286 +0xa44 github.com/trufflesecurity/trufflehog/v3/pkg/sources.(*SourceManager).Run.func1() /home/user/dev/github.com/trufflesecurity/thog2/pkg/sources/source_manager.go:162 +0x41a ================== ```Handlers/BufferedFileReader (click here to expand)
``` ================== WARNING: DATA RACE Write at 0x00c0044321d0 by goroutine 162778: github.com/trufflesecurity/trufflehog/v3/pkg/buffers/buffer.(*readCloser).Close() /home/user/dev/github.com/trufflesecurity/thog2/pkg/buffers/buffer/buffer.go:93 +0x6b github.com/trufflesecurity/trufflehog/v3/pkg/readers.(*BufferedFileReader).Close() /home/user/dev/github.com/trufflesecurity/thog2/pkg/readers/bufferedfilereader.go:50 +0x42 github.com/trufflesecurity/trufflehog/v3/pkg/handlers.(*archiveHandler).openArchive.(*archiveHandler).extractorHandler.func1.deferwrap2() /home/user/dev/github.com/trufflesecurity/thog2/pkg/handlers/archive.go:196 +0x33 runtime.deferreturn() /home/user/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.22.2.linux-amd64/src/runtime/panic.go:602 +0x5d github.com/mholt/archiver/v4.Zip.Extract() /home/user/go/pkg/mod/github.com/mholt/archiver/v4@v4.0.0-alpha.8.0.20240408183022-de08bfa4c558/zip.go:226 +0x58a github.com/mholt/archiver/v4.(*Zip).Extract()