MantisBT - VTK
View Issue Details
0009895VTK(No Category)public2009-11-13 18:452016-08-12 09:55
Jerome Velut 
Kitware Robot 
normalcrashalways
closedmoved 
PCLinuxFedora 9/11
 
 
0009895: vtkEventQtSlotConnect::Connect crashes a simple Qt application when VTK is compiled in release mode only
I wanted to catch VTK event from a Qt application (ParaView, in fact). I used vtkEventQtSlotConnect to connect the renwin interactor events to a Qt widget. If I link the project to a Debug-compiled VTK, this works well. But a Release-mode VTK yields a seg fault.

Here is the GDB backtrace for the modified SimpleView detailed thereafter:

#################################################"
Program received signal SIGSEGV, Segmentation fault.
0x01ad5ee4 in vtkSubjectHelper::AddObserver () from /home/dje/Softwares/Paraview-3.7-Release/bin/libvtkCommon.so.pv3.7
(gdb) backtrace
#0 0x01ad5ee4 in vtkSubjectHelper::AddObserver () from /home/dje/Softwares/Paraview-3.7-Release/bin/libvtkCommon.so.pv3.7
#1 0x01ad5f9e in vtkObject::AddObserver () from /home/dje/Softwares/Paraview-3.7-Release/bin/libvtkCommon.so.pv3.7
#2 0x0047b063 in vtkQtConnection::SetConnection () from /home/dje/Softwares/Paraview-3.7-Release/bin/libQVTK.so.pv3.7
#3 0x0047a826 in vtkEventQtSlotConnect::Connect () from /home/dje/Softwares/Paraview-3.7-Release/bin/libQVTK.so.pv3.7
#4 0x0804c299 in SimpleView::SimpleView ()
#5 0x0804bd28 in main ()
Attached is a modified version of the SimpleView that you can find in VTK/Examples/GUI/Qt. The not-so-many modifications are enclosed between comments that contain "JEROME: "

Basically, the following lines make an application crashes:
  vtkEventQtSlotConnect* VTKConnect = vtkEventQtSlotConnect::New( );
  vtkRenderWindowInteractor* iren = this->ui->qvtkWidget
                                            ->GetRenderWindow( )
                                            ->GetInteractor( );
  VTKConnect->Connect( iren,
                       vtkCommand::MouseWheelBackwardEvent,
                       this,
                       SLOT( catchVTKEvent()),
                       0,
                       1.0);

I investigated on the RenderWindowInteractor validity: Surprisingly,
   this->ui->qvtkWidget
            ->GetRenderWindow( )
            ->PrintSelf( cout, vtkIndent());
shows a different "Interactor: " value that the simple test
   cout << iren;

My opinion is twofolds:
(1) I misused the QVTKWidget, that's why the interactor is not valid
(2) The QVTKWidget has a 'release-exclusive' bug.
No tags attached.
bz2 SimpleViewConnectionBug.tar.bz2 (9,220) 2009-11-13 18:45
https://www.vtk.org/Bug/file/7656/SimpleViewConnectionBug.tar.bz2
Issue History
2009-11-13 18:45Jerome VelutNew Issue
2009-11-13 18:45Jerome VelutFile Added: SimpleViewConnectionBug.tar.bz2
2009-11-20 04:35Jerome VelutNote Added: 0018491
2011-06-16 13:11Zack GalbreathCategory => (No Category)
2016-08-12 09:55Kitware RobotNote Added: 0037120
2016-08-12 09:55Kitware RobotStatusexpired => closed
2016-08-12 09:55Kitware RobotResolutionopen => moved
2016-08-12 09:55Kitware RobotAssigned To => Kitware Robot

Notes
(0018491)
Jerome Velut   
2009-11-20 04:35   
I cannot reproduce this bug anymore. That's fine for me, but I really wonder what's happened...
(0037120)
Kitware Robot   
2016-08-12 09:55   
Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current VTK Issues page linked in the banner at the top of this page.