Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash of h5dump of H5Oshared.c in function H5O__shared_read #585

Closed
NigelX opened this issue Apr 25, 2021 · 2 comments
Closed

Crash of h5dump of H5Oshared.c in function H5O__shared_read #585

NigelX opened this issue Apr 25, 2021 · 2 comments

Comments

@NigelX
Copy link

NigelX commented Apr 25, 2021

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
=================================================================
==2076421==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x7fb7c3e4ad82 bp 0x7ffd5e4769c0 sp 0x7ffd5e476178 T0)
==2076421==The signal is caused by a READ memory access.
==2076421==Hint: address points to the zero page.
    #0 0x7fb7c3e4ad82  /build/glibc-eX1tMB/glibc-2.31/string/../sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S:312
    #1 0x494287 in __asan_memcpy (/home/hh/Downloads/hdf5/build/bin/h5dump+0x494287)
    #2 0x9af4c2 in H5MM_memcpy /home/hh/Downloads/hdf5/src/H5MM.c:617:11
    #3 0x11d4fb5 in H5F__accum_read /home/hh/Downloads/hdf5/src/H5Faccum.c:192:17
    #4 0xb7b938 in H5PB_read /home/hh/Downloads/hdf5/src/H5PB.c:720:13
    #5 0x7a0d87 in H5F_block_read /home/hh/Downloads/hdf5/src/H5Fio.c:147:9
    #6 0x61b385 in H5C__load_entry /home/hh/Downloads/hdf5/src/H5C.c:7193:21
    #7 0x61b385 in H5C_protect /home/hh/Downloads/hdf5/src/H5C.c:2363:30
    #8 0x5a8057 in H5AC_protect /home/hh/Downloads/hdf5/src/H5AC.c:1425:26
    #9 0xcb9243 in H5SM_get_fheap_addr /home/hh/Downloads/hdf5/src/H5SM.c:418:49
    #10 0xa7a58c in H5O__shared_read /home/hh/Downloads/hdf5/src/H5Oshared.c:131:13
    #11 0xa7a58c in H5O__shared_decode /home/hh/Downloads/hdf5/src/H5Oshared.c:370:30
    #12 0xa6c999 in H5O__pline_shared_decode /home/hh/Downloads/hdf5/src/H5Oshared.h:68:34
    #13 0xa5be79 in H5O_msg_read_oh /home/hh/Downloads/hdf5/src/H5Omessage.c:514:5
    #14 0xa5b241 in H5O_msg_read /home/hh/Downloads/hdf5/src/H5Omessage.c:455:30
    #15 0x6da3a0 in H5D__layout_oh_read /home/hh/Downloads/hdf5/src/H5Dlayout.c:611:21
    #16 0x6b727e in H5D__open_oid /home/hh/Downloads/hdf5/src/H5Dint.c:1775:9
    #17 0x6b727e in H5D_open /home/hh/Downloads/hdf5/src/H5Dint.c:1558:13
    #18 0x6b60a3 in H5D__open_name /home/hh/Downloads/hdf5/src/H5Dint.c:1493:25
    #19 0x10234ca in H5VL__native_dataset_open /home/hh/Downloads/hdf5/src/H5VLnative_dataset.c:122:25
    #20 0xfc790c in H5VL__dataset_open /home/hh/Downloads/hdf5/src/H5VLcallback.c:1879:30
    #21 0xfc790c in H5VL_dataset_open /home/hh/Downloads/hdf5/src/H5VLcallback.c:1911:30
    #22 0x681a88 in H5D__open_api_common /home/hh/Downloads/hdf5/src/H5D.c:359:25
    #23 0x6813d4 in H5Dopen2 /home/hh/Downloads/hdf5/src/H5D.c:399:22
    #24 0x554ca1 in find_objs_cb /home/hh/Downloads/hdf5/tools/lib/h5tools_utils.c:720:29
    #25 0x55e0a2 in traverse_cb /home/hh/Downloads/hdf5/tools/lib/h5trav.c:218:17
    #26 0x871d87 in H5G__visit_cb /home/hh/Downloads/hdf5/src/H5Gint.c:1069:17
    #27 0x88de92 in H5G__node_iterate /home/hh/Downloads/hdf5/src/H5Gnode.c:967:25
    #28 0x114822b in H5B__iterate_helper /home/hh/Downloads/hdf5/src/H5B.c:1155:25
    #29 0x1147c0d in H5B_iterate /home/hh/Downloads/hdf5/src/H5B.c:1197:22
    #30 0x8a4ff1 in H5G__stab_iterate /home/hh/Downloads/hdf5/src/H5Gstab.c:537:26
    #31 0x897fdb in H5G__obj_iterate /home/hh/Downloads/hdf5/src/H5Gobj.c:672:26
    #32 0x87106f in H5G_visit /home/hh/Downloads/hdf5/src/H5Gint.c:1297:14
    #33 0x103fa3f in H5VL__native_link_specific /home/hh/Downloads/hdf5/src/H5VLnative_link.c:362:38
    #34 0xfe90e3 in H5VL__link_specific /home/hh/Downloads/hdf5/src/H5VLcallback.c:5140:22
    #35 0xfe90e3 in H5VL_link_specific /home/hh/Downloads/hdf5/src/H5VLcallback.c:5176:22
    #36 0x976df8 in H5Lvisit_by_name2 /home/hh/Downloads/hdf5/src/H5L.c:2024:22
    #37 0x558472 in traverse /home/hh/Downloads/hdf5/tools/lib/h5trav.c:288:17
    #38 0x55c606 in h5trav_visit /home/hh/Downloads/hdf5/tools/lib/h5trav.c:1057:9
    #39 0x553c25 in init_objs /home/hh/Downloads/hdf5/tools/lib/h5tools_utils.c:793:22
    #40 0x4c460c in table_list_add /home/hh/Downloads/hdf5/tools/src/h5dump/h5dump.c:476:9
    #41 0x4c75c2 in main /home/hh/Downloads/hdf5/tools/src/h5dump/h5dump.c:1549:13
    #42 0x7fb7c3db30b2 in __libc_start_main /build/glibc-eX1tMB/glibc-2.31/csu/../csu/libc-start.c:308:16
    #43 0x41c60d in _start (/home/hh/Downloads/hdf5/build/bin/h5dump+0x41c60d)

AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV /build/glibc-eX1tMB/glibc-2.31/string/../sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S:312 
==2076421==ABORTING

Fedora 33

Segmentation fault (core dumped)

Thanks

@byrnHDF
Copy link
Contributor

byrnHDF commented Nov 17, 2022

This file also has the same stack trace as #586.
HDFView error stack:
[java] #12: /home/byrn/HDF_Projects/hdf5/dev/src/H5Fio.c line 141 in H5F_block_read(): attempting I/O in temporary file space
[java] major: Low-level I/O
[java] minor: Out of range

However this file did crash HDFView afterwards.

@byrnHDF
Copy link
Contributor

byrnHDF commented Nov 21, 2022

No crash as error is handled in current develop

@byrnHDF byrnHDF closed this as completed Nov 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants