[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #54920] sigabrt (signal-6) crash with AutoScal
From: |
Pantxo Diribarne |
Subject: |
[Octave-bug-tracker] [bug #54920] sigabrt (signal-6) crash with AutoScale in xscale = log mode |
Date: |
Fri, 2 Nov 2018 09:09:13 -0400 (EDT) |
User-agent: |
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:62.0) Gecko/20100101 Firefox/62.0 |
Follow-up Comment #16, bug #54920 (project octave):
@jwe: I tried the approach that post people recommend for exception handling
in qt, which is overloading QApplication and reimplementing the "notify"
method. For this bug I get good results.
The change I made is
--- a/libgui/src/main-window.cc Mon Feb 22 21:07:09 2016 +0100
+++ b/libgui/src/main-window.cc Fri Nov 02 14:04:27 2018 +0100
@@ -2766,7 +2766,7 @@
// Even if START_GUI is false, we still set up the QApplication so
// that we can use Qt widgets for plot windows.
- m_qt_app = new QApplication (m_argc, m_argv);
+ m_qt_app = new octave_qapplication (m_argc, m_argv);
// set windows style for windows
#if defined (Q_OS_WIN32)
@@ -3012,4 +3012,18 @@
const QString&, const QString&,
const QString&)));
}
+
+ bool
+ octave_qapplication::notify (QObject *receiver, QEvent *ev)
+ {
+ try
+ {
+ return QApplication::notify (receiver, ev);
+ }
+ catch (octave::execution_exception& e)
+ {
+ octave_link::post_exception (std::current_exception ());
+ }
+ return false;
+ }
}
diff -r e3a2ef3dced9 libgui/src/main-window.h
--- a/libgui/src/main-window.h Mon Feb 22 21:07:09 2016 +0100
+++ b/libgui/src/main-window.h Fri Nov 02 14:04:27 2018 +0100
@@ -490,6 +490,19 @@
bool m_connect_to_web;
};
+ class octave_qapplication : public QApplication
+ {
+ public:
+
+ octave_qapplication (int& argc, char **argv)
+ : QApplication (argc, argv)
+ { }
+
+ virtual bool notify (QObject *receiver, QEvent *e) override;
+
+ ~octave_qapplication (void) { };
+ };
+
And the result I get is
octave:3> crash_bug
octave:4> error: set: "cameratarget" must be finite
error: parse error
octave:4>
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?54920>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/