View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0012986VTK(No Category)public2012-03-09 10:472014-10-06 11:20
ReporterMarc Ferland 
Assigned ToBen Boeckel (Kitware) 
PrioritynormalSeverityminorReproducibilityhave not tried
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version5.8.0 
Target VersionFixed in Version 
Summary0012986: Crash in vtkChartXY::RemovePlot
DescriptionThe following call to RemovePlotInstance crashes because of a NULL pointer dereference in vtkChartXY::RemovePlot():996

#include <vtkChartXY.h>
#include <vtkContextScene.h>
#include <vtkContextView.h>
#include <vtkPlotLine.h>

int main()
{
   vtkChartXY *chart = vtkChartXY::New();
   vtkPlot *line = vtkPlotLine::New();
   chart->AddPlot(line);
   chart->RemovePlotInstance(line);
   line->Delete();
   chart->Delete();
   return EXIT_SUCCESS;
}

I'm attaching a patch that fixes it for me (based on tag v5.8.0).
TagsNo tags attached.
ProjectTBD
Typecrash
Attached Filespatch file icon 0001-Check-the-Scene-pointer-before-dereferencing.patch [^] (792 bytes) 2012-03-09 10:47 [Show Content]

 Relationships

  Notes
(0028349)
Marcus D. Hanwell (developer)
2012-03-09 13:30

The patch seems reasonable, but I suspect that there are many other places where we assume Scene is set. What are you trying to do here? There is not much a chart does if it is not in a scene. I can add more null checking to the code.
(0028351)
Marc Ferland (reporter)
2012-03-09 13:56

I'm working on a small pipeline editor and I noticed that if I deleted a vtkContextView _before_ deleting the vtkChartXY a segfault always happened.

The other objects handled by the pipeline editor can be created or deleted in any order, the only exception is this vtkPlot, vtkChartXY relation.
(0028353)
Marc Ferland (reporter)
2012-03-09 14:22

Another case is when I clear my pipeline editor (by deleting all objects making the pipeline), since objects are deleted in no particular order a crash sometimes happen.
(0031253)
Dave DeMarle (administrator)
2013-07-22 20:02

moving all "tabled" bugs into "backlog" category since "tabled" is no longer used.
(0033484)
Ben Boeckel (Kitware) (developer)
2014-10-02 12:55

Fixed on Gerrit http://review.source.kitware.com/#/t/4766 [^] (as well as a few others when I played around with ChartXYZ as well).
(0033597)
Ben Boeckel (Kitware) (developer)
2014-10-06 11:20

The branch has been merged.

 Issue History
Date Modified Username Field Change
2012-03-09 10:47 Marc Ferland New Issue
2012-03-09 10:47 Marc Ferland File Added: 0001-Check-the-Scene-pointer-before-dereferencing.patch
2012-03-09 10:50 Marcus D. Hanwell Assigned To => Marcus D. Hanwell
2012-03-09 10:50 Marcus D. Hanwell Status backlog => tabled
2012-03-09 13:30 Marcus D. Hanwell Note Added: 0028349
2012-03-09 13:56 Marc Ferland Note Added: 0028351
2012-03-09 14:22 Marc Ferland Note Added: 0028353
2013-07-22 20:02 Dave DeMarle Status tabled => backlog
2013-07-22 20:02 Dave DeMarle Note Added: 0031253
2014-10-02 11:47 Ben Boeckel (Kitware) Assigned To Marcus D. Hanwell => Ben Boeckel (Kitware)
2014-10-02 12:55 Ben Boeckel (Kitware) Note Added: 0033484
2014-10-02 12:55 Ben Boeckel (Kitware) Status backlog => gerrit review
2014-10-06 11:20 Ben Boeckel (Kitware) Note Added: 0033597
2014-10-06 11:20 Ben Boeckel (Kitware) Status gerrit review => closed
2014-10-06 11:20 Ben Boeckel (Kitware) Resolution open => fixed


Copyright © 2000 - 2018 MantisBT Team