<div dir="ltr">Thanks Bogdan,<div><br></div><div>that's not helping me but someone else might have some idea.</div><div><br></div><div>Seb</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Oct 23, 2014 at 12:19 PM, Bogdan Daqui Herrera <span dir="ltr"><<a href="mailto:bdaqui@simscale.de" target="_blank">bdaqui@simscale.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Certainly. I should mention, I am using a pre-compiled version of Paraview 4.1 bundled with Salome (Ubuntu package).<br>
<br>
Here it is (using pReader->SetForceOutputTypeToMultiBlock(1)):<br>
ERROR: In /misc/dn47/SALOME/PRODUCTS/7x/opt/Ubuntu.13.10.64/7.4.0/tmp/ParaView-4.1.0_SRC/ParaViewCore/VTKExtensions/Default/vtkXMLCollectionReader.cxx, line 316<br>
vtkPVDReader (0x6559e0): Error creating "vtkXMLMultiBlockDataReader" using vtkPVInstantiator.<br>
<br>
Program received signal SIGSEGV, Segmentation fault.<br>
0x00007ffff65c4270 in vtkXMLCollectionReader::ReadXMLDataImpl() ()<br>
from /opt/salomeUbuntu_740/ParaView-4.1.0/lib/paraview-4.1/libvtkPVVTKExtensionsDefault-pv4.1.so.1<br>
#0 0x00007ffff65c4270 in vtkXMLCollectionReader::ReadXMLDataImpl() ()<br>
from /opt/salome_740/ParaView-4.1.0/lib/paraview-4.1/libvtkPVVTKExtensionsDefault-pv4.1.so.1<br>
#1 0x00007ffff68cc128 in vtkXMLReader::RequestData(vtkInformation*, vtkInformationVector**, vtkInformationVector*) () from<br>
/opt/salome_740/ParaView-4.1.0/lib/paraview-4.1/libvtkIOXML-pv4.1.so.1<br>
#2 0x00007ffff68cd35d in vtkXMLReader::ProcessRequest(vtkInformation*, vtkInformationVector**, vtkInformationVector*) () from<br>
/opt/salome_740/ParaView-4.1.0/lib/paraview-4.1/libvtkIOXML-pv4.1.so.1<br>
#3 0x00007ffff7b97fd0 in vtkExecutive::CallAlgorithm(vtkInformation*, int, vtkInformationVector**, vtkInformationVector*) ()<br>
from /opt/salome_740/ParaView-4.1.0/lib/paraview-4.1/libvtkCommonExecutionModel-pv4.1.so.1<br>
#4 0x00007ffff7b93447 in vtkDemandDrivenPipeline::ExecuteData(vtkInformation*, vtkInformationVector**, vtkInformationVector*) ()<br>
from /opt/salome_740/ParaView-4.1.0/lib/paraview-4.1/libvtkCommonExecutionModel-pv4.1.so.1<br>
#5 0x00007ffff7b91181 in vtkCompositeDataPipeline::ExecuteData(vtkInformation*, vtkInformationVector**, vtkInformationVector*) ()<br>
from /opt/salome_740/ParaView-4.1.0/lib/paraview-4.1/libvtkCommonExecutionModel-pv4.1.so.1<br>
#6 0x00007ffff7b95bb1 in vtkDemandDrivenPipeline::ProcessRequest(vtkInformation*, vtkInformationVector**, vtkInformationVector*) ()<br>
from /opt/salome_740/ParaView-4.1.0/lib/paraview-4.1/libvtkCommonExecutionModel-pv4.1.so.1<br>
#7 0x00007ffff7ba8c21 in vtkStreamingDemandDrivenPipeline::ProcessRequest(vtkInformation*, vtkInformationVector**, vtkInformationVector*) ()<br>
from /opt/salome_740/ParaView-4.1.0/lib/paraview-4.1/libvtkCommonExecutionModel-pv4.1.so.1<br>
#8 0x00007ffff7b9486d in vtkDemandDrivenPipeline::UpdateData(int) ()<br>
from /opt/salome_740/ParaView-4.1.0/lib/paraview-4.1/libvtkCommonExecutionModel-pv4.1.so.1<br>
#9 0x00007ffff7ba9765 in vtkStreamingDemandDrivenPipeline::Update(int) ()<br>
from /opt/salome_740/ParaView-4.1.0/lib/paraview-4.1/libvtkCommonExecutionModel-pv4.1.so.1<br>
#10 0x0000000000414fbf in testing::TestingIO::read (this=0x652b30, fileName=..., pMultiBlockDataSet=...)<br>
at /home/.../someProject/src/testing.cpp:85<br>
<br>
<br>
Please let me know if you need something additional<br>
<span class="">On 10/23/2014 07:51 PM, Sebastien Jourdain wrote:<br>
> If you provide the stack trace, that may be helpful.<br>
><br>
> Seb<br>
><br>
</span><div><div class="h5">> On Thu, Oct 23, 2014 at 10:36 AM, Bogdan Daqui Herrera <<a href="mailto:bdaqui@simscale.de">bdaqui@simscale.de</a> <mailto:<a href="mailto:bdaqui@simscale.de">bdaqui@simscale.de</a>>> wrote:<br>
><br>
> Hi Seb,<br>
><br>
> Thanks for the quick reply. Yes the project is managed with CMake. I have not however been able to find the relevant posts by Marcus (in the users list). Is<br>
> that in the users or developers mailing list?<br>
><br>
> It does sound like it could be a problem with some initialization, as you can see below.<br>
><br>
> One short update, it looks like setting ForceMultiBlockDataSet Output with:<br>
> pReader->SetForceOutputTypeToMultiBlock(1);<br>
> leads to the segmentation fault at Update() (The deepcopy is never reached). With or without setting the previous line, the error<br>
> vtkPVDReader (0x1cb49e0): Error creating "vtkXMLMultiBlockDataReader" using vtkPVInstantiator.<br>
><br>
> The code looks like this now:<br>
> vtkSmartPointer < vtkPVDReader > pReader = vtkSmartPointer < vtkPVDReader >::New();<br>
> pReader->SetFileName("/some/file.pvd");<br>
> pReader->Update(); (where the error is triggered)<br>
><br>
> Kind Regards,<br>
> Bogdan<br>
><br>
> On 10/23/2014 04:47 PM, Sebastien Jourdain wrote:<br>
> > Hi Bogdan,<br>
> ><br>
> > here are some issue in your code:<br>
> ><br>
> > vtkSmartPointer <vtkPVDReader> pReader = vtkPVDReader::New(); // <== Memory LEAK<br>
> > // Should be either<br>
> > // vtkNew<vtkPVDReader> pReader;<br>
> > // vtkSmartPointer<vtkPVDReader> pReader = vtkSmartPointer<vtkPVDReader>::New()<br>
> ><br>
> > Then here on a "NULL" object you try to call a method.<br>
> ><br>
> > vtkMultiBlockDataSet* pMultiBlockDataSet->DeepCopy(vtkMultiBlockDataSet::SafeDownCast(pReader->GetOutputDataObject(0)));<br>
> ><br>
> > Should be something like that:<br>
> ><br>
> > vtkNew< vtkMultiBlockDataSet > pMultiBlockDataSet;<br>
> > pMultiBlockDataSet->DeepCopy(vtkMultiBlockDataSet::SafeDownCast(pReader->GetOutputDataObject(0)));<br>
> ><br>
> > Then you might have some other issue where pReader output being empty/null, but for that I don't know.<br>
> ><br>
> > Are you managing your project with CMake? Did you include the necessary file with the proper dependency declaration. This seems to be related to the factory not<br>
> > being properly initialized. You can search the mailing list, Marcus did answer several questions about that.<br>
> ><br>
> > Seb<br>
> ><br>
> ><br>
> ><br>
</div></div>> > On Thu, Oct 23, 2014 at 7:26 AM, Bogdan Daqui Herrera <<a href="mailto:bdaqui@simscale.de">bdaqui@simscale.de</a> <mailto:<a href="mailto:bdaqui@simscale.de">bdaqui@simscale.de</a>> <mailto:<a href="mailto:bdaqui@simscale.de">bdaqui@simscale.de</a><br>
<div><div class="h5">> <mailto:<a href="mailto:bdaqui@simscale.de">bdaqui@simscale.de</a>>>> wrote:<br>
> ><br>
> > Hello all,<br>
> ><br>
> > I am attempting to write some code in c++ which uses the vtkPVDReader from the paraview library to read a series of vtm files. However I am<br>
> encountering some<br>
> > problems and I am not sure whether there is something I am missing or whether this could be a bug.<br>
> ><br>
> > I am trying to use the reader in the following manner:<br>
> > My Code:<br>
> > vtkSmartPointer <vtkPVDReader> pReader = vtkPVDReader::New();<br>
> > pReader->SetForceOutputTypeToMultiBlock(1);<br>
> > pReader->SetFileName("/some/fileName.pvd");<br>
> > pReader->Update();<br>
> > vtkMultiBlockDataSet* pMultiBlockDataSet->DeepCopy(vtkMultiBlockDataSet::SafeDownCast(pReader->GetOutputDataObject(0)));<br>
> ><br>
> > Error:<br>
> > The error occurs at Update() with the following result:<br>
> > ERROR: In /misc/dn47/SALOME/PRODUCTS/7x/opt/Ubuntu.13.10.64/7.4.0/tmp/ParaView-4.1.0_SRC/ParaViewCore/VTKExtensions/Default<br>
> > /vtkXMLCollectionReader.cxx, line 316<br>
> > vtkPVDReader (0x224d9e0): Error creating "vtkXMLMultiBlockDataReader" using vtkPVInstantiator.<br>
> > Segmentation fault<br>
> ><br>
> > Possible error Source<br>
> > The code concerning line 316 from vtkXMLCollectionReader.cxx is:<br>
> ><br>
> > // Use the instantiator to create the reader.<br>
> > vtkObject* o = vtkPVInstantiator::CreateInstance(rname);<br>
> > vtkXMLReader* reader = vtkXMLReader::SafeDownCast(o);<br>
> > this->Internal->Readers[index] = reader;<br>
> > if(reader)<br>
> > {<br>
> > reader->Delete();<br>
> > }<br>
> > else<br>
> > {<br>
> > // The class was not registered with the instantiator.<br>
> > vtkErrorMacro("Error creating \"" << rname<br>
> > << "\" using vtkPVInstantiator.");<br>
> > if(o)<br>
> > {<br>
> > o->Delete();<br>
> > }<br>
> > }<br>
> > }<br>
> ><br>
> > I have isolated the following lines and tested them independently:<br>
> > vtkObject* o = vtkPVInstantiator::CreateInstance(rname);<br>
> > vtkXMLReader* reader = vtkXMLReader::SafeDownCast(o);<br>
> ><br>
> > The pointer "vtkObject* o" is NULL regardless of the class name I pass to instantiate, and I can imagine something like that happening in the library,<br>
> too and<br>
> > causing the segmentation fault, when calling a SafeDownCast(o) (which is NULL).<br>
> ><br>
> ><br>
> > Any suggestions on how to deal with this problem or if you would be so kind to point me to an example for an alternative solution (Could be<br>
> vtkFileSeriesReader,<br>
> > but this fails, as well in my case) would be appreciated.<br>
> ><br>
> > Kind Regards,<br>
> > Bogdan<br>
> ><br>
> > P.S.: Using the PVDReader from python code works flawlessly, which is also quite confusing, as to why it would fail in the C++ code.<br>
> ><br>
> > --<br>
> > Bogdan Daqui<br>
> > Software Development<br>
> ><br>
> > SimScale GmbH<br>
> > Lichtenbergstraße 8<br>
> > 85748 Garching bei München<br>
> ><br>
> > Phone: +49 (0)89 3398 4078<br>
</div></div>> > Email: <a href="mailto:bdaqui@simscale.de">bdaqui@simscale.de</a> <mailto:<a href="mailto:bdaqui@simscale.de">bdaqui@simscale.de</a>> <mailto:<a href="mailto:bdaqui@simscale.de">bdaqui@simscale.de</a> <mailto:<a href="mailto:bdaqui@simscale.de">bdaqui@simscale.de</a>>><br>
<span class="">> ><br>
> > Amtsgericht München, HRB 201813<br>
> > Geschäftsführer: Vincenz Dölle & David Heiny<br>
> ><br>
> > <a href="http://www.simscale.de" target="_blank">http://www.simscale.de</a><br>
> > _______________________________________________<br>
</span>> > Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a> <<a href="http://www.kitware.com" target="_blank">http://www.kitware.com</a>> <<a href="http://www.kitware.com" target="_blank">http://www.kitware.com</a>><br>
<div class="HOEnZb"><div class="h5">> ><br>
> > Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
> ><br>
> > Please keep messages on-topic and check the ParaView Wiki at: <a href="http://paraview.org/Wiki/ParaView" target="_blank">http://paraview.org/Wiki/ParaView</a><br>
> ><br>
> > Follow this link to subscribe/unsubscribe:<br>
> > <a href="http://public.kitware.com/mailman/listinfo/paraview" target="_blank">http://public.kitware.com/mailman/listinfo/paraview</a><br>
> ><br>
> ><br>
><br>
><br>
</div></div></blockquote></div><br></div>