Possible VTKHDF bug

I’ve developed a VTKHDF writer for our code that is working for small development test cases, but which is causing errors in paraview for large application-like cases. I’m generating a MultiBlockDataSet file with 4 blocks. Each block is an UnstructuredGrid with multiple parts written by the individual MPI ranks. One possibly significant feature of this case is that many MPI ranks do not contain a piece of all blocks, so that there are lots of 0-sized parts in the different blocks.

If I only write the mesh (no cell or point arrays), the generated file loads into paraview without error and displays exactly what it should. I can toggle on/off the various blocks using the MultiBlock inspector panel and that does exactly as I expect, however after doing this 6 or 8 times paraview segfaults without any error message.

If I add a scalar cell array to the output I get the following error from paraview:

vtkDataSet.cxx:757 WARN| vtkUnstructuredGrid (0x37b43410): Cell array FUBAR with 1 components, has 0 tuples but there are only -1 cells.

Despite this the cell array displays exactly as expected.

Any thoughts about what might be going wrong? I’ll be looking into working up some smaller cases that show the same problems.

Please share an example data.

FYI @lgivord @Louis_Gombert

Can you please try pushing a single 0 value in your Offsets array when there are no cells?

I checked, and I am already doing that as the size of Offsets is supposed to be 1 greater than the number of cells. The NumberOf…are also 0, and no data is written to the Connectivity, Types, and Points arrays.

Here’s a google drive download link to my current case; it’s probably larger (10M) than you’d like to see uploaded here. If I can find a small test case I’ll upload it here.

Here’s a tiny example. 2 blocks, 1 hex cell in each block, 2 partitions (mpi ranks) for each block, one of which is 0-sized. There is also a cell array. This one doesn’t reproduce the “only -1 cells” error message, but for me it will cause paraview to segfault if the blocks are toggled off/on too many times.

demo.vtkhdf (14.8 KB)

Confirmed:


