hdf5
hdf5 copied to clipboard
crash of h5dump of H5Dchunk.c in function H5D__chunk_set_sizes
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
asan info
AddressSanitizer:DEADLYSIGNAL
=================================================================
==1800400==ERROR: AddressSanitizer: SEGV on unknown address 0x621400000210 (pc 0x000001174988 bp 0x60600000eb10 sp 0x7fff2f9b4460 T0)
==1800400==The signal is caused by a WRITE memory access.
#0 0x1174988 in H5D__chunk_set_sizes /home/hh/Downloads/hdf5/src/H5Dchunk.c:788:78
#1 0x6dabab in H5D__layout_oh_read /home/hh/Downloads/hdf5/src/H5Dlayout.c:663:13
#2 0x6b727e in H5D__open_oid /home/hh/Downloads/hdf5/src/H5Dint.c:1775:9
#3 0x6b727e in H5D_open /home/hh/Downloads/hdf5/src/H5Dint.c:1558:13
#4 0x6b60a3 in H5D__open_name /home/hh/Downloads/hdf5/src/H5Dint.c:1493:25
#5 0x10234ca in H5VL__native_dataset_open /home/hh/Downloads/hdf5/src/H5VLnative_dataset.c:122:25
#6 0xfc790c in H5VL__dataset_open /home/hh/Downloads/hdf5/src/H5VLcallback.c:1879:30
#7 0xfc790c in H5VL_dataset_open /home/hh/Downloads/hdf5/src/H5VLcallback.c:1911:30
#8 0x681a88 in H5D__open_api_common /home/hh/Downloads/hdf5/src/H5D.c:359:25
#9 0x6813d4 in H5Dopen2 /home/hh/Downloads/hdf5/src/H5D.c:399:22
#10 0x554ca1 in find_objs_cb /home/hh/Downloads/hdf5/tools/lib/h5tools_utils.c:720:29
#11 0x55e0a2 in traverse_cb /home/hh/Downloads/hdf5/tools/lib/h5trav.c:218:17
#12 0x871d87 in H5G__visit_cb /home/hh/Downloads/hdf5/src/H5Gint.c:1069:17
#13 0x88de92 in H5G__node_iterate /home/hh/Downloads/hdf5/src/H5Gnode.c:967:25
#14 0x114822b in H5B__iterate_helper /home/hh/Downloads/hdf5/src/H5B.c:1155:25
#15 0x1147c0d in H5B_iterate /home/hh/Downloads/hdf5/src/H5B.c:1197:22
#16 0x8a4ff1 in H5G__stab_iterate /home/hh/Downloads/hdf5/src/H5Gstab.c:537:26
#17 0x897fdb in H5G__obj_iterate /home/hh/Downloads/hdf5/src/H5Gobj.c:672:26
#18 0x87106f in H5G_visit /home/hh/Downloads/hdf5/src/H5Gint.c:1297:14
#19 0x103fa3f in H5VL__native_link_specific /home/hh/Downloads/hdf5/src/H5VLnative_link.c:362:38
#20 0xfe90e3 in H5VL__link_specific /home/hh/Downloads/hdf5/src/H5VLcallback.c:5140:22
#21 0xfe90e3 in H5VL_link_specific /home/hh/Downloads/hdf5/src/H5VLcallback.c:5176:22
#22 0x976df8 in H5Lvisit_by_name2 /home/hh/Downloads/hdf5/src/H5L.c:2024:22
#23 0x558472 in traverse /home/hh/Downloads/hdf5/tools/lib/h5trav.c:288:17
#24 0x55c606 in h5trav_visit /home/hh/Downloads/hdf5/tools/lib/h5trav.c:1057:9
#25 0x553c25 in init_objs /home/hh/Downloads/hdf5/tools/lib/h5tools_utils.c:793:22
#26 0x4c460c in table_list_add /home/hh/Downloads/hdf5/tools/src/h5dump/h5dump.c:476:9
#27 0x4c75c2 in main /home/hh/Downloads/hdf5/tools/src/h5dump/h5dump.c:1549:13
#28 0x7efca53b80b2 in __libc_start_main /build/glibc-eX1tMB/glibc-2.31/csu/../csu/libc-start.c:308:16
#29 0x41c60d in _start (/home/hh/Downloads/hdf5/build/bin/h5dump+0x41c60d)
AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV /home/hh/Downloads/hdf5/src/H5Dchunk.c:788:78 in H5D__chunk_set_sizes
==1800400==ABORTING
Fedora 33
Segmentation fault (core dumped)
Thanks
Still an issue in develop (1.13.4)
Fixed in develop / 1.4.1 (emits normal HDF5 error when parsing the corrupt file)
Also check for memory leaks and found none