[vtkusers] VTk/Examples/GUI/Qt/GraphicsView crashed on win7

Luke hazelnusse at gmail.com
Sun Apr 29 18:12:49 EDT 2012


I am getting a seg fault with the example qtgraphicsview.  It happens
when I use the mouse wheel or right click on either the
GraphLayoutViewItem or the TreeRingViewItem.  It looks like a null
pointer is being deferenced in vtkRenderer::GetActiveCamera, I am not
familiar enough with this code to know what is needed to prevent it
from happening.

This is Qt 4.7.4, vtk 5.10-rc3.

Here is the backtrace from gdb, hopefully it will be helpful to
somebody in tracking down the bug:

luke at LenovoW510 ~/repos/VTK-build $ gdb bin/qtgraphicsview
GNU gdb (Gentoo 7.3.1 p2) 7.3.1
Copyright (C) 2011 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-pc-linux-gnu".
For bug reporting instructions, please see:
<http://bugs.gentoo.org/>...
Reading symbols from /home/luke/repos/VTK-build/bin/qtgraphicsview...done.
(gdb) run
Starting program: /home/luke/repos/VTK-build/bin/qtgraphicsview
warning: Could not load shared library symbols for linux-vdso.so.1.
Do you need "set solib-search-path" or "set sysroot"?
[Thread debugging using libthread_db enabled]
[New Thread 0x7fffec829700 (LWP 24213)]
[New Thread 0x7fffebf08700 (LWP 24214)]
[New Thread 0x7fffeae77700 (LWP 24215)]

Program received signal SIGSEGV, Segmentation fault.
0x000000000084df3e in vtkRenderer::GetActiveCamera (this=0x0) at
/home/luke/repos/VTK/Rendering/vtkRenderer.cxx:732
732	  if ( this->ActiveCamera == NULL )
(gdb) bt full
#0  0x000000000084df3e in vtkRenderer::GetActiveCamera (this=0x0) at
/home/luke/repos/VTK/Rendering/vtkRenderer.cxx:732
No locals.
#1  0x0000000000a7ddb8 in vtkInteractorStyleRubberBand2D::OnMouseMove
(this=0x19fddf0)
    at /home/luke/repos/VTK/Rendering/vtkInteractorStyleRubberBand2D.cxx:160
        lastPt = {272, 301}
        lastFocalPt = {6.9533558069077419e-310,
8.0260568914393828e-317, 6.9533558069128802e-310}
        rwi = 0x19db8e0
        curPt = {272, 302}
        camera = 0xf7cd34
        lastScale = 6.9533558069109039e-310
        lastPos = {1.7601598508840916e-316, 8.0251626326204102e-317,
1.7424003648049405e-316}
#2  0x00000000008c010f in vtkInteractorStyle::ProcessEvents (event=26,
clientdata=0x19fddf0, calldata=0x7fffffffbb20)
    at /home/luke/repos/VTK/Rendering/vtkInteractorStyle.cxx:1007
        self = 0x19fddf0
#3  0x0000000000ee7c1f in vtkCallbackCommand::Execute (this=0x19fe090,
caller=0x19db8e0, event=26, callData=0x7fffffffbb20)
    at /home/luke/repos/VTK/Common/vtkCallbackCommand.cxx:42
No locals.
#4  0x0000000000f7c7b5 in vtkSubjectHelper::InvokeEvent
(this=0x19f73c0, event=26, callData=0x7fffffffbb20, self=0x19db8e0)
    at /home/luke/repos/VTK/Common/vtkObject.cxx:602
        command = 0x19fe090
        vIter = {first = 28, second = true}
        focusHandled = 0
        saveListModified = 1
        visited = std::map with 32 elements = {[24] = false, [25] =
false, [26] = false, [27] = false, [28] = true, [29] = false, [30] =
false,
          [31] = false, [32] = false, [33] = false, [34] = false, [35]
= false, [36] = false, [37] = false, [38] = false, [39] = false, [40]
= false,
          [41] = false, [42] = false, [43] = false, [44] = false, [45]
= false, [46] = false, [47] = false, [48] = false, [49] = false, [50]
= false,
          [51] = false, [52] = false, [53] = false, [54] = false, [55] = false}
        elem = 0x19f6810
        next = 0x19f6940
