Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unreliable crash when using filesystem plugin with path #99

Closed
SHA65536 opened this issue Jun 21, 2023 · 0 comments · Fixed by #100
Closed

Unreliable crash when using filesystem plugin with path #99

SHA65536 opened this issue Jun 21, 2023 · 0 comments · Fixed by #100
Assignees
Labels
bug Something isn't working

Comments

@SHA65536
Copy link
Contributor

Description

When using 2ms filesystem --path somedir/ on a non empty dir, sometimes there's a crash (possible data-race).

Steps to reproduce

  1. Create a directory mkdir testdir
  2. Create a file in the dir echo "someinfo" > testdir/testfile.txt
  3. Run 2ms filesystem --path testdir

Expected Behavior

Expecting the command to succeed and report no secrets.

Current Behavior

Sometimes ( around 1 / 3 times ) the program panics with this error stack:

panic: sync: WaitGroup is reused before previous Wait has returned

goroutine 1 [running]:
sync.(*WaitGroup).Wait(0x0?)
	/usr/local/go/src/sync/waitgroup.go:118 +0x7f
github.com/checkmarx/2ms/cmd.postRun(0xc00012a600?, {0xa79f14?, 0x2?, 0x2?})
	/home/<redacted>/Downloads/2ms/cmd/main.go:171 +0x3a
github.com/spf13/cobra.(*Command).execute(0xc00012a600, {0xc0001242c0, 0x2, 0x2})
	/home/<redacted>/go/pkg/mod/github.com/spf13/[email protected]/command.go:936 +0xa2b
github.com/spf13/cobra.(*Command).ExecuteC(0xef3ce0)
	/home/<redacted>/go/pkg/mod/github.com/spf13/[email protected]/command.go:1044 +0x3bd
github.com/spf13/cobra.(*Command).Execute(...)
	/home/<redacted>/go/pkg/mod/github.com/spf13/[email protected]/command.go:968
github.com/checkmarx/2ms/cmd.Execute()
	/home/<redacted>/Downloads/2ms/cmd/main.go:107 +0x5e5
main.main()
	/home/<redacted>/Downloads/2ms/main.go:22 +0x1fa
exit status 2

I removed my information from the stack trace and replaced with

@baruchiro baruchiro added the bug Something isn't working label Jun 21, 2023
@baruchiro baruchiro self-assigned this Jun 21, 2023
baruchiro pushed a commit that referenced this issue Jun 21, 2023
jossef pushed a commit that referenced this issue Jun 22, 2023
<!-- 
Thanks for contributing to 2ms by offering a pull request.
Please add a "community" tag if you're an external contributor.
-->

Closes #99

I submit this contribution under the Apache-2.0 license.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants