slaclab / lc2-hdf5-110

Investigate hdf5 1.10 features like SWMR and virtual dataset for LCLS II
Apache License 2.0
0 stars 2 forks source link

Track Hdf5 bugs #4

Open davidslac opened 7 years ago

davidslac commented 7 years ago

This github issue will be to track hdf5 bugs that come up, below from correspondence with Barbara at help@hdfgroup.org

2/13/17 HDFFV-10130 h5dump and h5ls hang when viewing a VDS where the source files are smaller than VDS

2/13/17 HDFFV-10131 silent failure on creating the VDS mapping

2/9/17 HDFFV-10127 Application segfaults if close file with H5close without closing groups first

davidslac commented 7 years ago

3/28/17 HDFFV-10160 H5DOappend fails when using debug version of library, with invariants

VERSION:
  HDF5-1.10.0 patch1
USER:
  David Schneider
 SYNOPSIS:
  I have a larger program that uses H5DOappend. When I run against a debug build
  of the hdf5 library to check invariants, get trace messages, etc, it exists
  after the first call to H5DOappend, an invariant check fails and my program exits.
  The failure looks like a mistake, the complaint is that a file id is not > 0.

  I have re-created a similar weird failure in a small example, but the behavior is
  different - it does not fail right after my call to H5DOappend, but rather at the
  end of the program, but only if I don't explicitly close the file, will explain
  below - but I'm hoping that debugging this small example will debug my larger
  example.

MACHINE / OPERATING SYSTEM:
  linux rhel7
  Linux psanagpu104 3.10.0-327.36.1.el7.x86_64 #1 SMP Wed Aug 17 03:02:37 EDT 2016 x86_64 x86_64 x86_64 GNU/Linux

COMPILER:
  h5c++ --version
  g++ (GCC) 4.8.5 20150623 (Red Hat 4.8.5-4)

DESCRIPTION:
 Build hdf5 1.10.0 patch1 like so

./configure --prefix=$PREFIX \
   --with-szlib=$PREFIX \
   --enable-threadsafe \
   --enable-unsupported \
   --enable-cxx \
   --enable-build-mode=debug \
   --enable-trace \
   --enable-parallel

Now run this program (h5c++ program.cpp && ./a.out):
>>>>>>>>> program.cpp

#include <stdint.h>
#include "hdf5.h"
#include "hdf5_hl.h"

int main(int argc, char *argv[]) {
 hid_t fapl =  H5Pcreate(H5P_FILE_ACCESS);
 H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST);
 hid_t fid =  H5Fcreate("test_invariant.h5", H5F_ACC_TRUNC, H5P_DEFAULT, fapl);
 H5Pclose(fapl);
 hid_t small_group =  H5Gcreate2(fid, "small", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
   int rank = 1;
 hsize_t current_dim = 0;
 hsize_t maximum_dim = H5S_UNLIMITED;
 hsize_t chunk = 100;
   hid_t space_id =  H5Screate_simple(rank, &current_dim, &maximum_dim);
 hid_t plist_id =  H5Pcreate(H5P_DATASET_CREATE);
 H5Pset_chunk(plist_id, rank, &chunk);
   hid_t h5_dset =  H5Dcreate2(small_group, "data", H5T_NATIVE_INT64, space_id, H5P_DEFAULT, plist_id, H5P_DEFAULT);
   H5Sclose(space_id);
 H5Pclose(plist_id);
     unsigned index = 0;
 int64_t value = 0;
   H5DOappend( h5_dset, H5P_DEFAULT, index, 1, H5T_NATIVE_INT64, &value );
 H5Dclose(h5_dset);
 H5Gclose(small_group);
 //  H5Fclose( fid );
}
>>>>>>>>>>>>>>>

you should get

a.out: H5Fint.c:1421: H5F_close: Assertion `f->file_id > 0' failed.
Aborted (core dumped)

>>>>>>>>

if you comment out the H5DOapend line, or keep the H5DOappend but uncomment the H5Fclose( fid ) line at the bottom, it will work.