Results 1 to 5 of 5

Thread: Crash gracefully: How to ignore microsoft abort dialog?

  1. #1
    Join Date
    Dec 2006
    Posts
    426
    Thanks
    8
    Thanked 18 Times in 17 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Crash gracefully: How to ignore microsoft abort dialog?

    Hi,

    I have finally implemented exception handler rasied by operating system (such as SEGV or abort) and ignore it, so that the GUI application can continue instead of crashing the application. That works in both Linux and Windows.

    However, there is a problem with Windows version when test with "abort()", that the Window libraries intercept the abort() before my signal handler can intercept it, which pop up a dialog as shown in the attachment (first figure). After I clik "Retry", it will then get to my exception handler and ignore the signal (second figure)...

    Does anyone know how to prevent microsoft library from intercepting the abort()?


    Thanks
    Attached Images Attached Images

  2. #2
    Join Date
    May 2008
    Location
    Melbourne, Australia
    Posts
    136
    Thanks
    9
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Crash gracefully: How to ignore microsoft abort dialog?

    I'm having the same problem with the windows crash dialog: http://www.qtcentre.org/forum/f-qt-p...ge2-20759.html

  3. #3
    Join Date
    Feb 2009
    Location
    Noida, India
    Posts
    517
    Thanks
    21
    Thanked 66 Times in 62 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Crash gracefully: How to ignore microsoft abort dialog?

    guys,

    that is an assert failure..a debug error..when u'd run your app in release or with QT_NO_DEBUG(if i recall correctly), it wont come..and since your app will go to the customer in release only, you dont need to worry about it.

  4. #4
    Join Date
    Dec 2006
    Posts
    426
    Thanks
    8
    Thanked 18 Times in 17 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Crash gracefully: How to ignore microsoft abort dialog?

    Quote Originally Posted by talk2amulya View Post
    guys,

    that is an assert failure..a debug error..when u'd run your app in release or with QT_NO_DEBUG(if i recall correctly), it wont come..and since your app will go to the customer in release only, you dont need to worry about it.
    The worse thing is that it simply crashes my application in release mode. User don't even have chance to get to my exception handler...

    I am using the following test case:

    Qt Code:
    1. QList<int> a
    2. a[ 0 ] = 0
    To copy to clipboard, switch view to plain text mode 

    In release mode (in Linux), here is the error I got:

    *** glibc detected *** free(): invalid next size (fast): 0x00000000005dfb80 ***

    The application is then freezed...

  5. #5
    Join Date
    May 2008
    Location
    Melbourne, Australia
    Posts
    136
    Thanks
    9
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Crash gracefully: How to ignore microsoft abort dialog?

    hi Ini,

    thanks very much for sharing the code sample and apologies for the delay in testing it!
    Before I could compile I needed to comment out this signal block:
    Qt Code:
    1. #if !defined(Q_WS_WIN)
    2. ...
    3. #endif
    To copy to clipboard, switch view to plain text mode 
    because they are not defined on my platform (Windows XP).

    I found that the first time I pressed an error button an error dialog usually popped up but the app could continue (wow!). But the second time I pressed it I would get an unhandled exception and the app would shut down. I experienced this in both release and debug mode.


    A few questions and comments:

    - Why is SIGINT commented out?
    - If you close the application normally you will get here:
    Qt Code:
    1. qDebug() << "Should not get here!!";
    To copy to clipboard, switch view to plain text mode 
    - I want to exit gracefully on an error so I have trigger() throw an exception, which I catch in main.

    Richard
    Last edited by rbp; 14th May 2009 at 01:32.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.