-
-
Notifications
You must be signed in to change notification settings - Fork 116
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
Unhandled Exception: System.AccessViolationException in PeNet.Header.Resource.StringTable.GetValue #350
Comments
Hi @VaronisContributor! Thanks for reporting the issue. Do you have a minimal example how to repoduce the bug? |
Hi @secana, thank you for quick response. We don't have a reproduction scenario, since it is uncertain how can this happen. Here is the most detailed description I can provide.
It also fails on different functions in the stack, here is another one from logs:
All our access to a single instance of PeFile is under lock on the same object.
In order to prevent lazy load of the properties, we added the following code in the Constructor:
The above are all the properties we access in the member functions, and all the functions access it under lock like this:
There is a processing of multiple files in parallel in many tasks. The only concurrency possible (not intended, but still possible) is concurrent work with files. For instance, there is a non-zero possibility (not that I can tell of a specific scenario) that the file can be deleted at the same time we explore it with PeNetby a different process. But in such case I would obviously expect a regular exception instead of corrupted process state indicating exception. Hope it will help. |
Thanks for the additional insights. I guess that will be hard one to debug. What kind of .NET version are you using on which OS? It seemt that the NET48_Helper is called, which should not be the case for any of the "new" .NET variants, e.g. .NET 6/7/8/9 |
Agent:
Project: |
Unhandled Exception: System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
The call is like this:
try-catch block doesn't work since it is a corrupted process state indicating exception.
The version is from nuget.org - https://www.nuget.org/packages/PeNet/4.1.1 + dependencies.
The code executed in mstest and called from an assembly compiled for 4.7.2
The text was updated successfully, but these errors were encountered: