[Qt-jambi-interest] Crash on System.exit()
Mathias
listo.mathias at googlemail.com
Thu Feb 5 16:10:47 CET 2009
Gentlemen,
I did notice that in some cases, when my app exits with System.exit() (e.g.
after having handled an exception) Jambi crashes with a seg fault in
qtjambi.dll native code.
I attached the crash log of the most recent case.
Basically the procedure is as follows:
During startup my application throws an exception before getting to
QApplication.exec() (for example because it detected another instance
running).
The exception is being handled in the global UncaughtExceptionHandler set
with Thread.setDefaultUncaughtExceptionHandler(...).
The exception handler displays a messagebox to the user with
QMessageBox.critical(...) and then calls System.exit(1).
This is my current handler:
public void uncaughtException(Thread t, final Throwable e) {
if (log != null) log.error("Unrecoverable error encountered on
thread " + t, e);
Runnable messenger = new Runnable() {
public void run() {
QMessageBox.critical(null,
QApplication.translate("Application", "application
error"),
StringUtils.abbreviate(e.getMessage(), 500)
);
System.exit(1);
}
};
// we need to display the error message on the main thread
if (Thread.currentThread() != mainThread) {
QApplication.invokeLater(messenger);
} else {
messenger.run();
}
}
Everything works as expected except for the seg fault at the very end (see
attachment).
Am I missing a crucial clean up step before the System.exit() ?
Thanks for any hints on this,
Mathias
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt.nokia.com/pipermail/qt-jambi-interest/attachments/20090205/5d193674/attachment.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: hs_err_pid3724.log
Type: application/octet-stream
Size: 7805 bytes
Desc: not available
Url : http://lists.qt.nokia.com/pipermail/qt-jambi-interest/attachments/20090205/5d193674/attachment.obj
More information about the Qt-jambi-interest
mailing list