View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0010528VTK(No Category)public2010-04-09 10:112016-07-07 09:23
ReporterPaul Melis 
Assigned ToAndy Bauer 
PrioritynormalSeveritycrashReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version7.1.0 
Summary0010528: vtkXMLUnstructuredGridWriter segfault
DescriptionSee the attached Python script which loads a polydata .vtp file containing only points and associated scalar arrays. The polydata gets clipped and then saved to a .vtu file, but a segfault occurs.
Steps To ReproduceSave both files in the sample place, run bug.py
Additional Informationvtk 5.4.2

(gdb) bt
#0 0xb6785567 in vtkXMLUnstructuredDataWriter::ConvertCells () from /home/paulm/vtk/lib/vtk-5.4/libvtkIO.so.5.4
#1 0xb6786d56 in vtkXMLUnstructuredDataWriter::WriteCellsInline () from /home/paulm/vtk/lib/vtk-5.4/libvtkIO.so.5.4
#2 0xb678a0e8 in vtkXMLUnstructuredGridWriter::WriteInlinePiece () from /home/paulm/vtk/lib/vtk-5.4/libvtkIO.so.5.4
#3 0xb678710d in vtkXMLUnstructuredDataWriter::WriteInlineMode () from /home/paulm/vtk/lib/vtk-5.4/libvtkIO.so.5.4
#4 0xb678523a in vtkXMLUnstructuredDataWriter::WriteAPiece () from /home/paulm/vtk/lib/vtk-5.4/libvtkIO.so.5.4
#5 0xb6786286 in vtkXMLUnstructuredDataWriter::ProcessRequest () from /home/paulm/vtk/lib/vtk-5.4/libvtkIO.so.5.4
#6 0xb6b51512 in vtkExecutive::CallAlgorithm () from /home/paulm/vtk/lib/vtk-5.4/libvtkFiltering.so.5.4
#7 0xb6b48e4d in vtkDemandDrivenPipeline::ExecuteData () from /home/paulm/vtk/lib/vtk-5.4/libvtkFiltering.so.5.4
#8 0xb6b4c56b in vtkDemandDrivenPipeline::ProcessRequest () from /home/paulm/vtk/lib/vtk-5.4/libvtkFiltering.so.5.4
0000009 0xb6c5d7ed in vtkStreamingDemandDrivenPipeline::ProcessRequest () from /home/paulm/vtk/lib/vtk-5.4/libvtkFiltering.so.5.4
#10 0xb6b4ae3e in vtkDemandDrivenPipeline::UpdateData () from /home/paulm/vtk/lib/vtk-5.4/libvtkFiltering.so.5.4
0000011 0xb6c5d56b in vtkStreamingDemandDrivenPipeline::Update () from /home/paulm/vtk/lib/vtk-5.4/libvtkFiltering.so.5.4
#12 0xb6b50b33 in vtkExecutive::Update () from /home/paulm/vtk/lib/vtk-5.4/libvtkFiltering.so.5.4
#13 0xb6b496ad in vtkDemandDrivenPipeline::Update () from /home/paulm/vtk/lib/vtk-5.4/libvtkFiltering.so.5.4
#14 0xb6c5729d in vtkStreamingDemandDrivenPipeline::Update () from /home/paulm/vtk/lib/vtk-5.4/libvtkFiltering.so.5.4
#15 0xb6af0435 in vtkAlgorithm::Update () from /home/paulm/vtk/lib/vtk-5.4/libvtkFiltering.so.5.4
#16 0xb678e9d4 in vtkXMLWriter::Write () from /home/paulm/vtk/lib/vtk-5.4/libvtkIO.so.5.4
#17 0xb69305be in PyvtkXMLWriter_Write () from /home/paulm/vtk/lib/vtk-5.4/libvtkIOPythonD.so.5.4
#18 0x080c9ab3 in PyEval_EvalFrameEx (f=0x817747c, throwflag=0) at ../Python/ceval.c:3573
#19 0x080cb1f7 in PyEval_EvalCodeEx (co=0xb75449f8, globals=0xb7593acc, locals=0xb7593acc, args=0x0, argcount=0, kws=0x0, kwcount=0, defs=0x0, defcount=0, closure=0x0) at ../Python/ceval.c:2836
#20 0x080cb347 in PyEval_EvalCode (co=0xb75449f8, globals=0xb7593acc, locals=0xb7593acc) at ../Python/ceval.c:494
#21 0x080ea818 in PyRun_FileExFlags (fp=0x816b008, filename=0xbfcac33f "./bug.py", start=257, globals=0xb7593acc, locals=0xb7593acc, closeit=1, flags=0xbfcaaa98) at ../Python/pythonrun.c:1273
#22 0x080eaab9 in PyRun_SimpleFileExFlags (fp=0x816b008, filename=0xbfcac33f "./bug.py", closeit=1, flags=0xbfcaaa98) at ../Python/pythonrun.c:879
#23 0x08059335 in Py_Main (argc=1, argv=0xbfcaab64) at ../Modules/main.c:523
#24 0x080587f2 in main (argc=-1232770872, argv=0x2) at ../Modules/python.c:23
TagsNo tags attached.
Project
Type
Attached Files? file icon bug.py [^] (446 bytes) 2010-04-09 10:11
? file icon doh.vtp [^] (1,109 bytes) 2010-04-09 10:11

 Relationships

  Notes