#5  0x0000000000f7ccbf in vtkObject::InvokeEvent (this=0x19db8e0,
event=26, callData=0x7fffffffbb20) at
/home/luke/repos/VTK/Common/vtkObject.cxx:770
No locals.
#6  0x00000000008455a2 in QVTKInteractorAdapter::ProcessEvent
(this=0x19f74a0, e=0x7fffffffbb20, iren=0x19db8e0)
    at /home/luke/repos/VTK/GUISupport/Qt/QVTKInteractorAdapter.cxx:117
        e2 = 0x7fffffffbb20
        t = QEvent::MouseMove
#7  0x0000000000838a56 in QVTKGraphicsItem::mouseMoveEvent
(this=0x18ff3d0, e=0x7fffffffc320) at
/home/luke/repos/VTK/GUISupport/Qt/QVTKGraphicsItem.cxx:282
        pf = {xp = 272, yp = 209}
        pi = {xp = 272, yp = 209}
        e2 = <incomplete type>
#8  0x00007ffff5ee75de in QGraphicsItem::sceneEvent(QEvent*) () from
/usr/lib64/qt4/libQtGui.so.4
No symbol table info available.
#9  0x00007ffff5f0fbfa in
QGraphicsScenePrivate::sendMouseEvent(QGraphicsSceneMouseEvent*) ()
from /usr/lib64/qt4/libQtGui.so.4
No symbol table info available.
#10 0x00007ffff5f106fc in
QGraphicsScene::mouseMoveEvent(QGraphicsSceneMouseEvent*) () from
/usr/lib64/qt4/libQtGui.so.4
No symbol table info available.
---Type <return> to continue, or q <return> to quit---
#11 0x00007ffff5f1e6bb in QGraphicsScene::event(QEvent*) () from
/usr/lib64/qt4/libQtGui.so.4
No symbol table info available.
#12 0x00007ffff5959944 in QApplicationPrivate::notify_helper(QObject*,
QEvent*) () from /usr/lib64/qt4/libQtGui.so.4
No symbol table info available.
#13 0x00007ffff595e7b3 in QApplication::notify(QObject*, QEvent*) ()
from /usr/lib64/qt4/libQtGui.so.4
No symbol table info available.
#14 0x00007ffff489ee5c in QCoreApplication::notifyInternal(QObject*,
QEvent*) () from /usr/lib64/qt4/libQtCore.so.4
No symbol table info available.
#15 0x00007ffff5f38319 in
QGraphicsViewPrivate::mouseMoveEventHandler(QMouseEvent*) () from
/usr/lib64/qt4/libQtGui.so.4
No symbol table info available.
#16 0x00007ffff5f3853e in QGraphicsView::mouseMoveEvent(QMouseEvent*)
() from /usr/lib64/qt4/libQtGui.so.4
No symbol table info available.
#17 0x00007ffff59a73f6 in QWidget::event(QEvent*) () from
/usr/lib64/qt4/libQtGui.so.4
No symbol table info available.
#18 0x00007ffff5d20466 in QFrame::event(QEvent*) () from
/usr/lib64/qt4/libQtGui.so.4
No symbol table info available.
#19 0x00007ffff5f3ca2b in QGraphicsView::viewportEvent(QEvent*) ()
from /usr/lib64/qt4/libQtGui.so.4
No symbol table info available.
#20 0x00007ffff489efe8 in
QCoreApplicationPrivate::sendThroughObjectEventFilters(QObject*,
QEvent*) () from /usr/lib64/qt4/libQtCore.so.4
No symbol table info available.
#21 0x00007ffff595990f in QApplicationPrivate::notify_helper(QObject*,
QEvent*) () from /usr/lib64/qt4/libQtGui.so.4
No symbol table info available.
#22 0x00007ffff595efef in QApplication::notify(QObject*, QEvent*) ()
from /usr/lib64/qt4/libQtGui.so.4
No symbol table info available.
#23 0x00007ffff489ee5c in QCoreApplication::notifyInternal(QObject*,
QEvent*) () from /usr/lib64/qt4/libQtCore.so.4
No symbol table info available.
#24 0x00007ffff595a912 in
QApplicationPrivate::sendMouseEvent(QWidget*, QMouseEvent*, QWidget*,
QWidget*, QWidget**, QPointer<QWidget>&, bool) ()
   from /usr/lib64/qt4/libQtGui.so.4
