[vtkusers] vtkCharts, Qt and segmentation faults in vtkInformation::ReportReferences

Bastian A. bastianra at gmail.com
Mon Jul 6 19:07:07 EDT 2015


Hi everyone,

I am trying to create an interactive "plot: where users can select a subset
of the data, and based on the selection, a variable number of additional
plots is added.
When the user changes the selection, the number of plots is increased or
decreased accordingly.
I am using a vtkAnnotationLink and a vtkCommand subclass to trigger the
update of the vtkChartMatrix that contains all the plots.

My problem is that I am experiencing non-deterministic crashes in my
application, which occur deep within the garbage collection following a
call of the destructor of a vtkPlotPoints object.
What causes the crash is that the "first" IVar of the iterator is a
nullpointer.

void vtkInformation::ReportReferences(vtkGarbageCollector* collector)
{
  this->Superclass::ReportReferences(collector);
  // Ask each key/value pair to report any references it holds.
  typedef vtkInformationInternals::MapType MapType;
  for(MapType::const_iterator i = this->Internal->Map.begin();
      i != this->Internal->Map.end(); ++i)
    {
    i->first->Report(this, collector);
    }
}


I think that the problem is stemming from the qt eventloop triggering a
redraw while I am updating the plot (which involves the destruction and
creation of  vtkPlots in the vtkChartMatrix).

I have following questions:
What calls are necessary to remove a scene from the renderer, in such a way
that I can destroy items in the scene safely?
Or more general; which manipulations of a plot/chart/scene are safe in an
interactive setting, where a GUI thread my trigger redraws at any time?
Is there a better way than simply duplicating the QVTKWidget and switching
between two widgets when updating the scene (manually setting mutexes in
the Qt and vtk sub-classes seems like a bad idea since this would depend on
implementation details, both in Qt and Vtk)?

Thanks,
Bastian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20150706/347d6d49/attachment.html>


More information about the vtkusers mailing list