-
Notifications
You must be signed in to change notification settings - Fork 142
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
Segfault when reading a file with a bad checksum #1184
Comments
This one only segfaults sometimes. julia> h5open("t20.txt", "r") do f
collect(f["test-data"])
end
[1742] signal 11 (1): Segmentation fault
in expression starting at REPL[5]:1
unknown function (ip: 0x7f2772da9aca)
H5VM_memcpyvv at /home/nathan/.julia/artifacts/3f844d84068534dcd6606936ab5f28e1120a9bb0/lib/libhdf5.so (unknown line)
H5D__compact_readvv at /home/nathan/.julia/artifacts/3f844d84068534dcd6606936ab5f28e1120a9bb0/lib/libhdf5.so (unknown line)
H5D__select_io at /home/nathan/.julia/artifacts/3f844d84068534dcd6606936ab5f28e1120a9bb0/lib/libhdf5.so (unknown line)
H5D__select_read at /home/nathan/.julia/artifacts/3f844d84068534dcd6606936ab5f28e1120a9bb0/lib/libhdf5.so (unknown line)
H5D__chunk_read at /home/nathan/.julia/artifacts/3f844d84068534dcd6606936ab5f28e1120a9bb0/lib/libhdf5.so (unknown line)
H5D__read at /home/nathan/.julia/artifacts/3f844d84068534dcd6606936ab5f28e1120a9bb0/lib/libhdf5.so (unknown line)
H5VL__native_dataset_read at /home/nathan/.julia/artifacts/3f844d84068534dcd6606936ab5f28e1120a9bb0/lib/libhdf5.so (unknown line)
H5VL_dataset_read_direct at /home/nathan/.julia/artifacts/3f844d84068534dcd6606936ab5f28e1120a9bb0/lib/libhdf5.so (unknown line)
H5D__read_api_common.constprop.2 at /home/nathan/.julia/artifacts/3f844d84068534dcd6606936ab5f28e1120a9bb0/lib/libhdf5.so (unknown line)
H5Dread at /home/nathan/.julia/artifacts/3f844d84068534dcd6606936ab5f28e1120a9bb0/lib/libhdf5.so (unknown line)
h5d_read at /home/nathan/.julia/packages/HDF5/Z859u/src/api/functions.jl:796
_generic_read at /home/nathan/.julia/packages/HDF5/Z859u/src/readwrite.jl:180
generic_read! at /home/nathan/.julia/packages/HDF5/Z859u/src/readwrite.jl:141 [inlined]
copyto! at /home/nathan/.julia/packages/HDF5/Z859u/src/readwrite.jl:94
unknown function (ip: 0x7f271957939d)
_collect at ./array.jl:722
collect at ./array.jl:716 [inlined]
#7 at ./REPL[5]:2 [inlined]
#17 at /home/nathan/.julia/packages/HDF5/Z859u/src/file.jl:101
task_local_storage at ./task.jl:315
#h5open#16 at /home/nathan/.julia/packages/HDF5/Z859u/src/file.jl:96
h5open at /home/nathan/.julia/packages/HDF5/Z859u/src/file.jl:94
jl_apply at /cache/build/tester-amdci5-12/julialang/julia-release-1-dot-11/src/julia.h:2157 [inlined]
do_call at /cache/build/tester-amdci5-12/julialang/julia-release-1-dot-11/src/interpreter.c:126
eval_value at /cache/build/tester-amdci5-12/julialang/julia-release-1-dot-11/src/interpreter.c:223
eval_stmt_value at /cache/build/tester-amdci5-12/julialang/julia-release-1-dot-11/src/interpreter.c:174 [inlined]
eval_body at /cache/build/tester-amdci5-12/julialang/julia-release-1-dot-11/src/interpreter.c:663
jl_interpret_toplevel_thunk at /cache/build/tester-amdci5-12/julialang/julia-release-1-dot-11/src/interpreter.c:821
jl_toplevel_eval_flex at /cache/build/tester-amdci5-12/julialang/julia-release-1-dot-11/src/toplevel.c:943
jl_toplevel_eval_flex at /cache/build/tester-amdci5-12/julialang/julia-release-1-dot-11/src/toplevel.c:886
ijl_toplevel_eval_in at /cache/build/tester-amdci5-12/julialang/julia-release-1-dot-11/src/toplevel.c:994
eval at ./boot.jl:430 [inlined]
eval_user_input at /cache/build/tester-amdci5-12/julialang/julia-release-1-dot-11/usr/share/julia/stdlib/v1.11/REPL/src/REPL.jl:245
repl_backend_loop at /cache/build/tester-amdci5-12/julialang/julia-release-1-dot-11/usr/share/julia/stdlib/v1.11/REPL/src/REPL.jl:342
#start_repl_backend#59 at /cache/build/tester-amdci5-12/julialang/julia-release-1-dot-11/usr/share/julia/stdlib/v1.11/REPL/src/REPL.jl:327
start_repl_backend at /cache/build/tester-amdci5-12/julialang/julia-release-1-dot-11/usr/share/julia/stdlib/v1.11/REPL/src/REPL.jl:324
#run_repl#72 at /cache/build/tester-amdci5-12/julialang/julia-release-1-dot-11/usr/share/julia/stdlib/v1.11/REPL/src/REPL.jl:483
run_repl at /cache/build/tester-amdci5-12/julialang/julia-release-1-dot-11/usr/share/julia/stdlib/v1.11/REPL/src/REPL.jl:469
jfptr_run_repl_10104.1 at /home/nathan/.julia/juliaup/julia-1.11.2+0.x64.linux.gnu/share/julia/compiled/v1.11/REPL/u0gqU_4x0TT.so (unknown line)
#1150 at ./client.jl:446
jfptr_YY.1150_14803.1 at /home/nathan/.julia/juliaup/julia-1.11.2+0.x64.linux.gnu/share/julia/compiled/v1.11/REPL/u0gqU_4x0TT.so (unknown line)
jl_apply at /cache/build/tester-amdci5-12/julialang/julia-release-1-dot-11/src/julia.h:2157 [inlined]
jl_f__call_latest at /cache/build/tester-amdci5-12/julialang/julia-release-1-dot-11/src/builtins.c:875
#invokelatest#2 at ./essentials.jl:1055 [inlined]
invokelatest at ./essentials.jl:1052 [inlined]
run_main_repl at ./client.jl:430
repl_main at ./client.jl:567 [inlined]
_start at ./client.jl:541
jfptr__start_73406.1 at /home/nathan/.julia/juliaup/julia-1.11.2+0.x64.linux.gnu/lib/julia/sys.so (unknown line)
jl_apply at /cache/build/tester-amdci5-12/julialang/julia-release-1-dot-11/src/julia.h:2157 [inlined]
true_main at /cache/build/tester-amdci5-12/julialang/julia-release-1-dot-11/src/jlapi.c:900
jl_repl_entrypoint at /cache/build/tester-amdci5-12/julialang/julia-release-1-dot-11/src/jlapi.c:1059
main at /cache/build/tester-amdci5-12/julialang/julia-release-1-dot-11/cli/loader_exe.c:58
unknown function (ip: 0x7f2772c32d8f)
__libc_start_main at /lib/x86_64-linux-gnu/libc.so.6 (unknown line)
unknown function (ip: 0x4010b8)
Allocations: 10179476 (Pool: 10176099; Big: 3377); GC: 14 |
This seems like an upstream issue. Could you try the HDF5 command line tools such as h5ls and h5dump? Otherwise, we'll have to write a small MWE in C. |
Yes, h5dump crashes on the files as well. |
Just curious, what happens when you use the Julia port of the checksum code: |
julia> using JLD2
julia> jldopen("t7.txt") do f
f["test-data"]
end
┌ Warning: File likely not written by JLD2. Skipping header verification.
└ @ JLD2 ~/.julia/packages/JLD2/NKGUi/src/file_header.jl:21
ERROR: KeyError: key 0x0003 not found
Stacktrace:
[1] getindex(h::Dict{UInt16, Tuple{Symbol, Symbol, Symbol, String}}, key::UInt16)
@ Base ./dict.jl:477
[2] get_decompressor(filters::JLD2.FilterPipeline)
@ JLD2 ~/.julia/packages/JLD2/NKGUi/src/compression.jl:110
[3] read_compressed_array!(v::Vector{…}, f::JLD2.JLDFile{…}, rr::JLD2.SameRepr{…}, data_length::Int64, filters::JLD2.FilterPipeline)
@ JLD2 ~/.julia/packages/JLD2/NKGUi/src/compression.jl:221
[4] read_array(f::JLD2.JLDFile{…}, dataspace::JLD2.ReadDataspace, rr::JLD2.ReadRepresentation, layout::JLD2.DataLayout, filters::JLD2.FilterPipeline, header_offset::JLD2.RelOffset, attributes::Vector{…})
@ JLD2 ~/.julia/packages/JLD2/NKGUi/src/datasets.jl:237
[5] read_data(f::JLD2.JLDFile{…}, rr::Any, read_dataspace::Tuple{…}, attributes::Vector{…})
@ JLD2 ~/.julia/packages/JLD2/NKGUi/src/datasets.jl:102
[6] read_data(f::JLD2.JLDFile{…}, dataspace::JLD2.ReadDataspace, dt::JLD2.H5Datatype, layout::JLD2.DataLayout, filters::JLD2.FilterPipeline, header_offset::JLD2.RelOffset, attributes::Vector{…})
@ JLD2 ~/.julia/packages/JLD2/NKGUi/src/datasets.jl:84
[7] load_dataset(f::JLD2.JLDFile{JLD2.MmapIO}, offset::JLD2.RelOffset)
@ JLD2 ~/.julia/packages/JLD2/NKGUi/src/datasets.jl:48
[8] getindex(g::JLD2.Group{JLD2.JLDFile{JLD2.MmapIO}}, name::String)
@ JLD2 ~/.julia/packages/JLD2/NKGUi/src/groups.jl:99
[9] getindex
@ ~/.julia/packages/JLD2/NKGUi/src/JLD2.jl:349 [inlined]
[10] (::var"#1#2")(f::JLD2.JLDFile{JLD2.MmapIO})
@ Main ./REPL[4]:2
[11] jldopen(f::Function, args::String; kws::@Kwargs{})
@ JLD2 ~/.julia/packages/JLD2/NKGUi/src/loadsave.jl:4
[12] jldopen(f::Function, args::String)
@ JLD2 ~/.julia/packages/JLD2/NKGUi/src/loadsave.jl:1
[13] top-level scope
@ REPL[4]:1
Some type information was truncated. Use `show(err)` to see complete types. |
I'm going to close this since this can only be addressed upstream: |
Is the segfault only with HDF5.jl? |
I was trying to learn about how HDF5 uses checksums and created the following file that crashes julia:
t7.txt
On Linux:
The text was updated successfully, but these errors were encountered: