I am trying to write a program to test student code with a good implementation. I have a C ++ console application that will run one test at a time, defined by command line commands, and a C # .net forms application that calls the C ++ application once for each test. The goal is to be able to detect not only a skip / failure for each test, but also an βendlessβ (> 5 seconds) loop and exceptions (their code dies for any reason).
The problem is that not all errors kill a C ++ application. If they damage the heap, the system calls __debugbreak, which displays a window with the message "Debugging error"! HEAP CORRUPTION DETECTED ... My C # application uses Process.WaitForExit (5000) to wait, but this error is not considered an output, so I see a timeout.
So my question is: how can I make a C # application detect that this is an error? Or how can I make a C ++ application die when this error occurs, rather than giving a dialog box and asking if I want to debug
Edit:
Here is the error that appears: Debugging error
A dialog box appears with a normal application that appears if I click repeat in the previous dialog box: Windows error . The debugging option disappears if you disable the JIT debugger.
source
share