# Paraview immediately crashing when opening Xdmf file

**URL:** https://discourse.paraview.org/t/paraview-immediately-crashing-when-opening-xdmf-file/1111
**Category:** ParaView Support
**Created:** [January 7, 2019, 9:42am UTC](https://discourse.paraview.org/t/paraview-immediately-crashing-when-opening-xdmf-file/1111 "2019-01-07T09:42:38Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![raedma](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/r/a87d85/32.png) [@raedma](https://discourse.paraview.org/u/raedma)
#### Post date: [January 7, 2019, 9:42am UTC](https://discourse.paraview.org/t/paraview-immediately-crashing-when-opening-xdmf-file/1111/1 "2019-01-07T09:42:38Z")

</div>

Hi,

I am trying to write a Xdmf-file from my tool for visualization in ParaView using the HDF5 format.

I initially created a VTK-file from my model and used Paraview -\> File -\> Save Data -\> Xdmf Data File (\*.xmf) to create a working combination of light and heavy data in Xdmf/HDF5. Now I am trying to reverse engineer the file from my tool. I am using the Java HDF5 library from HDFView to create my own HDF5 file.

When opening the Xdmf from the original VTK everything works fine and I see my model. However, when I open my self-written Xdmf/HDF5 file (File -\> Open -\> mesh.xmf) Paraview immediately crashes. Is there a log-file somewhere?

I did try to compare the two HDF5-files using [HDFView](http://portal.hdfgroup.org/display/support/Download+HDFView) but the values as well as Data Types seem to be identical. One difference is the maximum dimension size. In my case it is set to the actual dimension size, while the version created by ParaView has “Unlimited” as the “Max Dimension Size”. The only other differences are in the chunking and allocation time for HDF5. Could this be a problem for ParaView?

Can someone please give me a hint where the corruption of my files comes from?

I attached the two versions:  
[error.rar](https://discourse.paraview.org/uploads/default/original/1X/26af7beb0cf6954603e1953f5f37d5b0e6bcddea.rar) (189.7 KB)  
[working.rar](https://discourse.paraview.org/uploads/default/original/1X/29feaa747a629c0308f772529bc603ec5eb3cdf7.rar) (199.0 KB)

* * *

Edit:

I edited the HDF5 file to have the same chunking and unlimited maximum dimension size, just as the original. However, ParaView still crashes when reading my file.

[error2.rar](https://discourse.paraview.org/uploads/default/original/1X/ee46ca5a89fdede55d51329aa71c94d1ce6b8ebd.rar) (196.4 KB)

* * *

Edit2:  
I compared the two HDF5-files using [VBinDiff](https://www.cjmweb.net/vbindiff/). Although the values in the datasets seem to be identical, the structure of the two files seems to be different. Are there any guidelines how to create a proper HDF5-file for the other than the description in [the wiki](https://www.paraview.org/Wiki/ParaView/Users_Guide/List_of_readers#XDMF_Reader)? Are there any preferences I have to set in the Java HDF5 library from HDFView?

---

<div class="post-metadata">

### Author: ![raedma](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/r/a87d85/32.png) [@raedma](https://discourse.paraview.org/u/raedma)
#### Post date: [January 8, 2019, 1:33pm UTC](https://discourse.paraview.org/t/paraview-immediately-crashing-when-opening-xdmf-file/1111/2 "2019-01-08T13:33:28Z")

</div>

I digged a little deeper. Which _IndexType_ and _IndexOrder_ does the ParaView reader expect from the HDF5 file? Is this relevant?

Edit:  
According to HDFView the Indexing Type and Order are equal in both files. So that can’t be it.

Edit2:  
I used `h5dump` to create an ASCII representation of both HDF5 files. The data is identical. Same result for `h5diff`. However, the one written by ParaView is 820k and mine is 814k.

I noticed a slight difference in the headers:

This is the header from the working HDF5-file generated by ParaView:

```
HDF5 "working.h5" {
GROUP "/" {
   DATASET "Data0" {
	  DATATYPE H5T_IEEE_F64LE
	  DATASPACE SIMPLE { ( 17952, 3 ) / ( H5S_UNLIMITED, H5S_UNLIMITED ) }
   }
   DATASET "Data1" {
	  DATATYPE H5T_STD_I32LE
	  DATASPACE SIMPLE { ( 89352 ) / ( H5S_UNLIMITED ) }
   }
}
}

```

and this is the header from my file:

```
HDF5 "mesh.h5" {
GROUP "/" {
   DATASET "Data0" {
	  DATATYPE H5T_IEEE_F64LE
	  DATASPACE SIMPLE { ( 17952, 3 ) / ( H5S_UNLIMITED, H5S_UNLIMITED ) }
	  DATA {
	  }
   }
   DATASET "Data1" {
	  DATATYPE H5T_STD_I32LE
	  DATASPACE SIMPLE { ( 89352 ) / ( H5S_UNLIMITED ) }
	  DATA {
	  }
   }
}
}

```

Notice the 2

```
	  DATA {
	  }

```

Any idea where these come from?

* * *

Edit3:  
The difference in the header seems to come from working on my file. If I generate a clean new file, both headers are identical.

---

<div class="post-metadata">

### Author: ![raedma](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/r/a87d85/32.png) [@raedma](https://discourse.paraview.org/u/raedma)
#### Post date: [January 8, 2019, 6:01pm UTC](https://discourse.paraview.org/t/paraview-immediately-crashing-when-opening-xdmf-file/1111/3 "2019-01-08T18:01:28Z")

</div>

I used `h5debug` to get some more information.

This is the result for the working file:

```
h5debug working.h5
Reading signature at address 0 (rel)
File Super Block...
File name (as opened): working.h5
File name (after resolving symlinks): working.h5
File access flags 0x00000000
File open reference count: 1
Address of super block: 0 (abs)
Size of userblock: 0 bytes
Superblock version number: 0
Free list version number: 0
Root group symbol table entry version number: 0
Shared header version number: 0
Size of file offsets (haddr_t type): 8 bytes
Size of file lengths (hsize_t type): 8 bytes
Symbol table leaf node 1/2 rank: 4
Symbol table internal node 1/2 rank: 16
Indexed storage internal node 1/2 rank: 32
File status flags: 0x00
Superblock extension address: UNDEF (rel)
Shared object header message table address: UNDEF (rel)
Shared object header message version number: 0
Number of shared object header message indexes: 0
Address of driver information block: UNDEF (rel)
Root group symbol table entry:
   Name offset into private heap: 0
   Object header address: 96
   Cache info type: Symbol Table
   Cached entry information:
	  B-tree address: 136
	  Heap address: 680

```

and this is the result for my file:

```
h5debug mesh.h5
Reading signature at address 0 (rel)
File Super Block...
File name (as opened): mesh.h5
File name (after resolving symlinks): mesh.h5
File access flags 0x00000000
File open reference count: 1
Address of super block: 0 (abs)
Size of userblock: 0 bytes
Superblock version number: 3
Free list version number: 0
Root group symbol table entry version number: 0
Shared header version number: 0
Size of file offsets (haddr_t type): 8 bytes
Size of file lengths (hsize_t type): 8 bytes
Symbol table leaf node 1/2 rank: 4
Symbol table internal node 1/2 rank: 16
Indexed storage internal node 1/2 rank: 32
File status flags: 0x00
Superblock extension address: UNDEF (rel)
Shared object header message table address: UNDEF (rel)
Shared object header message version number: 0
Number of shared object header message indexes: 0
Address of driver information block: UNDEF (rel)
Root group symbol table entry:
   Name offset into private heap: 0
   Object header address: 48
   Cache info type: Nothing Cached

```

The differences are in `Superblock version number` and `Root group symbol table entry`. Which version of the `HDF5` library does ParaView 5.5/5.6 use?

---

<div class="post-metadata">

### Author: ![raedma](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/r/a87d85/32.png) [@raedma](https://discourse.paraview.org/u/raedma)
#### Post date: [January 8, 2019, 7:43pm UTC](https://discourse.paraview.org/t/paraview-immediately-crashing-when-opening-xdmf-file/1111/4 "2019-01-08T19:43:32Z")

</div>

Ok, this seems to be it. I tried the whole thing with HDFView 2.13.0 and the included older HDF5 version. Using `h5debug` this generates:

```
h5debug mesh.h5
Reading signature at address 0 (rel)
File Super Block...
File name (as opened): mesh.h5
File name (after resolving symlinks): mesh.h5
File access flags 0x00000000
File open reference count: 1
Address of super block: 0 (abs)
Size of userblock: 0 bytes
Superblock version number: 2
Free list version number: 0
Root group symbol table entry version number: 0
Shared header version number: 0
Size of file offsets (haddr_t type): 8 bytes
Size of file lengths (hsize_t type): 8 bytes
Symbol table leaf node 1/2 rank: 4
Symbol table internal node 1/2 rank: 16
Indexed storage internal node 1/2 rank: 32
File status flags: 0x00
Superblock extension address: UNDEF (rel)
Shared object header message table address: UNDEF (rel)
Shared object header message version number: 0
Number of shared object header message indexes: 0
Address of driver information block: UNDEF (rel)
Root group symbol table entry:
   Name offset into private heap: 0
   Object header address: 48
   Cache info type: Nothing Cached

```

Which obviously still is not the same as from the `VTK` `XdmfWriter`, but it works. With `Superblock version number: 2` I can open my model in ParaView 5.5 & 5.6.

For the sake of completeness the working file created from the HDF5Object package in HDFView 2.13.0:  
[Fixed.rar](https://discourse.paraview.org/uploads/default/original/1X/b8ee08e565535c8558559fb752a15c2e163cacc4.rar) (196.3 KB)
