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

concurrency issue detected with go1.19 #204

Closed
henderiw opened this issue Jan 30, 2023 · 2 comments
Closed

concurrency issue detected with go1.19 #204

henderiw opened this issue Jan 30, 2023 · 2 comments

Comments

@henderiw
Copy link

I ran into this issue using go version 1.19. Not sure if this is tested but reading and writing to a map can lead to this I believe

fatal error: concurrent map iteration and map write

goroutine 235 [running]:
github.com/itchyny/gojq.normalizeNumbers({0x22ed940?, 0xc0005e4360?})
/Users/henderiw/go/pkg/mod/github.com/itchyny/gojq@v0.12.10/normalize.go:77 +0x105
github.com/itchyny/gojq.normalizeNumbers({0x22ed940?, 0xc0005e4330?})
/Users/henderiw/go/pkg/mod/github.com/itchyny/gojq@v0.12.10/normalize.go:78 +0x6f1
github.com/itchyny/gojq.normalizeNumbers({0x22369c0?, 0xc00053e270?})
/Users/henderiw/go/pkg/mod/github.com/itchyny/gojq@v0.12.10/normalize.go:73 +0x7d4
github.com/itchyny/gojq.(*Code).RunWithContext(0xc00010e500, {0x2773d50?, 0xc000042078}, {0x0, 0x0}, {0xc00054f030, 0x1, 0x1})
/Users/henderiw/go/pkg/mod/github.com/itchyny/gojq@v0.12.10/compiler.go:50 +0x3b1
github.com/itchyny/gojq.(*Code).Run(...)
/Users/henderiw/go/pkg/mod/github.com/itchyny/gojq@v0.12.10/compiler.go:39

@wader
Copy link
Sponsor Contributor

wader commented Jan 30, 2023

Hi, similar issue as in #188?

@itchyny
Copy link
Owner

itchyny commented Jan 31, 2023

Right, this looks like the same issue. For argument of Run, do not use values sharing same data between goroutines.

@itchyny itchyny closed this as not planned Won't fix, can't repro, duplicate, stale Jan 31, 2023
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

No branches or pull requests

3 participants