Thread 1 "paraview" received signal SIGSEGV, Segmentation fault.
0x00007fffe456db40 in ?? () from /usr/lib/libc.so.6
(gdb) bt
#0  0x00007fffe456db40 in ?? () from /usr/lib/libc.so.6
#1  0x00007fffe813ff9a in std::__fill_a1<signed char, signed char> (__first=0x0, __last=0xffffffffffffffff <error: Cannot access memory at address 0xffffffffffffffff>, __x=@0x7fffffffa244: 1 '\001') at /usr/include/c++/15.2.1/bits/stl_algobase.h:951
#2  0x00007fffe80bc6a7 in std::__fill_a<signed char*, signed char> (__first=0x0, __last=0xffffffffffffffff <error: Cannot access memory at address 0xffffffffffffffff>, __value=@0x7fffffffa244: 1 '\001') at /usr/include/c++/15.2.1/bits/stl_algobase.h:979
#3  std::fill<signed char*, signed char> (__first=0x0, __last=0xffffffffffffffff <error: Cannot access memory at address 0xffffffffffffffff>, __value=<optimized out>) at /usr/include/c++/15.2.1/bits/stl_algobase.h:1011
#4  vtkAOSDataArrayTemplate<signed char>::FillValue (this=0x5555604a1220, value=1 '\001') at /home/glow/dev/paraview/pv1/src/VTK/Common/Core/vtkAOSDataArrayTemplate.txx:362
#5  0x00007fffe1242172 in vtkBlockSelector::ComputeSelectedElements (this=0x555560497390, insidednessArray=0x5555604a1220) at /home/glow/dev/paraview/pv1/src/VTK/Filters/Extraction/vtkBlockSelector.cxx:125
#6  0x00007fffe13cc439 in vtkSelector::ProcessBlock (this=0x555560497390, inputBlock=0x7fffc00110d0, outputBlock=0x7fffc00070e0, forceFalse=false) at /home/glow/dev/paraview/pv1/src/VTK/Filters/Extraction/vtkSelector.cxx:50
#7  0x00007fffe13cceae in vtkSelector::ProcessDataObjectTree (this=0x555560497390, input=0x55555bce51f0, output=0x55556049c8a0, mode=vtkSelector::INCLUDE, compositeIndex=1) at /home/glow/dev/paraview/pv1/src/VTK/Filters/Extraction/vtkSelector.cxx:203
#8  0x00007fffe13cce8e in vtkSelector::ProcessDataObjectTree (this=0x555560497390, input=0x55555bc88ef0, output=0x55556102ef10, mode=vtkSelector::EXCLUDE, compositeIndex=0) at /home/glow/dev/paraview/pv1/src/VTK/Filters/Extraction/vtkSelector.cxx:198
#9  0x00007fffe13cc719 in vtkSelector::Execute (this=0x555560497390, input=0x55555bc88ef0, output=0x55556102ef10) at /home/glow/dev/paraview/pv1/src/VTK/Filters/Extraction/vtkSelector.cxx:96
#10 0x00007fffe12420d5 in vtkBlockSelector::Execute (this=0x555560497390, input=0x55555bc88ef0, output=0x55556102ef10) at /home/glow/dev/paraview/pv1/src/VTK/Filters/Extraction/vtkBlockSelector.cxx:118
#11 0x00007fffe1341792 in vtkExtractSelection::RequestData (this=0x55555ca738d0, inputVector=0x55555cbc0bc0, outputVector=0x55555cb5bcf0) at /home/glow/dev/paraview/pv1/src/VTK/Filters/Extraction/vtkExtractSelection.cxx:368
#12 0x00007fffedcaddab in vtkPVExtractSelection::RequestData (this=0x55555ca738d0, request=0x555560474160, inputVector=0x55555cbc0bc0, outputVector=0x55555cb5bcf0) at /home/glow/dev/paraview/pv1/src/VTKExtensions/Extraction/vtkPVExtractSelection.cxx:116
#13 0x00007fffeee86da6 in vtkDataObjectAlgorithm::ProcessRequest (this=0x55555ca738d0, request=0x555560474160, inputVector=0x55555cbc0bc0, outputVector=0x55555cb5bcf0) at /home/glow/dev/paraview/pv1/src/VTK/Common/ExecutionModel/vtkDataObjectAlgorithm.cxx:75
#14 0x00007fffeee97f08 in vtkExecutive::CallAlgorithm (this=0x55555cb5bbe0, request=0x555560474160, direction=1, inInfo=0x55555cbc0bc0, outInfo=0x55555cb5bcf0) at /home/glow/dev/paraview/pv1/src/VTK/Common/ExecutionModel/vtkExecutive.cxx:723
#15 0x00007fffeee89b11 in vtkDemandDrivenPipeline::ExecuteData (this=0x55555cb5bbe0, request=0x555560474160, inInfo=0x55555cbc0bc0, outInfo=0x55555cb5bcf0) at /home/glow/dev/paraview/pv1/src/VTK/Common/ExecutionModel/vtkDemandDrivenPipeline.cxx:447
#16 0x00007fffeee7d075 in vtkCompositeDataPipeline::ExecuteData (this=0x55555cb5bbe0, request=0x555560474160, inInfoVec=0x55555cbc0bc0, outInfoVec=0x55555cb5bcf0) at /home/glow/dev/paraview/pv1/src/VTK/Common/ExecutionModel/vtkCompositeDataPipeline.cxx:151
#17 0x00007fffeee89069 in vtkDemandDrivenPipeline::ProcessRequest (this=0x55555cb5bbe0, request=0x555560474160, inInfoVec=0x55555cbc0bc0, outInfoVec=0x55555cb5bcf0) at /home/glow/dev/paraview/pv1/src/VTK/Common/ExecutionModel/vtkDemandDrivenPipeline.cxx:246
#18 0x00007fffeefeb56f in vtkStreamingDemandDrivenPipeline::ProcessRequest (this=0x55555cb5bbe0, request=0x555560474160, inInfoVec=0x55555cbc0bc0, outInfoVec=0x55555cb5bcf0)
    at /home/glow/dev/paraview/pv1/src/VTK/Common/ExecutionModel/vtkStreamingDemandDrivenPipeline.cxx:331

Something is wrong in the data itself, not sure what yet, please open an issue @nncarlson: https://gitlab.kitware.com/vtk/vtk/-/issues

Done: https://gitlab.kitware.com/vtk/vtk/-/issues/19923. Thanks for the quick feedback!