-
Notifications
You must be signed in to change notification settings - Fork 17.5k
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
debug/gosym: data race in PCToLine #47044
Comments
Can you attach a program that reproduces this? |
Here is the location in my project where it is triggered. It's a library for analyzing Go binaries (I use it for malware analysis) so a single program isn't enough. This file triggers it consistantly. If I analyze the binary using this code logic it panics (a tool using it):
If I use a different version that use an older logic that doesn't use multiple go routines, it's fine:
One thing that I can tell is that the file path for all files appears to have been patched to "." which may be why it's crashing consistantly vs randomly. Here is how it normaly should look like:
|
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
I have not tested 1.17 beta but the issue in the code is still present in the main branch.
What did you do?
The LineTable attribute
strings
is not guarded against concurent reads and writes nor is it documented. If the same*sym.Table
is used by multiple go routines that calls the methodPCToLin
the process may crash due to a race condition.Call flow:
PCToLin
->go12PCToFile
->stringFrom
-> read and write to map without mutex.It looks like the same can happen to the other map
funcNames
.Part of panic:
What did you expect to see?
No panic
What did you see instead?
Panic
The text was updated successfully, but these errors were encountered: