Code: Select all
RegisterExceptionHandler(AddDetailsExceptHandler, stDontSync, epCompleteReport);
Code: Select all
exceptIntf.BugReportSections['sectionName'] := SomeText
Under some yet to be understood circumstances, the entire service becomes unresponsive and so I used the GetProcessBugReport method as described here: viewtopic.php?f=4&t=28692
This gave me an entire snapshot of the frozen process and I have noticed that I have one thread that has AddDetailsExceptHandler inside its stack trace from calling this method:
Code: Select all
function GetFullBugReport(E: Exception): string;
var
MEException: IMEException;
Handled: Boolean;
begin
MEException := NewException(etNormal, E);
Handled := False;
MEException.FireHandlers(epCompleteReport, Handled);
Result := MEException.BugReport;
end;
As it turns out, in the retrieved dump, there clearly is another thread that is currently holding the monitor while waiting for another object that is already held by the code calling GetFullBugReport. I thus have a deadlock here, I'll have to figure out a way to overcome this.
However, this whole lock situation got me thinking about how madExcept manages to get the stacktrace for all threads. I mean, is it freezing all threads while handling an exception in the "except" block?
If yes, I could also have an issue where the thread that might release the lock object cannot run until the bugreport is created, but the exception handler waits for it to run. But maybe I got this wrong, because definitely, I have a deadlock above.
Thanks for your answers