Open corruptmem opened 5 years ago
Hi,
I would like to +1 this issue and add that 'very difficult to figure out where the issue came from' is an understatement. Since about 2 weeks I get exactly this exception which basically makes it impossible to debug. Up until now I've been unsuccessful in finding any clues to what might cause this problem. My project has a modest 180.000 lines of code and I really have no idea what to look for. Debugging the live situation with VS2019 doesn't bring me any closer to understanding what happens nor does analyzing a dump file of the situation with windbg.
'Clearly being an application code issue' suggests that my lack of knowledge is the problem, which is probably true, but I dare to argue that the situation I currently find myself in is at least partially caused by design/security choices in the CLR, given that the code runs without problems when no debugger is attached.
Is there a way to approach this problem and find the problematic code?
cheers, RIchard
Not sure if this counts as a bug, but it was unexpected behaviour for me.
Test case:
Run under the debugger (Windows, .NET Core 2.2) it will produce a SEHException from the GC finalizer thread:
Although this is clearly an application code issue (in my case, it came from incorrectly serializing then subsequently deserializing a ManualResetEvent with JsonConvert), because the exception occurs on the finalizer thread some time after the incorrect code is called, it's very difficult to figure out where the code issue came from.