[vtk-developers] Fwd: QVTKWidget segfault on Linux with Qt5, VTK6.2, GCC4.9, C++14

Marcus D. Hanwell marcus.hanwell at kitware.com
Mon Jan 12 09:43:11 EST 2015


Taking a quick look at this I get compile failures because of your use of auto,

gcc (GCC) 4.9.2 20141224 on Arch Linux (64 bit), I see,

/home/marcus/vtkqt5/vtkdebug/vtkviewer.cpp: In constructor
‘VTKViewer::VTKViewer(QWidget*)’:
/home/marcus/vtkqt5/vtkdebug/vtkviewer.cpp:17:10: error: ‘renderer’
does not name a type
     auto renderer = vtkSmartPointer<vtkRenderer>::New();

You can use vtkNew in place of the auto calls, so I just replaced
them. I suspect it is because I did not set a build type and your
flags are only applied for Release or Debug builds. Even without C++14
(not verified to work with VTK yet) I can reproduce the crash you are
seeing.

I need to spend a little more time looking into it, I can see an
invalid pointer for the vtkRenderer in the widget in the backtrace.
Rendering works in the Qt5 widget, it seems specific to this widget
(or maybe all widgets). Thanks for pointing this out.

On Wed, Jan 7, 2015 at 11:17 PM, Júlio Hoffimann
<julio.hoffimann at gmail.com> wrote:
> Forwarding this email to the developers mailing list as I think this might
> be a bug in VTK.
>
> -Júlio
>
> ---------- Forwarded message ----------
> From: "Júlio Hoffimann" <julio.hoffimann at gmail.com>
> Date: Jan 5, 2015 11:25 AM
> Subject: QVTKWidget segfault on Linux with Qt5, VTK6.2, GCC4.9, C++14
> To: "VTK Users" <vtkusers at vtk.org>
> Cc:
>
> Dear VTKers,
>
> Attached is a testcase that reproduces the issue I'm having with QVTKWidget.
> If you download the zip, run CMake and run the program, it should simply
> show a VTK viewer inside the main window. If however you uncomment line 30
> in vtkviewer.cpp, the program crashes whenever the cursor is over the
> QVTKWidget window.
>
> Could you please confirm that I'm not misusing the API? I appreciate if you
> can try to reproduce the issue.
>


More information about the vtk-developers mailing list