I ran into a really confusing situation today. I upgrade my Linux distro yesterday to Ubuntu 22.04, and one of my previously working packages started to crash. While trying to debug and reproduce this, I realised that if I using HDF5
after I define a function which doesn’t use anything from HDF5, it could cause it to crash. Apologies for a rather complicated MWE below, but I couldn’t otherwise consistently reproduce this on my machine if I tweak it too much. For example, if I change the size of imgs
from 10000 to 1000, it wouldn’t crash.
(base) [1] % julia ~
_
_ _ _(_)_ | Documentation: https://docs.julialang.org
(_) | (_) (_) |
_ _ _| |_ __ _ | Type "?" for help, "]?" for Pkg help.
| | | | | | |/ _` | |
| | |_| | | | (_| | | Version 1.7.3 (2022-05-06)
_/ |\__'_|_|_|\__'_| | Official https://julialang.org/ release
|__/ |
julia> using Statistics: mean
julia> function img_center(img; threshold=0.1)
bw_img = img .> (maximum(img) * threshold)
img_indices = Tuple.(findall(x -> x==1, bw_img))
Int.(round.(mean.((first.(img_indices), last.(img_indices)))))
end
img_center (generic function with 1 method)
julia> using ThreadsX
julia> imgs = [rand(Float64, (256, 256)) for i in 1:10000];
julia> c = ThreadsX.map(x -> img_center(x; threshold=0.1), imgs);
julia> using HDF5
julia> c = ThreadsX.map(x -> img_center(x; threshold=0.1), imgs);
julia:33823 terminated with signal 11 at PC=7f17d3552e28 SP=7f173
julia:33823 terminated with signal 11 at PC=7f17d35
julia:33823 terminated with signal 11 at PC=7f17d3552e28 SP=7f17387ffd20. Backtrace:
. Back. Backtrace:
julia:33823 terminated with signal 11 at PC=7f17d3552e28 SP=7f17387ffd20. Backtrace:
. Back. Backtrace:
julia:33823 terminated with signal 11 at PC=7f17d3552e28 SP=7f17387ffd20. Backtrace:
. Back. Backtrace:
julia:33823 terminated with signal 11 at PC=7f17d3552e28 SP=7f17387ffd20. Backtrace:
. Back. Backtrace:
���
julia:33823 terminated with signal 11 at PC=7f17d3552e28 SP=7f17387ffd20. Backtrace:
. Back. Back/home/chen/.julia/juliaup/julia-1.7.3+0.x64/bin/../lib/julia/libjulia-internal.so.1(+0x152e28)[0x7f17d3552e28]
/home/chen/.julia/juliaup/julia-1.7.3+0.x64/bin/../lib/julia/libjulia-internal.so.1(+0xc42dd)[0x7f17d34c42dd]
/home/chen/.julia/juliaup/julia-1.7.3+0.x64/bin/../lib/julia/libjulia-internal.so.1(+0x152e28)[0x7f17d3552e28]
/home/chen/.julia/juliaup/julia-1.7.3+0.x64/bin/../lib/julia/libjulia-internal.so.1(jl_apply_generic+0x2b2)[0x7f17d34c4f32]
/home/chen/.julia/juliaup/julia-1.7.3+0.x64/bin/../lib/julia/libjulia-internal.so.1(+0x152e28)[0x7f17d3552e28]
/home/chen/.julia/juliaup/julia-1.7.3+0.x64/bin/../lib/julia/libjulia-internal.so.1(+0xc42dd)[0x7f17d34c42dd]
/home/chen/.julia/juliaup/julia-1.7.3+0.x64/bin/../lib/julia/libjulia-internal.so.1(jl_apply_generic+0x2b2)[0x7f17d34c4f32]
/home/chen/.julia/juliaup/julia-1.7.3+0.x64/bin/../lib/julia/libjulia-internal.so.1(+0x152e28)[0x7f17d3552e28]
/home/chen/.julia/juliaup/julia-1.7.3+0.x64/bin/../lib/julia/libjulia-internal.so.1(+0x152e28)[0x7f17d3552e28]
/home/chen/.julia/juliaup/julia-1.7.3+0.x64/bin/../lib/julia/libjulia-internal.so.1(+0xe939f)[0x7f17d34e939f]
/home/chen/.julia/juliaup/julia-1.7.3+0.x64/bin/../lib/julia/libjulia-internal.so.1(+0x152e28)[0x7f17d3552e28]
/home/chen/.julia/juliaup/julia-1.7.3+0.x64/bin/../lib/julia/libjulia-internal.so.1(+0xc42dd)[0x7f17d34c42dd]
/home/chen/.julia/juliaup/julia-1.7.3+0.x64/bin/../lib/julia/libjulia-internal.so.1(+0x152e28)[0x7f17d3552e28]
/home/chen/.julia/juliaup/julia-1.7.3+0.x64/bin/../lib/julia/libjulia-internal.so.1(+0xe939f)[0x7f17d34e939f]
/home/chen/.julia/juliaup/julia-1.7.3+0.x64/bin/../lib/julia/libjulia-internal.so.1(+0xc42dd)[0x7f17d34c42dd]
/home/chen/.julia/juliaup/julia-1.7.3+0.x64/bin/../lib/julia/libjulia-internal.so.1(+0xc42dd)[0x7f17d34c42dd]
/home/chen/.julia/juliaup/julia-1.7.3+0.x64/bin/../lib/julia/libjulia-internal.so.1(jl_apply_generic+0x2b2)[0x7f17d34c4f32]
/home/chen/.julia/juliaup/julia-1.7.3+0.x64/bin/../lib/julia/libjulia-internal.so.1(+0xc42dd)[0x7f17d34c42dd]
/home/chen/.julia/juliaup/julia-1.7.3+0.x64/bin/../lib/julia/libjulia-internal.so.1(jl_apply_generic+0x2b2)[0x7f17d34c4f32]
/home/chen/.julia/juliaup/julia-1.7.3+0.x64/bin/../lib/julia/libjulia-internal.so.1(+0xc42dd)[0x7f17d34c42dd]
/home/chen/.julia/juliaup/julia-1.7.3+0.x64/bin/../lib/julia/libjulia-internal.so.1(jl_apply_generic+0x2b2)[0x7f17d34c4f32]
/home/chen/.julia/juliaup/julia-1.7.3+0.x64/bin/../lib/julia/libjulia-internal.so.1(+0xe939f)[0x7f17d34e939f]
/home/chen/.julia/juliaup/julia-1.7.3+0.x64/bin/../lib/julia/libjulia-internal.so.1(jl_apply_generic+0x2b2)[0x7f17d34c4f32]
/home/chen/.julia/juliaup/julia-1.7.3+0.x64/bin/../lib/julia/libjulia-internal.so.1(jl_apply_generic+0x2b2)[0x7f17d34c4f32]
/home/chen/.julia/juliaup/julia-1.7.3+0.x64/bin/../lib/julia/libjulia-internal.so.1(+0xe939f)[0x7f17d34e939f]
/home/chen/.julia/juliaup/julia-1.7.3+0.x64/bin/../lib/julia/libjulia-internal.so.1(+0xe939f)[0x7f17d34e939f]
/home/chen/.julia/juliaup/julia-1.7.3+0.x64/bin/../lib/julia/libjulia-internal.so.1(+0xe939f)[0x7f17d34e939f]
/home/chen/.julia/juliaup/julia-1.7.3+0.x64/bin/../lib/julia/libjulia-internal.so.1(+0xe939f)[0x7f17d34e939f]
julia:33823 terminated with signal 11 at PC=7f17d3567930 SP=7f1729ffe660. Backtrace:
/home/chen/.julia/juliaup/julia-1.7.3+0.x64/bin/../lib/julia/libjulia-internal.so.1(+0x167930)[0x7f17d3567930]
/home/chen/.julia/juliaup/julia-1.7.3+0.x64/bin/../lib/julia/libLLVM-12jl.so(_ZN4llvm3orc24RTDyldObjectLinkingLayer9onObjLoadERNS0_29MaterializationResponsibilityERKNS_6object10ObjectFileERNS_11RuntimeDyld13MemoryManagerERNS8_16LoadedObjectInfoESt3mapINS_9StringRefENS_18JITEvaluatedSymbolESt4lessISE_ESaISt4pairIKSE_SF_EEERSt3setISE_SH_SaISE_EE+0x70a)[0x7f17d0ec8c2a]
/home/chen/.julia/juliaup/julia-1.7.3+0.x64/bin/../lib/julia/libLLVM-12jl.so(+0x24c9ffa)[0x7f17d0ec9ffa]
/home/chen/.julia/juliaup/julia-1.7.3+0.x64/bin/../lib/julia/libLLVM-12jl.so(_ZN4llvm13jitLinkForORCENS_6object12OwningBinaryINS0_10ObjectFileEEERNS_11RuntimeDyld13MemoryManagerERNS_17JITSymbolResolverEbNS_15unique_functionIFNS_5ErrorERKS2_RNS4_16LoadedObjectInfoESt3mapINS_9StringRefENS_18JITEvaluatedSymbolESt4lessISG_ESaISt4pairIKSG_SH_EEEEEENS9_IFvS3_St10unique_ptrISD_St14default_deleteISD_EESA_EEE+0x1b7)[0x7f17d0ef2057]
/home/chen/.julia/juliaup/julia-1.7.3+0.x64/bin/../lib/julia/libLLVM-12jl.so(_ZN4llvm3orc24RTDyldObjectLinkingLayer4emitESt10unique_ptrINS0_29MaterializationResponsibilityESt14default_deleteIS3_EES2_INS_12MemoryBufferES4_IS7_EE+0x5d9)[0x7f17d0ec47b9]
/home/chen/.julia/juliaup/julia-1.7.3+0.x64/bin/../lib/julia/libLLVM-12jl.so(_ZN4llvm3orc14IRCompileLayer4emitESt10unique_ptrINS0_29MaterializationResponsibilityESt14default_deleteIS3_EENS0_16ThreadSafeModuleE+0x22b)[0x7f17d0e8585b]
/home/chen/.julia/juliaup/julia-1.7.3+0.x64/bin/../lib/julia/libLLVM-12jl.so(_ZN4llvm3orc31BasicIRLayerMaterializationUnit11materializeESt10unique_ptrINS0_29MaterializationResponsibilityESt14default_deleteIS3_EE+0xf1)[0x7f17d0e90a81]
/home/chen/.julia/juliaup/julia-1.7.3+0.x64/bin/../lib/julia/libLLVM-12jl.so(+0x2465b85)[0x7f17d0e65b85]
/home/chen/.julia/juliaup/julia-1.7.3+0.x64/bin/../lib/julia/libLLVM-12jl.so(_ZNSt17_Function_handlerIFvSt10unique_ptrIN4llvm3orc19MaterializationUnitESt14default_deleteIS3_EES0_INS2_29MaterializationResponsibilityES4_IS7_EEEPSA_E9_M_invokeERKSt9_Any_dataOS6_OS9_+0x2e)[0x7f17d0e63b6e]
/home/chen/.julia/juliaup/julia-1.7.3+0.x64/bin/../lib/julia/libLLVM-12jl.so(_ZN4llvm3orc16ExecutionSession22dispatchOutstandingMUsEv+0xc9)[0x7f17d0e64339]
/home/chen/.julia/juliaup/julia-1.7.3+0.x64/bin/../lib/julia/libLLVM-12jl.so(_ZN4llvm3orc16ExecutionSession17OL_completeLookupESt10unique_ptrINS0_21InProgressLookupStateESt14default_deleteIS3_EESt10shared_ptrINS0_23AsynchronousSymbolQueryEESt8functionIFvRKNS_8DenseMapIPNS0_8JITDylibENS_8DenseSetINS0_15SymbolStringPtrENS_12DenseMapInfoISF_EEEENSG_ISD_EENS_6detail12DenseMapPairISD_SI_EEEEEE+0x6fa)[0x7f17d0e6c85a]
/home/chen/.julia/juliaup/julia-1.7.3+0.x64/bin/../lib/julia/libLLVM-12jl.so(+0x246d6ed)[0x7f17d0e6d6ed]
/home/chen/.julia/juliaup/julia-1.7.3+0.x64/bin/../lib/julia/libLLVM-12jl.so(_ZN4llvm3orc16ExecutionSession19OL_applyQueryPhase1ESt10unique_ptrINS0_21InProgressLookupStateESt14default_deleteIS3_EENS_5ErrorE+0x94e)[0x7f17d0e5cb0e]
/home/chen/.julia/juliaup/julia-1.7.3+0.x64/bin/../lib/julia/libLLVM-12jl.so(_ZN4llvm3orc16ExecutionSession6lookupENS0_10LookupKindERKSt6vectorISt4pairIPNS0_8JITDylibENS0_19JITDylibLookupFlagsEESaIS8_EENS0_15SymbolLookupSetENS0_11SymbolStateENS_15unique_functionIFvNS_8ExpectedINS_8DenseMapINS0_15SymbolStringPtrENS_18JITEvaluatedSymbolENS_12DenseMapInfoISI_EENS_6detail12DenseMapPairISI_SJ_EEEEEEEEESt8functionIFvRKNSH_IS6_NS_8DenseSetISI_SL_EENSK_IS6_EENSN_IS6_SV_EEEEEE+0x37f)[0x7f17d0e6476f]
/home/chen/.julia/juliaup/julia-1.7.3+0.x64/bin/../lib/julia/libLLVM-12jl.so(_ZN4llvm3orc16ExecutionSession6lookupERKSt6vectorISt4pairIPNS0_8JITDylibENS0_19JITDylibLookupFlagsEESaIS7_EERKNS0_15SymbolLookupSetENS0_10LookupKindENS0_11SymbolStateESt8functionIFvRKNS_8DenseMapIS5_NS_8DenseSetINS0_15SymbolStringPtrENS_12DenseMapInfoISK_EEEENSL_IS5_EENS_6detail12DenseMapPairIS5_SN_EEEEEE+0x1a4)[0x7f17d0e64fb4]
/home/chen/.julia/juliaup/julia-1.7.3+0.x64/bin/../lib/julia/libLLVM-12jl.so(_ZN4llvm3orc16ExecutionSession6lookupERKSt6vectorISt4pairIPNS0_8JITDylibENS0_19JITDylibLookupFlagsEESaIS7_EENS0_15SymbolStringPtrENS0_11SymbolStateE+0x106)[0x7f17d0e65396]
/home/chen/.julia/juliaup/julia-1.7.3+0.x64/bin/../lib/julia/libLLVM-12jl.so(_ZN4llvm3orc16ExecutionSession6lookupENS_8ArrayRefIPNS0_8JITDylibEEENS0_15SymbolStringPtrENS0_11SymbolStateE+0x80)[0x7f17d0e65790]
/home/chen/.julia/juliaup/julia-1.7.3+0.x64/bin/../lib/julia/libLLVM-12jl.so(_ZN4llvm3orc16ExecutionSession6lookupENS_8ArrayRefIPNS0_8JITDylibEEENS_9StringRefENS0_11SymbolStateE+0x144)[0x7f17d0e659b4]
/home/chen/.julia/juliaup/julia-1.7.3+0.x64/bin/../lib/julia/libjulia-internal.so.1(+0x1505bb)[0x7f17d35505bb]
/home/chen/.julia/juliaup/julia-1.7.3+0.x64/bin/../lib/julia/libjulia-internal.so.1(+0x1509a7)[0x7f17d35509a7]
/home/chen/.julia/juliaup/julia-1.7.3+0.x64/bin/../lib/julia/libjulia-internal.so.1(+0x15122f)[0x7f17d355122f]
/home/chen/.julia/juliaup/julia-1.7.3+0.x64/bin/../lib/julia/libjulia-internal.so.1(+0x15210b)[0x7f17d355210b]
/home/chen/.julia/juliaup/julia-1.7.3+0.x64/bin/../lib/julia/libjulia-internal.so.1(+0x153082)[0x7f17d3553082]
/home/chen/.julia/juliaup/julia-1.7.3+0.x64/bin/../lib/julia/libjulia-internal.so.1(+0xc42dd)[0x7f17d34c42dd]
/home/chen/.julia/juliaup/julia-1.7.3+0.x64/bin/../lib/julia/libjulia-internal.so.1(jl_apply_generic+0x2b2)[0x7f17d34c4f32]
/home/chen/.julia/juliaup/julia-1.7.3+0.x64/bin/../lib/julia/libjulia-internal.so.1(+0xe939f)[0x7f17d34e939f]
(base) [1] %
Some additional information about the system
julia> versioninfo()
Julia Version 1.7.3
Commit 742b9abb4d (2022-05-06 12:58 UTC)
Platform Info:
OS: Linux (x86_64-pc-linux-gnu)
CPU: AMD Ryzen Threadripper 3990X 64-Core Processor
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-12.0.1 (ORCJIT, znver2)
Environment:
JULIA_NUM_THREADS = 32
JULIA_PKG_USE_CLI_GIT = true
JULIA_HDF5_PATH = /usr/lib/x86_64-linux-gnu/hdf5/mpich/
JULIA_MPI_BINARY = system
JULIA_CUDA_USE_COMPAT = false