Assert in H5T_conv_struct_free when using Compression

The assertion occurs when using the HDF5 v1.8.16 Thread Safe with Zlib and
the H5_term_library() function is called after having closed a file which
contains a chunked, *non-compressed* Armadillo Matrix of doubles (i.e.,
arma::mat).

The assertion *does not occur* when using the HDF5 v1.8.16 Thread Safe *without
Zlib* and the H5_term_library() function is called after having closed a
file which contains a chunked, *non-compressed* Armadillo Matrix of doubles
(i.e., arma::mat).

The H5 file is created with the ‘H5F_CLOSE_STRONG’ property

GDB dump:

Program received signal SIGABRT, Aborted.

0x0000003ca7032625 in raise () from /lib64/libc.so.6

(gdb) up

#1 0x0000003ca7033e05 in abort () from /lib64/libc.so.6

(gdb)

#2 0x0000003ca702b74e in __assert_fail_base () from /lib64/libc.so.6

(gdb)

#3 0x0000003ca702b810 in __assert_fail () from /lib64/libc.so.6

(gdb)

#4 0x00007ffff7584e1c in H5T_conv_struct_free (priv=0xab6e30) at
H5Tconv.c:1845

1845 HDassert(status >= 0);

(gdb)

#5 0x00007ffff7587180 in H5T__conv_struct_opt (src_id=-1, dst_id=-1,
cdata=0xab2410, nelmts=0, buf_stride=0, bkg_stride=0,

    _buf=0x0, _bkg=0x0, dxpl_id=167772168) at H5Tconv.c:2458

2458 cdata->priv = H5T_conv_struct_free((H5T_conv_struct_t
*)(cdata->priv));

(gdb)

#6 0x00007ffff7564c0f in H5T_term_interface () at H5T.c:1410

