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

delete zero bytes in a string #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

delete zero bytes in a string #1

wants to merge 1 commit into from

Conversation

bvp
Copy link

@bvp bvp commented May 14, 2019

No description provided.

@HeCorr
Copy link

HeCorr commented Aug 22, 2021

this seems to cause a deadlock when generating the last sequence (4/4 in this case. 1~3 works fine but 4 fails):

...
zzu
zzv
zzw
zzx
zzy
zzz
fatal error: all goroutines are asleep - deadlock!

goroutine 1 [select]:
(...)/brutedict.(*BruteDict).Id(0xc00011c3c0, 0xc000006018, 0xc00012df48)
        (...)/brutedict/brutedict.go:59 +0x89
main.main()
        (...)/main/main.go:23 +0x189
exit status 2

@HeCorr
Copy link

HeCorr commented Aug 22, 2021

this seems to fix the deadlock:

n := bytes.IndexByte(b, 0) // IndexByte returns -1 if no null bytes where found
if n > 0 {
    bd.queue <- string(b[:n])
} else {
    bd.queue <- string(b)
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants