Closed mikebbt closed 1 year ago
You are not supposed to use the same Scanner for multiple concurrent ScanFile
, ScanMem
, ScanProc
calls. Generate multiple Scanner
objects from the same Rules
to do concurrent / parallel scans.
If this hasn't been clear from the documentation, I'd appreciate a hint, preferably as a pull request.
I must have missed that in the docs, where is that stated specifically?
In go-yara
's documentation, thread-safety is only mentioned in relation to setting variables. The underlying C struct (from YARA) is YR_SCANNER
.
Thanks for the feedback!
Just a general question, I've read that the Yara library is thread safe but I'm seeing an issue in my implementation. Can't share the code but it is working like this (running on Windows 10 VM):
At this point most times the process scans finish in about 15-20 minutes but the file scans seem to hang and never complete. Any thoughts on this? I'm testing now with two Yara scanner instances, one for the process Go routine and the other to process files just to get a different perspective.