Skip to content

segfault in test on nightly #84

Open

Description

using AllocCheck
using AllocCheck: AllocatingRuntimeCall, DynamicDispatch, AllocationSite
using Test

@check_allocs mymul(x,y) = x * y
@test_throws AllocCheckFailure mymul(rand(10,10), rand(10,10))

Something about throwing the error + --check-bounds=yes seems to combine to produce this bug.

Run as julia +nightly --project=env --check-bounds=yes mwe.jl to get a segfault:

free(): invalid pointer

[484899] signal 6 (-6): Aborted
in expression starting at /home/topolarity/repos/AllocCheck/mwe.jl:9
pthread_kill at /lib/x86_64-linux-gnu/libc.so.6 (unknown line)
raise at /lib/x86_64-linux-gnu/libc.so.6 (unknown line)
abort at /lib/x86_64-linux-gnu/libc.so.6 (unknown line)
unknown function (ip: 0x7f82e3bee675)
unknown function (ip: 0x7f82e3c05cfb)
unknown function (ip: 0x7f82e3c07a43)
free at /lib/x86_64-linux-gnu/libc.so.6 (unknown line)
_ZN4llvm10TimerGroupD1Ev at /home/topolarity/.julia/juliaup/julia-nightly/bin/../lib/julia/libLLVM.so.18.1jl (unknown line)
~TimePassesHandler at /cache/build/builder-amdci5-7/julialang/julia-master/usr/include/llvm/IR/PassTimingInfo.h:78 [inlined]
~StandardInstrumentations at /cache/build/builder-amdci5-7/julialang/julia-master/usr/include/llvm/Passes/StandardInstrumentations.h:568 [inlined]
run at /cache/build/builder-amdci5-7/julialang/julia-master/src/pipeline.cpp:740
operator() at /cache/build/builder-amdci5-7/julialang/julia-master/src/jitlayers.cpp:1159
withModuleDo<(anonymous namespace)::OptimizerT<N>::operator()(llvm::orc::ThreadSafeModule, llvm::orc::MaterializationResponsibility&) [with long unsigned int N = 4]::<lambda(llvm::Module&)> > at /cache/build/builder-amdci5-7/julialang/julia-master/usr/include/llvm/ExecutionEngine/Orc/ThreadSafeModule.h:136 [inlined]
operator() at /cache/build/builder-amdci5-7/julialang/julia-master/src/jitlayers.cpp:1120 [inlined]
CallImpl<(anonymous namespace)::OptimizerT<4> > at /cache/build/builder-amdci5-7/julialang/julia-master/usr/include/llvm/ADT/FunctionExtras.h:221
_ZN4llvm3orc16IRTransformLayer4emitESt10unique_ptrINS0_29MaterializationResponsibilityESt14default_deleteIS3_EENS0_16ThreadSafeModuleE at /home/topolarity/.julia/juliaup/julia-nightly/bin/../lib/julia/libLLVM.so.18.1jl (unknown line)
_ZN4llvm3orc16IRTransformLayer4emitESt10unique_ptrINS0_29MaterializationResponsibilityESt14default_deleteIS3_EENS0_16ThreadSafeModuleE at /home/topolarity/.julia/juliaup/julia-nightly/bin/../lib/julia/libLLVM.so.18.1jl (unknown line)
_ZN4llvm3orc31BasicIRLayerMaterializationUnit11materializeESt10unique_ptrINS0_29MaterializationResponsibilityESt14default_deleteIS3_EE at /home/topolarity/.julia/juliaup/julia-nightly/bin/../lib/julia/libLLVM.so.18.1jl (unknown line)
_ZN4llvm3orc19MaterializationTask3runEv at /home/topolarity/.julia/juliaup/julia-nightly/bin/../lib/julia/libLLVM.so.18.1jl (unknown line)
_ZN4llvm6detail18UniqueFunctionBaseIvJSt10unique_ptrINS_3orc4TaskESt14default_deleteIS4_EEEE8CallImplIPFvS7_EEEvPvRS7_ at /home/topolarity/.julia/juliaup/julia-nightly/bin/../lib/julia/libLLVM.so.18.1jl (unknown line)
_ZN4llvm3orc16ExecutionSession22dispatchOutstandingMUsEv at /home/topolarity/.julia/juliaup/julia-nightly/bin/../lib/julia/libLLVM.so.18.1jl (unknown line)
_ZN4llvm3orc16ExecutionSession17OL_completeLookupESt10unique_ptrINS0_21InProgressLookupStateESt14default_deleteIS3_EESt10shared_ptrINS0_23AsynchronousSymbolQueryEESt8functionIFvRKNS_8DenseMapIPNS0_8JITDylibENS_8DenseSetINS0_15SymbolStringPtrENS_12DenseMapInfoISF_vEEEENSG_ISD_vEENS_6detail12DenseMapPairISD_SI_EEEEEE at /home/topolarity/.julia/juliaup/julia-nightly/bin/../lib/julia/libLLVM.so.18.1jl (unknown line)
_ZN4llvm3orc25InProgressFullLookupState8completeESt10unique_ptrINS0_21InProgressLookupStateESt14default_deleteIS3_EE at /home/topolarity/.julia/juliaup/julia-nightly/bin/../lib/julia/libLLVM.so.18.1jl (unknown line)
_ZN4llvm3orc16ExecutionSession19OL_applyQueryPhase1ESt10unique_ptrINS0_21InProgressLookupStateESt14default_deleteIS3_EENS_5ErrorE at /home/topolarity/.julia/juliaup/julia-nightly/bin/../lib/julia/libLLVM.so.18.1jl (unknown line)
_ZN4llvm3orc16ExecutionSession6lookupENS0_10LookupKindERKSt6vectorISt4pairIPNS0_8JITDylibENS0_19JITDylibLookupFlagsEESaIS8_EENS0_15SymbolLookupSetENS0_11SymbolStateENS_15unique_functionIFvNS_8ExpectedINS_8DenseMapINS0_15SymbolStringPtrENS0_17ExecutorSymbolDefENS_12DenseMapInfoISI_vEENS_6detail12DenseMapPairISI_SJ_EEEEEEEEESt8functionIFvRKNSH_IS6_NS_8DenseSetISI_SL_EENSK_IS6_vEENSN_IS6_SV_EEEEEE at /home/topolarity/.julia/juliaup/julia-nightly/bin/../lib/julia/libLLVM.so.18.1jl (unknown line)
_ZN4llvm3orc16ExecutionSession6lookupERKSt6vectorISt4pairIPNS0_8JITDylibENS0_19JITDylibLookupFlagsEESaIS7_EENS0_15SymbolLookupSetENS0_10LookupKindENS0_11SymbolStateESt8functionIFvRKNS_8DenseMapIS5_NS_8DenseSetINS0_15SymbolStringPtrENS_12DenseMapInfoISI_vEEEENSJ_IS5_vEENS_6detail12DenseMapPairIS5_SL_EEEEEE at /home/topolarity/.julia/juliaup/julia-nightly/bin/../lib/julia/libLLVM.so.18.1jl (unknown line)
addModule at /cache/build/builder-amdci5-7/julialang/julia-master/src/jitlayers.cpp:1776
jl_add_to_ee at /cache/build/builder-amdci5-7/julialang/julia-master/src/jitlayers.cpp:2370
_jl_compile_codeinst at /cache/build/builder-amdci5-7/julialang/julia-master/src/jitlayers.cpp:288
jl_compile_codeinst_impl at /cache/build/builder-amdci5-7/julialang/julia-master/src/jitlayers.cpp:522
jl_compile_method_internal at /cache/build/builder-amdci5-7/julialang/julia-master/src/gf.c:2817
_jl_invoke at /cache/build/builder-amdci5-7/julialang/julia-master/src/gf.c:3266 [inlined]
ijl_apply_generic at /cache/build/builder-amdci5-7/julialang/julia-master/src/gf.c:3462
jl_apply at /cache/build/builder-amdci5-7/julialang/julia-master/src/julia.h:2228 [inlined]
do_apply at /cache/build/builder-amdci5-7/julialang/julia-master/src/builtins.c:839
printstyled at ./util.jl:141
jl_apply at /cache/build/builder-amdci5-7/julialang/julia-master/src/julia.h:2228 [inlined]
do_apply at /cache/build/builder-amdci5-7/julialang/julia-master/src/builtins.c:839
#print_within_stacktrace#483 at ./show.jl:2557
print_within_stacktrace at ./show.jl:2555 [inlined]
show_signature_function at ./show.jl:2549
#show_tuple_as_call#484 at ./show.jl:2583
show_tuple_as_call at ./show.jl:2563 [inlined]
show_spec_sig at ./stacktraces.jl:282
show_spec_linfo at ./stacktraces.jl:249
print_stackframe at ./errorshow.jl:778
print_stackframe at ./errorshow.jl:745
#show_full_backtrace#820 at ./errorshow.jl:644
show_full_backtrace at ./errorshow.jl:637 [inlined]
show_backtrace at ./errorshow.jl:839
#showerror#808 at ./errorshow.jl:108
showerror at ./errorshow.jl:104
unknown function (ip: 0x7f82b75597f2)
show_exception_stack at ./errorshow.jl:1012
unknown function (ip: 0x7f82b754dbe6)
#sprint#435 at ./strings/io.jl:115
sprint at ./strings/io.jl:110
unknown function (ip: 0x7f82b754d6bd)
jl_apply at /cache/build/builder-amdci5-7/julialang/julia-master/src/julia.h:2228 [inlined]
jl_f__call_latest at /cache/build/builder-amdci5-7/julialang/julia-master/src/builtins.c:883
jl_apply at /cache/build/builder-amdci5-7/julialang/julia-master/src/julia.h:2228 [inlined]
do_apply at /cache/build/builder-amdci5-7/julialang/julia-master/src/builtins.c:839
#invokelatest#1 at ./essentials.jl:1050
jl_apply at /cache/build/builder-amdci5-7/julialang/julia-master/src/julia.h:2228 [inlined]
do_apply at /cache/build/builder-amdci5-7/julialang/julia-master/src/builtins.c:839
invokelatest at ./essentials.jl:1045
do_test_throws at /cache/build/builder-amdci5-7/julialang/julia-master/usr/share/julia/stdlib/v1.12/Test/src/Test.jl:841
jl_apply at /cache/build/builder-amdci5-7/julialang/julia-master/src/julia.h:2228 [inlined]
do_call at /cache/build/builder-amdci5-7/julialang/julia-master/src/interpreter.c:125
eval_value at /cache/build/builder-amdci5-7/julialang/julia-master/src/interpreter.c:222
eval_stmt_value at /cache/build/builder-amdci5-7/julialang/julia-master/src/interpreter.c:173 [inlined]
eval_body at /cache/build/builder-amdci5-7/julialang/julia-master/src/interpreter.c:685
jl_interpret_toplevel_thunk at /cache/build/builder-amdci5-7/julialang/julia-master/src/interpreter.c:892
jl_toplevel_eval_flex at /cache/build/builder-amdci5-7/julialang/julia-master/src/toplevel.c:1047
jl_toplevel_eval_flex at /cache/build/builder-amdci5-7/julialang/julia-master/src/toplevel.c:987
ijl_toplevel_eval at /cache/build/builder-amdci5-7/julialang/julia-master/src/toplevel.c:1058
ijl_toplevel_eval_in at /cache/build/builder-amdci5-7/julialang/julia-master/src/toplevel.c:1100
eval at ./boot.jl:439 [inlined]
include_string at ./loading.jl:2740
_include at ./loading.jl:2800
include at ./Base.jl:581 [inlined]
exec_options at ./client.jl:329
_start at ./client.jl:558
jfptr__start_65775.1 at /home/topolarity/.julia/juliaup/julia-nightly/lib/julia/sys.so (unknown line)
jl_apply at /cache/build/builder-amdci5-7/julialang/julia-master/src/julia.h:2228 [inlined]
true_main at /cache/build/builder-amdci5-7/julialang/julia-master/src/jlapi.c:900
jl_repl_entrypoint at /cache/build/builder-amdci5-7/julialang/julia-master/src/jlapi.c:1059
main at /cache/build/builder-amdci5-7/julialang/julia-master/cli/loader_exe.c:58
unknown function (ip: 0x7f82e3b8ed8f)
__libc_start_main at /lib/x86_64-linux-gnu/libc.so.6 (unknown line)
unknown function (ip: 0x4010b8)
Allocations: 14890112 (Pool: 14889854; Big: 258); GC: 11

Or remove the @test_throws AllocCheckFailure to get a different failure:

ERROR: LoadError: LLVM error: Instruction Combining did not reach a fixpoint after 1 iterations
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions