BigDataViewer Application crashes loading gzipped hdf5

I have been working with this application developed by @Christian_Tischer (based on bigdataviewer and the ImageJ 3d viewer), that can browse segmentations and also load objects from this segmentation and display them in a 3D viewer.

Sometimes, when the application loads an object from hdf5, it throws an exception and freezes, see screenshot below. The issue seems to be related to reading from hdf5 with gzip compression.
This is not easily reproducible (after the crash, I can select the same object and it loads normally).

In general, I have seen a few (seemingly) non-deterministic issues with hdf5 and gzip compression
over time and I was wondering if anyone else has encountered this too and developed strategies to deal with it. In this case, it would be good to find some way to catch the exception thrown by hdf5 / imglib2 and capture it properly, so the application does not crash.

cc @tpietzsch

1 Like

I do not know, but I think part of the issue could be that both the Bdv fetcherThreads as well as another part of the code are both trying to read from the same SpimData object?!

In other words:

BdvFunctions.show( spimData ); // User scrolls around in Bdv...

// at the same time programmatic access to the same data:
final BasicMultiResolutionImgLoader imgLoader = ( BasicMultiResolutionImgLoader ) spimData.getSequenceDescription().getImgLoader();
RAI rai = ( RandomAccessibleInterval ) imgLoader.getSetupImgLoader( 0 ).getImage( t, level );

Maybe also @hanslovsky has an idea?

Unfortunately, I do not use BDV loaders and am not familiar with their internals.

1 Like

That would not be a problem. Everything goes through the same backend.

Only, If somebody else is accessing the same HDF5 file directly (not through the SpimData object), that could potentially be a problem.