1410 if((path->func)((hid_t)FAIL, (hid_t)FAIL,
&(path->cdata), (size_t)0,

(gdb)

#7 0x00007ffff7279134 in H5_term_library () at H5.c:289

289 pending += DOWN(T);

(gdb)

#8 0x00007ffff727b082 in H5close () at H5.c:859

859 H5_term_library();

(gdb)

#9 0x00007ffff6fffa5f in H5::H5Library::termH5cpp() ()

   from
/local/mnt/workspace/pcereck/ra_comp/pensim/ThirdParty/hdf5/hdf5-1.8.16/thread.safe.with.zlib/lib/libhdf5_cpp.so.11

(gdb) up

#10 0x0000003ca7035ebd in __cxa_finalize () from /lib64/libc.so.6

(gdb)

#11 0x00007ffff6ffc1e6 in __do_global_dtors_aux ()

   from
/local/mnt/workspace/pcereck/ra_comp/pensim/ThirdParty/hdf5/hdf5-1.8.16/thread.safe.with.zlib/lib/libhdf5_cpp.so.11

(gdb)

Here is the *H5T_conv_struct_free*() function (the assert on line 1845 is
highlighted):

static H5T_conv_struct_t *

*H5T_conv_struct_free*(H5T_conv_struct_t *priv)

{

    int *src2dst = priv->src2dst;

    hid_t *src_memb_id = priv->src_memb_id,

                *dst_memb_id = priv->dst_memb_id;

    unsigned i;

    FUNC_ENTER_NOAPI_NOINIT_NOERR

    for(i = 0; i < priv->src_nmembs; i++)

        if(src2dst[i] >= 0) {

            int status;

            status = *H5I_dec_ref*(src_memb_id[i]);

            *HDassert*(status >= 0);

            status = *H5I_dec_ref*(dst_memb_id[src2dst[i]]);

            *HDassert*(status >= 0);

        } */* end if */*

    *H5MM_xfree*(src2dst);

    *H5MM_xfree*(src_memb_id);

    *H5MM_xfree*(dst_memb_id);

    *H5MM_xfree*(priv->memb_path);

    *FUNC_LEAVE_NOAPI*((H5T_conv_struct_t *)*H5MM_xfree*(priv))

} */* end H5T_conv_struct_free() */*

Dave,

Could you please send an example program to our Helpdesk (help@hdfgroup.org<mailto:help@hdfgroup.org>)? This will speedup the investigation.

Thank you!

Elena

···

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Elena Pourmal The HDF Group http://hdfgroup.org
1800 So. Oak St., Suite 203, Champaign IL 61820
217.531.6112
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

On Apr 20, 2016, at 12:47 PM, Dave Craig <dave.craig4@gmail.com<mailto:dave.craig4@gmail.com>> wrote:

The assertion occurs when using the HDF5 v1.8.16 Thread Safe with Zlib and the H5_term_library() function is called after having closed a file which contains a chunked, non-compressed Armadillo Matrix of doubles (i.e., arma::mat).

The assertion does not occur when using the HDF5 v1.8.16 Thread Safe without Zlib and the H5_term_library() function is called after having closed a file which contains a chunked, non-compressed Armadillo Matrix of doubles (i.e., arma::mat).

The H5 file is created with the ‘H5F_CLOSE_STRONG’ property

GDB dump:

Program received signal SIGABRT, Aborted.

0x0000003ca7032625 in raise () from /lib64/libc.so.6
(gdb) up
#1 0x0000003ca7033e05 in abort () from /lib64/libc.so.6
(gdb)
#2 0x0000003ca702b74e in __assert_fail_base () from /lib64/libc.so.6
(gdb)
#3 0x0000003ca702b810 in __assert_fail () from /lib64/libc.so.6
(gdb)
#4 0x00007ffff7584e1c in H5T_conv_struct_free (priv=0xab6e30) at H5Tconv.c:1845
1845 HDassert(status >= 0);
(gdb)
#5 0x00007ffff7587180 in H5T__conv_struct_opt (src_id=-1, dst_id=-1, cdata=0xab2410, nelmts=0, buf_stride=0, bkg_stride=0,
    _buf=0x0, _bkg=0x0, dxpl_id=167772168) at H5Tconv.c:2458
2458 cdata->priv = H5T_conv_struct_free((H5T_conv_struct_t *)(cdata->priv));
(gdb)
#6 0x00007ffff7564c0f in H5T_term_interface () at H5T.c:1410
1410 if((path->func)((hid_t)FAIL, (hid_t)FAIL, &(path->cdata), (size_t)0,
(gdb)
#7 0x00007ffff7279134 in H5_term_library () at H5.c:289
289 pending += DOWN(T);
(gdb)
#8 0x00007ffff727b082 in H5close () at H5.c:859
859 H5_term_library();
(gdb)
#9 0x00007ffff6fffa5f in H5::H5Library::termH5cpp() ()
   from /local/mnt/workspace/pcereck/ra_comp/pensim/ThirdParty/hdf5/hdf5-1.8.16/thread.safe.with.zlib/lib/libhdf5_cpp.so.11
(gdb) up
#10 0x0000003ca7035ebd in __cxa_finalize () from /lib64/libc.so.6
(gdb)
#11 0x00007ffff6ffc1e6 in __do_global_dtors_aux ()
   from /local/mnt/workspace/pcereck/ra_comp/pensim/ThirdParty/hdf5/hdf5-1.8.16/thread.safe.with.zlib/lib/libhdf5_cpp.so.11
(gdb)

Here is the H5T_conv_struct_free() function (the assert on line 1845 is highlighted):

static H5T_conv_struct_t *
H5T_conv_struct_free(H5T_conv_struct_t *priv)
{
    int *src2dst = priv->src2dst;
    hid_t *src_memb_id = priv->src_memb_id,
                *dst_memb_id = priv->dst_memb_id;
    unsigned i;

    FUNC_ENTER_NOAPI_NOINIT_NOERR

    for(i = 0; i < priv->src_nmembs; i++)
        if(src2dst[i] >= 0) {
            int status;

            status = H5I_dec_ref(src_memb_id[i]);
            HDassert(status >= 0);
            status = H5I_dec_ref(dst_memb_id[src2dst[i]]);
            HDassert(status >= 0);
        } /* end if */

    H5MM_xfree(src2dst);
    H5MM_xfree(src_memb_id);
    H5MM_xfree(dst_memb_id);
    H5MM_xfree(priv->memb_path);

    FUNC_LEAVE_NOAPI((H5T_conv_struct_t *)H5MM_xfree(priv))
} /* end H5T_conv_struct_free() */

_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@lists.hdfgroup.org<mailto:Hdf-forum@lists.hdfgroup.org>
http://lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org
Twitter: https://twitter.com/hdf5