We are having nondeterministic System.AccessViolationException thrown from native code. It's hard to reproduce it, but sometimes it happens. I'm not sure if I can "just debug it" since the time needed for access violation is about 2 hours and there is no guarantees that access violation will happen.
The native library is used by managed wrappers. It's used from java through JNI and it's used from .NET through IKVM'ed JNI. The problem was only reproduced during from IKVM'ed code, but the data sets is different and there is no way to test java application with data used by IKVM'ed application.
I have sources for everything, but (if possible) I want to avoid making large number of changes.
I believe native call stack will provide enough information about reason of this access violation.
Is there any effective ways of determining the reason of this access violation?
I think the ideal solution for me is some changes in code or process environment, so it will crash with memory dump in case of this access violation, so I can make that changes and just wait.