none
Unhandled exception (access violation) from IE7 RRS feed

  • Question

  • My application hosts a web browser control and it sometimes encounters access violation exception after running a long period of time (e.g. longer than 1 hour). The exception results in crash of my application.

     

    I would like to write codes to handle the exception. My first preference is to handle "UnhandledException" event of the "AppDomain" class. How can I verify if the "UnhandledException" event can handle this kind of access violation exception?

     

     

    -Jeremy

    Thursday, May 29, 2008 7:07 AM

Answers

  • No, I didn't say that.  I said that catching AV Exceptions is pretty pointless, even if you could.  Not sure if the CLR could catch AVs on Explorer threads.  Very doubtful since it wouldn't normally have a chance to install a back-stop SEH handler.  Other than the SetUnhandledExceptionFilter API call.  I assume you posted because it can't.
    Hans Passant.
    Saturday, May 31, 2008 1:32 AM
    Moderator

All replies

  • You cannot recover from an AV exception.  The execution thread is dead, it has to be killed.  Which leaves the WB in a perilous state, one that surely leaves it completely disfunctional.  By the time the UnhandledException event runs, the AppDomain is dead too.  You can only log an error and kill the app.  Which it already does.
    Thursday, May 29, 2008 1:05 PM
    Moderator
  • Do you mean that UnhandledException event of AppDomain class can catch access violation exception of IE7? It is because my test shows that UnhandledException event of AppDomain class cannot catch exceptions of native threads...
    Friday, May 30, 2008 6:19 AM
  • No, I didn't say that.  I said that catching AV Exceptions is pretty pointless, even if you could.  Not sure if the CLR could catch AVs on Explorer threads.  Very doubtful since it wouldn't normally have a chance to install a back-stop SEH handler.  Other than the SetUnhandledExceptionFilter API call.  I assume you posted because it can't.
    Hans Passant.
    Saturday, May 31, 2008 1:32 AM
    Moderator
  • I intend to re-create the web browser control when AV exception is encountered. If re-creating the web browser control doesn't recover my application, I may even try to put the web browser control in a separate process for a clean recovery.

    Anyway, thanks for mentioning SetUnhandledExceptionFilter. This way sounds simpler than my fallback method, attaching my own debugger to my application :)
    Sunday, June 1, 2008 9:00 AM