h5py - HDF5 library version mismatched error causes crash of QGIS on startup of Box

Issue #747 on hold
Fabian Thiel created an issue

A mismatch in HDF library versions might currently cause a crash of QGIS if the EnMAP-Box is started. Usually this happens without any error message (except QGIS is started from the Terminal, see error below).

Observed on Ubuntu 20.04

h5py 3.4.0

root@:/# apt list --installed | grep hdf                                  

hdf5-helpers/focal,now 1.10.4+repack-11ubuntu1 amd64 [installed,automatic]      
libhdf4-0-alt/focal,now 4.2.14-1ubuntu1 amd64 [installed,automatic]             
libhdf4-alt-dev/focal,now 4.2.14-1ubuntu1 amd64 [installed,automatic]           
libhdf5-103/focal,now 1.10.4+repack-11ubuntu1 amd64 [installed,automatic]       
libhdf5-cpp-103/focal,now 1.10.4+repack-11ubuntu1 amd64 [installed,automatic]   
libhdf5-dev/focal,now 1.10.4+repack-11ubuntu1 amd64 [installed,automatic]       

Workaround

Two potential workarounds:

1. Install h5py using your systems package manager (apt on Ubuntu, i.e., apt install python3-h5py). Make sure to uninstall previous pip installation with python3 -m pip uninstall h5py.

OR

2. In QGIS go to Settings --> Options --> System, under Environment add the variable HDF5_DISABLE_VERSION_CHECK with a value of 1. Note that this does not fix potential functionality issues of the h5py library, so be careful when using the PRISMA Import.

Error/crash message

Warning! ***HDF5 library version mismatched error***                                  
The HDF5 header files used to compile this application do not match                   
the version used by the HDF5 library to which this application is linked.             
Data corruption or segmentation faults may occur if the application continues.        
This can happen when an application was compiled by one version of HDF5 but           
linked with a different version of static or shared HDF5 library.                     
You should recompile the application or check your shared library related             
settings such as 'LD_LIBRARY_PATH'.                                                   
'HDF5_DISABLE_VERSION_CHECK' environment variable is set to 1, application will       
continue at your own risk.                                                            
Headers are 1.12.1, library is 1.10.4    

            SUMMARY OF THE HDF5 CONFIGURATION                                         
            =================================                                         
General Information:                                                                                    
-------------------                                                                                     
                   HDF5 Version: 1.10.4                                                                 
                  Configured on: Mon, 13 Apr 2020 12:15:08 +0000                                        
                  Configured by: Debian                                                                 
                    Host system: x86_64-pc-linux-gnu                                                    
              Uname information: Debian                                                                 
                       Byte sex: little-endian                                                          
             Installation point: /usr                                                                   
                    Flavor name: serial                                                                 

Compiling Options:                                                                                      
------------------                                                                                      
                     Build Mode: production                                                             
              Debugging Symbols: no                                                                     
                        Asserts: no                                                                     
                      Profiling: no                                                                     
             Optimization Level: high                                                                   

Linking Options:                                                                                        
----------------                                                                                        
                      Libraries: static, shared                                                         
  Statically Linked Executables:                                                                        
                        LDFLAGS: -Wl,-Bsymbolic-functions -Wl,-z,relro                                  
                     H5_LDFLAGS: -Wl,--version-script,$(top_srcdir)/debian/map_serial.ver               
                     AM_LDFLAGS:                                                                        
                Extra libraries: -lpthread -lsz -lz -ldl -lm                                            
                       Archiver: ar                                                                     
                       AR_FLAGS: cr                                                                     
                         Ranlib: x86_64-linux-gnu-ranlib                                                

Languages:                                                                                              
----------                                                                                              
                              C: yes                                                                    
                     C Compiler: /usr/bin/gcc                                                           
                       CPPFLAGS: -Wdate-time -D_FORTIFY_SOURCE=2                                        
                    H5_CPPFLAGS: -D_GNU_SOURCE -D_POSIX_C_SOURCE=200112L   -DNDEBUG -UH5_DEBUG_API      
                    AM_CPPFLAGS:                                                                        
                        C Flags: -g -O2 -fdebug-prefix-map=$(top_srcdir)=. -fstack-protector-strong -Wfo
