-
Notifications
You must be signed in to change notification settings - Fork 394
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
Concurrent map iteration and write in finding #3748
Comments
I am not sure if this is is connected, as the place of the crush is different.
|
I've seen yours before, and I think it's actually internal to golang's template generation. |
This comment was marked as off-topic.
This comment was marked as off-topic.
It is even worse, because we do Ok, I think I know what is going on @NDStrahilevitz, @AlonZivony and @denisgersh. The struct: type Finding struct {
Data map[string]interface{}
Event protocol.Event // Event is the causal event of the Finding
SigMetadata SignatureMetadata
} Has Data, which is a map, right ? All the signatures return a Data map, through the callback, once they are triggered (to signalize a finding containing some data). As you already probably figured out, maps aren't thread safe (read or write), and we have couple (maybe even 3 threads) touching the object that contains those returned maps.
The way I see, this is how to proceed here:
|
@rafaeldtinoco Thanks for the analysis. I believe what precisely is going wrong is due to how we "return" (emphasis on the quotes) findings. The solutions suggested are still relevant, but I would like to propose another one: |
For now, guarding the |
Description
No reproducer yet.
Concurrent iteration happens at this code section:
![image](https://private-user-images.githubusercontent.com/22661609/288814072-7b485ce2-86b2-463a-a304-80873b115ac0.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjA3NDM2MTIsIm5iZiI6MTcyMDc0MzMxMiwicGF0aCI6Ii8yMjY2MTYwOS8yODg4MTQwNzItN2I0ODVjZTItODZiMi00NjNhLWEzMDQtODA4NzNiMTE1YWMwLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MTIlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzEyVDAwMTUxMlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWZkN2FjYzJlYzNjOTI1OThmMDY5MDE1N2RlOTM3ZTY3OWY5M2VmODNkM2M2MDA5MjQ2NzhjYTY1ZDhhYjk5YmQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.cNal78SjAJR_jM1L9cka7uxJWjL0h0w2UKxTuUJYksw)
On the
range
.Not clear from the logs where the concurrent write is, and there doesn't seem to be a write in this function, nor any other goroutine accessing a finding at the same time.
Output of
tracee version
:tracee commit a57c534
Output of
uname -a
:Additional details
relevant section of the map iteration from the log (no write section was found for some reason):
The text was updated successfully, but these errors were encountered: