I’m running a graphic intense app on the Cobra II and I’ve found calling Debug.GC(true) can cause the system to hang or even reboot.
Known issue?
I’m running a graphic intense app on the Cobra II and I’ve found calling Debug.GC(true) can cause the system to hang or even reboot.
Known issue?
One way to check is to try it on another Cobra II
That is no good! No this is not a known issue. Please provide a test example.
Trying to find a way to give a good test.
I’ve found there’s one specific area that causes Debug.GC to fail. Outside of the method, it works. Now I just need to narrow down what’s breaking it so I can cut the code down (big graphics = big code) for you guys.
I am really hoping this is a coincidence and the problem is not GC! We are waiting for more details.
Definitely not a coincidence. I can break it over and over by putting Debug.GC(true) inside of this method and it will work everytime if I omit that line.
FOUND IT!
The problem is calling Debug.GC(true); while you have a ManualResetEvent going.
Here’s a way to make it fail every time.
static ManualResetEvent _activeBlock = null;
static void IWillAlwaysFail()
{
Debug.Print("Starting failure method...");
_activeBlock = new ManualResetEvent(false);
Debug.Print("ManualResetEvent Created");
new Thread(ICauseTheFailure).Start();
// Wait for Result
_activeBlock.Reset();
while (!_activeBlock.WaitOne(1000, false))
;
// Unblock
_activeBlock = null;
}
static void ICauseTheFailure()
{
Thread.Sleep(3000);
Debug.Print("About to force a failure...");
Debug.GC(true);
Debug.Print("I'll never get here...");
_activeBlock.Set();
}
public static void Main()
{
IWillAlwaysFail();
}
Ttried it on my Cobra II it hanged as you have described.
Look at this thread,
Looks like related issue and the fix is already exists! Good catch!
This is great. I was worried this will be a difficult fix but it is fixed already
That is a relief.
Wow, do you have an index of the entire forum? It is unbelievable how often you remember that there was a related issue!! We should replace the forum search with @ Architect.
@ taylorza - I read that thread before, but I forgot about it.
It is @ Honken who pointed that out.
Ah, I missed his post…