Bug 256273 - massif-visualizer crashes due to bad kgraphviewerpart library
Summary: massif-visualizer crashes due to bad kgraphviewerpart library
Status: RESOLVED FIXED
Alias: None
Product: massif-visualizer
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: 0.2
Platform: Unlisted Binaries Linux
: NOR normal
Target Milestone: 0.1
Assignee: Massif Visualizer developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-11-07 04:06 UTC by Chris
Modified: 2010-11-07 13:33 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Chris 2010-11-07 04:06:42 UTC
Version:           0.2 (using KDE 4.5.2) 
OS:                Linux

Standard ubuntu kgraphviewerpart library lives in:
/usr/lib/kde4/kgraphviewerpart.so

Installation from latest git installs to:
/usr/local/lib/kde4/kgraphviewerpart.so


massif-visualizer crashes as the kgraphviewerpart is not loaded correctly (null pointer). Fixed by making the kgraphviewer.so a symlink to the git install. Probably need extra checks at startup for this.

Backtrace:

0x0805643b in Massif::MainWindow::slotGraphLoaded (this=0x81660c8) at /home/chris/Downloads/massif_visualizer/massif-visualizer/app/mainwindow.cpp:645
645         m_graphViewer->setZoomFactor(0.75);
(gdb) bt
#0  0x0805643b in Massif::MainWindow::slotGraphLoaded (this=0x81660c8) at /home/chris/Downloads/massif_visualizer/massif-visualizer/app/mainwindow.cpp:645
#1  0x0805adeb in Massif::MainWindow::qt_metacall (this=0x81660c8, _c=QMetaObject::InvokeMetaMethod, _id=62, _a=0xbfffdf9c)
    at /home/chris/Downloads/massif_visualizer/massif-visualizer/build/app/mainwindow.moc:110
#2  0x01b398ca in QMetaObject::metacall(QObject*, QMetaObject::Call, int, void**) () from /usr/lib/libQtCore.so.4
#3  0x01b4c6ad in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib/libQtCore.so.4
#4  0x02b0aa37 in ?? () from /usr/lib/kde4/kgraphviewerpart.so
#5  0x02b122cb in ?? () from /usr/lib/kde4/kgraphviewerpart.so
#6  0x01b398ca in QMetaObject::metacall(QObject*, QMetaObject::Call, int, void**) () from /usr/lib/libQtCore.so.4
#7  0x01b4c6ad in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib/libQtCore.so.4
#8  0x02b39857 in ?? () from /usr/lib/kde4/kgraphviewerpart.so
#9  0x02b3ffda in ?? () from /usr/lib/kde4/kgraphviewerpart.so
#10 0x02b4b42a in ?? () from /usr/lib/kde4/kgraphviewerpart.so
#11 0x01b398ca in QMetaObject::metacall(QObject*, QMetaObject::Call, int, void**) () from /usr/lib/libQtCore.so.4
#12 0x01b4c6ad in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib/libQtCore.so.4
#13 0x02b2e207 in ?? () from /usr/lib/kde4/kgraphviewerpart.so
#14 0x02b32291 in ?? () from /usr/lib/kde4/kgraphviewerpart.so
#15 0x02b34158 in ?? () from /usr/lib/kde4/kgraphviewerpart.so
...

Reproducible: Always
Comment 1 Milian Wolff 2010-11-07 13:33:25 UTC
commit 840d06969169d4f8cdfc7886b6468ccf4eeb2a90
branch master
Author: Milian Wolff <mail@milianw.de>
Date:   Sun Nov 7 13:33:50 2010 +0100

    guard against badly loaded kgraphviewer libs
    
    BUG: 256273

diff --git a/app/mainwindow.cpp b/app/mainwindow.cpp
index 78c1e9b..7c73c23 100644
--- a/app/mainwindow.cpp
+++ b/app/mainwindow.cpp
@@ -438,7 +438,9 @@ void MainWindow::treeSelectionChanged(const QModelIndex& now, const QModelIndex&
 
     m_chart->update();
 #ifdef HAVE_KGRAPHVIEWER
-    getDotGraph(item);
+    if (m_graphViewer) {
+        getDotGraph(item);
+    }
 #endif
 
     m_changingSelections = false;
@@ -468,7 +470,9 @@ void MainWindow::detailedItemClicked(const QModelIndex& idx)
 
     m_chart->update();
 #ifdef HAVE_KGRAPHVIEWER
-    getDotGraph(item);
+    if (m_graphViewer) {
+        getDotGraph(item);
+    }
 #endif
 
     m_changingSelections = false;
@@ -498,7 +502,9 @@ void MainWindow::totalItemClicked(const QModelIndex& idx_)
 
     m_chart->update();
 #ifdef HAVE_KGRAPHVIEWER
-    getDotGraph(item);
+    if (m_graphViewer) {
+        getDotGraph(item);
+    }
 #endif
 
     m_changingSelections = false;
@@ -601,6 +607,8 @@ void MainWindow::slotTabChanged(int index)
 
 void MainWindow::getDotGraph(QPair<TreeLeafItem*, SnapshotItem*> item)
 {
+    Q_ASSERT(m_graphViewer);
+
     kDebug() << "new dot graph requested" << item;
     if (m_dotGenerator) {
         kDebug() << "existing generator is running:" << m_dotGenerator->isRunning();
@@ -639,6 +647,8 @@ void MainWindow::showDotGraph()
 
 void MainWindow::slotGraphLoaded()
 {
+    Q_ASSERT(m_graphViewer);
+
     if (!m_dotGenerator) {
         return;
     }
@@ -650,16 +660,22 @@ void MainWindow::slotGraphLoaded()
 
 void MainWindow::zoomIn()
 {
+    Q_ASSERT(m_graphViewer);
+
     m_graphViewer->zoomIn();
 }
 
 void MainWindow::zoomOut()
 {
+    Q_ASSERT(m_graphViewer);
+
     m_graphViewer->zoomOut();
 }
 
 void MainWindow::focusExpensiveGraphNode()
 {
+    Q_ASSERT(m_graphViewer);
+
     m_graphViewer->centerOnNode(m_dotGenerator->mostCostIntensiveGraphvizId());
 }