rmat -Werror=format-security                                                                            
                     H5 C Flags:  -std=c99  -pedantic -Wall -Wextra -Wbad-function-cast -Wc++-compat -Wc
ast-align -Wcast-qual -Wconversion -Wdeclaration-after-statement -Wdisabled-optimization -Wfloat-equal -
Wformat=2 -Winit-self -Winvalid-pch -Wmissing-declarations -Wmissing-include-dirs -Wmissing-prototypes -
Wnested-externs -Wold-style-definition -Wpacked -Wpointer-arith -Wredundant-decls -Wshadow -Wstrict-prot
otypes -Wswitch-default -Wswitch-enum -Wundef -Wunused-macros -Wunsafe-loop-optimizations -Wwrite-string
s -finline-functions -s -Wno-inline -Wno-aggregate-return -Wno-missing-format-attribute -Wno-missing-nor
eturn -O                                                                                                
                     AM C Flags:                                                                        
               Shared C Library: yes                                                                    
                     AM C Flags:                                                                 [0/702]
               Shared C Library: yes                                                                    
               Static C Library: yes                                                                    


                        Fortran: yes                                                                    
               Fortran Compiler: /usr/bin/gfortran                                                      
                  Fortran Flags: -g -O2 -fdebug-prefix-map=$(top_srcdir)=. -fstack-protector-strong     
               H5 Fortran Flags:  -pedantic -Wall -Wextra -Wunderflow -Wimplicit-interface -Wsurprising 
-Wno-c-binding-type  -s -O2                                                                             
               AM Fortran Flags:                                                                        
         Shared Fortran Library: yes                                                                    
         Static Fortran Library: yes                                                                    

                            C++: yes                                                                    
                   C++ Compiler: /usr/bin/g++                                                           
                      C++ Flags: -g -O2 -fdebug-prefix-map=$(top_srcdir)=. -fstack-protector-strong -Wfo
rmat -Werror=format-security                                                                            
                   H5 C++ Flags:   -pedantic -Wall -W -Wundef -Wshadow -Wpointer-arith -Wcast-qual -Wcas
t-align -Wwrite-strings -Wconversion -Wredundant-decls -Winline -Wsign-promo -Woverloaded-virtual -Wold-
style-cast -Weffc++ -Wreorder -Wnon-virtual-dtor -Wctor-dtor-privacy -Wabi -finline-functions -s -O     
                   AM C++ Flags:                                                                        
             Shared C++ Library: yes                                                                    
             Static C++ Library: yes                                                                    

                           Java: yes                                                                    
                  Java Compiler: /usr/bin/java (openjdk 11.0.7-ea 2020-04-14)                           


Features:                                                                                               
---------                                                                                               
                   Parallel HDF5: no                                                                    
Parallel Filtered Dataset Writes: no                                                                    
              Large Parallel I/O: no                                                                    
              High-level library: yes                                                                   
                    Threadsafety: yes                                                                   
             Default API mapping: v18                                                                   
  With deprecated public symbols: yes                                                                   
          I/O filters (external): deflate(zlib),szip(encoder)                                           
                             MPE: no                                                                    
                      Direct VFD: no                                                                    
                         dmalloc: no                                                                    
  Packages w/ extra debug output: none                                                                  
                     API tracing: no                                                                    
            Using memory checker: no                                                                    
 Memory allocation sanity checks: no                                                                    
             Metadata trace file: no                                                                    
          Function stack tracing: no                                                                    
       Strict file format checks: no                                                                    
    Optimization instrumentation: no                                                                    

Comments (7)

  1. Fabian Thiel reporter

    Current fix/workaround is to set the environment variable or try to (re)install the h5py package

  2. Benjamin Jakimow

    @Fabian Thiel is it possible to reproduce this error in a few lines of bash / python code?
    I am asking because this would allow us to open a QGIS issue and might offer a way to sovle it by adding it to the QGIS install dependencies

  3. Log in to comment