hdf5 icon indicating copy to clipboard operation
hdf5 copied to clipboard

crash of h5dump of H5Dchunk.c in function H5D__chunk_set_info_real

Open NigelX opened this issue 3 years ago • 1 comments

Hi I found an crash error.

System info: Ubuntu 20.04 : clang 10.0.0 , gcc 9.3.0

hdf5 version 1.13.0 ,git branch development


Verification steps: 1.Get the source code of hdf5 2.Compile the hdf5

$ cd hdf5
$ mkdir build && cd build
$ cmake ../ -DCMAKE_C_COMPILER=clang  -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_FLAGS="-fsanitize=address" -DCMAKE_CXX_FLAGS="-fsanitize=address"
$ make -j 32

3.run h5dump

$ cd bin
$ mkdir crashtest_dir
$ ./h5dump -r -d crashtest_dir/data poc

poc.zip

asan info

AddressSanitizer:DEADLYSIGNAL
=================================================================
==1298456==ERROR: AddressSanitizer: FPE on unknown address 0x00000117425e (pc 0x00000117425e bp 0x6210000002a8 sp 0x7fff10fa4660 T0)
    #0 0x117425e in H5D__chunk_set_info_real /home/hh/Downloads/hdf5/src/H5Dchunk.c:697:67
    #1 0x1173d5e in H5D__chunk_set_info /home/hh/Downloads/hdf5/src/H5Dchunk.c:746:9
    #2 0x115c76c in H5D__chunk_init /home/hh/Downloads/hdf5/src/H5Dchunk.c:984:9
    #3 0x6da907 in H5D__layout_oh_read /home/hh/Downloads/hdf5/src/H5Dlayout.c:650:9
    #4 0x6b727e in H5D__open_oid /home/hh/Downloads/hdf5/src/H5Dint.c:1775:9
    #5 0x6b727e in H5D_open /home/hh/Downloads/hdf5/src/H5Dint.c:1558:13
    #6 0x6b60a3 in H5D__open_name /home/hh/Downloads/hdf5/src/H5Dint.c:1493:25
    #7 0x10234ca in H5VL__native_dataset_open /home/hh/Downloads/hdf5/src/H5VLnative_dataset.c:122:25
    #8 0xfc790c in H5VL__dataset_open /home/hh/Downloads/hdf5/src/H5VLcallback.c:1879:30
    #9 0xfc790c in H5VL_dataset_open /home/hh/Downloads/hdf5/src/H5VLcallback.c:1911:30
    #10 0x681a88 in H5D__open_api_common /home/hh/Downloads/hdf5/src/H5D.c:359:25
    #11 0x6813d4 in H5Dopen2 /home/hh/Downloads/hdf5/src/H5D.c:399:22
    #12 0x554ca1 in find_objs_cb /home/hh/Downloads/hdf5/tools/lib/h5tools_utils.c:720:29
    #13 0x55e0a2 in traverse_cb /home/hh/Downloads/hdf5/tools/lib/h5trav.c:218:17
    #14 0x871d87 in H5G__visit_cb /home/hh/Downloads/hdf5/src/H5Gint.c:1069:17
    #15 0x88de92 in H5G__node_iterate /home/hh/Downloads/hdf5/src/H5Gnode.c:967:25
    #16 0x114822b in H5B__iterate_helper /home/hh/Downloads/hdf5/src/H5B.c:1155:25
    #17 0x1147c0d in H5B_iterate /home/hh/Downloads/hdf5/src/H5B.c:1197:22
    #18 0x8a4ff1 in H5G__stab_iterate /home/hh/Downloads/hdf5/src/H5Gstab.c:537:26
    #19 0x897fdb in H5G__obj_iterate /home/hh/Downloads/hdf5/src/H5Gobj.c:672:26
    #20 0x87106f in H5G_visit /home/hh/Downloads/hdf5/src/H5Gint.c:1297:14
    #21 0x103fa3f in H5VL__native_link_specific /home/hh/Downloads/hdf5/src/H5VLnative_link.c:362:38
    #22 0xfe90e3 in H5VL__link_specific /home/hh/Downloads/hdf5/src/H5VLcallback.c:5140:22
    #23 0xfe90e3 in H5VL_link_specific /home/hh/Downloads/hdf5/src/H5VLcallback.c:5176:22
    #24 0x976df8 in H5Lvisit_by_name2 /home/hh/Downloads/hdf5/src/H5L.c:2024:22
    #25 0x558472 in traverse /home/hh/Downloads/hdf5/tools/lib/h5trav.c:288:17
    #26 0x55c606 in h5trav_visit /home/hh/Downloads/hdf5/tools/lib/h5trav.c:1057:9
    #27 0x553c25 in init_objs /home/hh/Downloads/hdf5/tools/lib/h5tools_utils.c:793:22
    #28 0x4c460c in table_list_add /home/hh/Downloads/hdf5/tools/src/h5dump/h5dump.c:476:9
    #29 0x4c75c2 in main /home/hh/Downloads/hdf5/tools/src/h5dump/h5dump.c:1549:13
    #30 0x7f232a2f60b2 in __libc_start_main /build/glibc-eX1tMB/glibc-2.31/csu/../csu/libc-start.c:308:16
    #31 0x41c60d in _start (/home/hh/Downloads/hdf5/build/bin/h5dump+0x41c60d)

AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: FPE /home/hh/Downloads/hdf5/src/H5Dchunk.c:697:67 in H5D__chunk_set_info_real
==1298456==ABORTING

Fedora 33

Floating point exception (core dumped)

Thanks

NigelX avatar Apr 25 '21 01:04 NigelX

Still an issue in develop (1.13.4)

byrnHDF avatar Nov 17 '22 19:11 byrnHDF

Fixed in develop / 1.4.1 (emits normal HDF5 error when parsing the corrupt file)

derobins avatar May 02 '23 20:05 derobins

Also looked for memory leaks and found none

derobins avatar May 04 '23 18:05 derobins