(0020302)
David Doria (reporter)
2010-04-20 17:17

I tried it in c++ and got the same segfault.

Here is the code to reproduce in c++:

#include <vtkSmartPointer.h>
#include <vtkClipDataSet.h>
#include <vtkBox.h>
#include <vtkPolyData.h>
#include <vtkXMLPolyDataReader.h>
#include <vtkXMLUnstructuredGridWriter.h>
#include <vtkUnstructuredGrid.h>

int main (int argc, char *argv[])
{
  vtkSmartPointer<vtkXMLPolyDataReader> dr =
      vtkSmartPointer<vtkXMLPolyDataReader>::New();
  dr->SetFileName("doh.vtp");
  dr->Update();
  
  vtkSmartPointer<vtkBox> box =
      vtkSmartPointer<vtkBox>::New();
  box->SetBounds(0, 0.65, -0.982, 0.984, -1.03, -0.302);
  
  vtkSmartPointer<vtkClipDataSet> clip =
      vtkSmartPointer<vtkClipDataSet>::New();
  clip->SetInputConnection(dr->GetOutputPort());
  clip->SetClipFunction(box);
  clip->Update();
    
  vtkUnstructuredGrid* ug = clip->GetOutput();
  cout << ug->GetNumberOfPoints() << endl;
  
  vtkSmartPointer<vtkXMLUnstructuredGridWriter> dw =
      vtkSmartPointer<vtkXMLUnstructuredGridWriter>::New();
  dw->SetInputConnection(clip->GetOutputPort());
  dw->SetDataModeToAscii();
  dw->SetFileName("doh.vtu");
  dw->Write();

  
  return EXIT_SUCCESS;
}


If you comment
  dw->SetDataModeToAscii();

it does not segfault.
(0027742)
Paul Melis (reporter)
2011-11-29 04:44

Still crashes with VTK 5.8.0
(0036326)
Andy Bauer (developer)
2016-07-07 09:22

Fixed in https://gitlab.kitware.com/vtk/vtk/merge_requests/1648#note_135580 [^]

 Issue History
Date Modified Username Field Change
2010-04-09 10:11 Paul Melis New Issue
2010-04-09 10:11 Paul Melis File Added: bug.py
2010-04-09 10:11 Paul Melis File Added: doh.vtp
2010-04-20 17:17 David Doria Note Added: 0020302
2011-06-16 13:11 Zack Galbreath Category => (No Category)
2011-11-29 04:44 Paul Melis Note Added: 0027742
2016-07-06 17:13 Andy Bauer Assigned To => Andy Bauer
2016-07-06 17:13 Andy Bauer Status expired => backlog
2016-07-07 09:22 Andy Bauer Note Added: 0036326
2016-07-07 09:22 Andy Bauer Status backlog => closed
2016-07-07 09:23 Andy Bauer Resolution open => fixed
2016-07-07 09:23 Andy Bauer Fixed in Version => 7.1.0


Copyright © 2000 - 2018 MantisBT Team