No symbol table info available.
#25 0x00007ffff59d2f18 in QETWidget::translateMouseEvent(_XEvent
const*) () from /usr/lib64/qt4/libQtGui.so.4
No symbol table info available.
#26 0x00007ffff59d1d1a in QApplication::x11ProcessEvent(_XEvent*) ()
from /usr/lib64/qt4/libQtGui.so.4
No symbol table info available.
#27 0x00007ffff59f8cb2 in x11EventSourceDispatch(_GSource*, int
(*)(void*), void*) () from /usr/lib64/qt4/libQtGui.so.4
No symbol table info available.
#28 0x00007ffff1bf15dd in g_main_context_dispatch () from
/usr/lib64/libglib-2.0.so.0
No symbol table info available.
#29 0x00007ffff1bf1dd8 in g_main_context_iterate.isra.21 () from
/usr/lib64/libglib-2.0.so.0
No symbol table info available.
#30 0x00007ffff1bf1fa9 in g_main_context_iteration () from
/usr/lib64/libglib-2.0.so.0
No symbol table info available.
#31 0x00007ffff48c8a1f in
QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>)
() from /usr/lib64/qt4/libQtCore.so.4
No symbol table info available.
#32 0x00007ffff59f894e in
QGuiEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>)
() from /usr/lib64/qt4/libQtGui.so.4
No symbol table info available.
---Type <return> to continue, or q <return> to quit---
#33 0x00007ffff489e062 in
QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) ()
from /usr/lib64/qt4/libQtCore.so.4
No symbol table info available.
#34 0x00007ffff489e25f in
QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from
/usr/lib64/qt4/libQtCore.so.4
No symbol table info available.
#35 0x00007ffff48a2257 in QCoreApplication::exec() () from
/usr/lib64/qt4/libQtCore.so.4
No symbol table info available.
#36 0x00000000008323b0 in main (argc=1, argv=0x7fffffffdbd8) at
/home/luke/repos/VTK/Examples/GUI/Qt/GraphicsView/main.cpp:13
        app = <incomplete type>
        view = {<QGraphicsView> = {<No data fields>}, mCtx =
0x18fec90, mWidget = 0x18fd370}
(gdb) kill
Kill the program being debugged? (y or n) y
(gdb) quit
luke at LenovoW510 ~/repos/VTK-build $


On Thu, Mar 29, 2012 at 2:08 AM, septem <septem.wu at gmail.com> wrote:
> Thank you for your response.
>
> Qt4.8 is configured use the configure.exe
>
> vtk is configured use cmake and build against Qt4.8
>
> All the classes and functions are working fine except QVTKGraphicsItem
>
> After I removed the code which contains "QVTKGraphicsItem", the program runs
> ok.
>
> --
> View this message in context: http://vtk.1045678.n5.nabble.com/VTk-Examples-GUI-Qt-GraphicsView-crashed-on-win7-tp5602763p5603110.html
> Sent from the VTK - Users mailing list archive at Nabble.com.
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers



-- 
"Those who would give up essential liberty to purchase a little
temporary safety deserve neither liberty nor safety."

-- Benjamin Franklin, Historical Review of Pennsylvania, 1759



More information about the vtkusers mailing list