shhgit icon indicating copy to clipboard operation
shhgit copied to clipboard

using --local and --csv-path leads to deadlock

Open tpcgold opened this issue 4 years ago • 2 comments

Following command: shhgit --config-path "G:\My Drive\Repositories\shhgit" --local "G:\My Drive\Repositories" --csv-path "G:\My Drive\Repositories"

leads to a deadlock, without using the "CSV export" it's working. (The error occurs no matter where csv-path is located)

fatal error: all goroutines are asleep - deadlock!

goroutine 1 [semacquire, locked to thread]:
sync.runtime_SemacquireMutex(0x140a438, 0x0, 0x1)
        c:/go/src/runtime/sema.go:71 +0x4e
sync.(*Mutex).lockSlow(0x140a434)
        c:/go/src/sync/mutex.go:138 +0x10f
sync.(*Mutex).Lock(...)
        c:/go/src/sync/mutex.go:81
sync.(*Once).doSlow(0x140a430, 0x1117320)
        c:/go/src/sync/once.go:62 +0x113
sync.(*Once).Do(...)
        c:/go/src/sync/once.go:57
github.com/eth0izzle/shhgit/core.GetSession(0x0)
        G:/My Drive/Repositories/shhgit/core/session.go:163 +0x65
github.com/eth0izzle/shhgit/core.LogIfError(0x11024a8, 0x1e, 0x117a100, 0xc0003b0120)
        G:/My Drive/Repositories/shhgit/core/util.go:39 +0x45
github.com/eth0izzle/shhgit/core.(*Session).InitCsvWriter(0xc0000cc5a0)
        G:/My Drive/Repositories/shhgit/core/session.go:144 +0xe5
github.com/eth0izzle/shhgit/core.(*Session).Start(0xc0000cc5a0)
        G:/My Drive/Repositories/shhgit/core/session.go:47 +0x126
github.com/eth0izzle/shhgit/core.GetSession.func1()
        G:/My Drive/Repositories/shhgit/core/session.go:181 +0x285
sync.(*Once).doSlow(0x140a430, 0x1117320)
        c:/go/src/sync/once.go:66 +0xf7
sync.(*Once).Do(...)
        c:/go/src/sync/once.go:57
github.com/eth0izzle/shhgit/core.GetSession(0x19)
        G:/My Drive/Repositories/shhgit/core/session.go:163 +0x65
main.init()
        G:/My Drive/Repositories/shhgit/main.go:27 +0x29

tpcgold avatar Nov 16 '20 07:11 tpcgold

Ay,

Did you try to change CSV path outside of the app path ?

Example :

shhgit --config-path "G:\My Drive\Repositories\shhgit" --local "G:\My Drive\Repositories" --csv-path "G:\My Drive\shhgitReports"

EDIT : nevermind, I didn't saw your message : "The error occurs no matter where csv-path is located", sorry. EDIT 2 : I tested with my Docker image and I got the same error here.

KrustyHack avatar Jan 05 '21 15:01 KrustyHack

i played around with it and tried to give it a file to name. it worked. you have to name the file to output it to. it doesnt output it to a directory with results for each individual repo scanned. my example: shhgit --config-path /opt/scripts/ --local /opt/test/ --csv-path /opt/results/stuff

dshockley-hippo avatar Aug 31 '21 21:08 dshockley-hippo