Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ MT-multithreading and servers » Implementing a crash handler
Implementing a crash handler [message #43974] Thu, 04 December 2014 08:55
crydev is currently offline  crydev
Messages: 151
Registered: October 2012
Location: Netherlands
Experienced Member
Hello,

I'm implementing a crash handler for my application. I used SetUnhandledExceptionFilter to let unhandled SEH exceptions flow into my own exception handler. My exception handler then executes a TopWindow with information about the crash. This works great when the exception is raised on the UI thread. The window may be created in the exception handler and it blocks until the window is closed.

I'm facing trouble with exceptions that are raised on a different thread. Using the Dispatch package from Bazaar (DispatcherCB) I tried to let the (asynchronous) exception handler dispatch the exception to the main window that uses PostCallback to invoke the window execution. Using an Atomic I tried to have the exception handler block until the window is closed but this only works partially.

With this solution, the next problems are:

  • When the exception is raised on the UI thread, the application enters an infinite loop, because the exception handler is blocking execution;
  • When using EXCEPTION_EXECUTE_HANDLER to return from the exception handler, the application should terminate. Since I implemented the above described solution, the application does not terminate after the crash handler window is closed and destroyed.


I'm really having trouble with this. Is there an easier way to get the crash handler to be executed in a thread-safe way? Maybe there is an easier U++ builtin way?

Thanks a lot!

crydev

[Updated on: Thu, 04 December 2014 08:55]

Report message to a moderator

Previous Topic: [SOLVED]Use multiple HttpRequest instance (>32) to upload files will stuck
Next Topic: How to use Thread()
Goto Forum:
  


Current Time: Fri Apr 19 22:36:44 CEST 2024

Total time taken to generate the page: 0.03184 seconds