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

Failing test - gc.lua #52

Open
Pavel-Durov opened this issue Aug 16, 2023 · 2 comments
Open

Failing test - gc.lua #52

Pavel-Durov opened this issue Aug 16, 2023 · 2 comments
Labels
non-serialised-compilation-error Errors related to non-sync yk compilation - YKD_SERIALISE_COMPILATION=0

Comments

@Pavel-Durov
Copy link
Contributor

Issue

Failing test gc.lua.

Reproduction

$ YKD_SERIALISE_COMPILATION=0 ../try_repeat 1000  ../src/lua gc.lua
lua: yk/ykllvm/llvm/lib/IR/Value.cpp:286: llvm::ValueName *llvm::Value::getValueName() const: Assertion `I != Ctx.pImpl->ValueNames.end() && "No name entry found!"' failed.

$  YKD_SERIALISE_COMPILATION=1  ../src/lua gc.lua
Segmentation fault

Backtrace

$ YKD_SERIALISE_COMPILATION=1 gdb --batch -ex "r" -ex "bt" --args  ../src/lua gc.lua
 >>> testC not active: skipping userdata GC tests <<<

lua: /home/pd/git-repos/yk/ykllvm/llvm/lib/IR/Value.cpp:286: llvm::ValueName *llvm::Value::getValueName() const: Assertion `I != Ctx.pImpl->ValueNames.end() && "No name entry found!"' failed.

Thread 15 "lua" received signal SIGABRT, Aborted.
[Switching to Thread 0x7ffff082b6c0 (LWP 3037448)]
__pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at ./nptl/pthread_kill.c:44
44      ./nptl/pthread_kill.c: No such file or directory.
#0  __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at ./nptl/pthread_kill.c:44
#1  0x00007ffff78a9d2f in __pthread_kill_internal (signo=6, threadid=<optimized out>) at ./nptl/pthread_kill.c:78
#2  0x00007ffff785aef2 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
#3  0x00007ffff7845472 in __GI_abort () at ./stdlib/abort.c:79
#4  0x00007ffff7845395 in __assert_fail_base (fmt=0x7ffff79b9a70 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x7ffff5e6cf11 "I != Ctx.pImpl->ValueNames.end() && \"No name entry found!\"", file=file@entry=0x7ffff5e6cca6 "/home/pd/git-repos/yk/ykllvm/llvm/lib/IR/Value.cpp", line=line@entry=286, function=function@entry=0x7ffff5e6cf4c "llvm::ValueName *llvm::Value::getValueName() const") at ./assert/assert.c:92
#5  0x00007ffff7853df2 in __GI___assert_fail (assertion=0x7ffff5e6cf11 "I != Ctx.pImpl->ValueNames.end() && \"No name entry found!\"", file=0x7ffff5e6cca6 "/home/pd/git-repos/yk/ykllvm/llvm/lib/IR/Value.cpp", line=286, function=0x7ffff5e6cf4c "llvm::ValueName *llvm::Value::getValueName() const") at ./assert/assert.c:101
#6  0x00007ffff5cc4b12 in llvm::Value::getValueName() const () from /home/pd/git-repos/yk/target/debug/ykllvm/lib/libLLVMCore.so.16git
#7  0x00007ffff5cc490c in llvm::Value::~Value() () from /home/pd/git-repos/yk/target/debug/ykllvm/lib/libLLVMCore.so.16git
#8  0x00007ffff5cc4417 in llvm::Value::deleteValue() () from /home/pd/git-repos/yk/target/debug/ykllvm/lib/libLLVMCore.so.16git
#9  0x00007ffff5c23bf2 in llvm::Instruction::eraseFromParent() () from /home/pd/git-repos/yk/target/debug/ykllvm/lib/libLLVMCore.so.16git
#10 0x00007ffff610b0d8 in llvm::formLCSSAForInstructions(llvm::SmallVectorImpl<llvm::Instruction*>&, llvm::DominatorTree const&, llvm::LoopInfo const&, llvm::ScalarEvolution*, llvm::IRBuilderBase&, llvm::SmallVectorImpl<llvm::PHINode*>*) () from /home/pd/git-repos/yk/target/debug/ykllvm/lib/libLLVMTransformUtils.so.16git
#11 0x00007ffff610bcc3 in llvm::formLCSSA(llvm::Loop&, llvm::DominatorTree const&, llvm::LoopInfo const*, llvm::ScalarEvolution*) () from /home/pd/git-repos/yk/target/debug/ykllvm/lib/libLLVMTransformUtils.so.16git
#12 0x00007ffff610bf97 in llvm::formLCSSARecursively(llvm::Loop&, llvm::DominatorTree const&, llvm::LoopInfo const*, llvm::ScalarEvolution*) () from /home/pd/git-repos/yk/target/debug/ykllvm/lib/libLLVMTransformUtils.so.16git
#13 0x00007ffff610ded1 in (anonymous namespace)::LCSSAWrapperPass::runOnFunction(llvm::Function&) () from /home/pd/git-repos/yk/target/debug/ykllvm/lib/libLLVMTransformUtils.so.16git
#14 0x00007ffff5c57997 in llvm::FPPassManager::runOnFunction(llvm::Function&) () from /home/pd/git-repos/yk/target/debug/ykllvm/lib/libLLVMCore.so.16git
#15 0x00007ffff5c5fb21 in llvm::FPPassManager::runOnModule(llvm::Module&) () from /home/pd/git-repos/yk/target/debug/ykllvm/lib/libLLVMCore.so.16git
#16 0x00007ffff5c58435 in llvm::legacy::PassManagerImpl::run(llvm::Module&) () from /home/pd/git-repos/yk/target/debug/ykllvm/lib/libLLVMCore.so.16git
#17 0x00007ffff7c10198 in compileIRTrace<std::tuple<llvm::Module*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::map<llvm::GlobalValue*, void*, std::less<llvm::GlobalValue*>, std::allocator<std::pair<llvm::GlobalValue* const, void*> > >, void*, unsigned long> (*)(llvm::Module*, char**, unsigned long*, unsigned long, char**, void**, unsigned long)> (Func=0x7ffff7c1a540 <createModule[abi:cxx11](llvm::Module*, char**, unsigned long*, unsigned long, char**, void**, unsigned long)>, FuncNames=0x7fffd00045b0, BBs=0x7fffd0008770, TraceLen=318, FAddrKeys=0x7fffd0005170, FAddrVals=0x7fffd0005280, FAddrLen=17, BitcodeData=0x257180 <llvm.embedded[module]+8>, BitcodeLen=3612280, DebugInfoFD=-1, DebugInfoPath=0x0) at src/ykllvmwrap.cc:432
#18 0x00007ffff7c0ffae in __yktracec_irtrace_compile (FuncNames=0x7fffd00045b0, BBs=0x7fffd0008770, TraceLen=318, FAddrKeys=0x7fffd0005170, FAddrVals=0x7fffd0005280, FAddrLen=17, BitcodeData=0x257180 <llvm.embedded[module]+8>, BitcodeLen=3612280, DebugInfoFD=-1, DebugInfoPath=0x0) at src/ykllvmwrap.cc:450
#19 0x00007ffff7a83568 in ykrt::trace::IRTrace::compile (self=0x7ffff082a700) at ykrt/src/trace/mod.rs:178
#20 0x00007ffff7a8789f in ykrt::mt::{impl#0}::queue_compile_job::{closure#0} () at ykrt/src/mt.rs:389
#21 0x00007ffff7a64e2e in core::ops::function::FnOnce::call_once<ykrt::mt::{impl#0}::queue_compile_job::{closure_env#0}, ()> () at /rustc/1d56e3a6d943062e41165bf07fea5ea8324ae011/library/core/src/ops/function.rs:250
#22 0x00007ffff7a5f1a8 in alloc::boxed::{impl#47}::call_once<(), (dyn core::ops::function::FnOnce<(), Output=()> + core::marker::Send), alloc::alloc::Global> (self=..., args=()) at /rustc/1d56e3a6d943062e41165bf07fea5ea8324ae011/library/alloc/src/boxed.rs:2007
#23 0x00007ffff7a8a5fb in lock_api::mutex::MutexGuard<parking_lot::raw_mutex::RawMutex, alloc::collections::vec_deque::VecDeque<alloc::boxed::Box<(dyn core::ops::function::FnOnce<(), Output=()> + core::marker::Send), alloc::alloc::Global>, alloc::alloc::Global>>::unlocked<parking_lot::raw_mutex::RawMutex, alloc::collections::vec_deque::VecDeque<alloc::boxed::Box<(dyn core::ops::function::FnOnce<(), Output=()> + core::marker::Send), alloc::alloc::Global>, alloc::alloc::Global>, alloc::boxed::Box<(dyn core::ops::function::FnOnce<(), Output=()> + core::marker::Send), alloc::alloc::Global>, ()> (s=0x7ffff082a980, f=...) at /home/pd/.cargo/registry/src/index.crates.io-6f17d22bba15001f/lock_api-0.4.10/src/mutex.rs:567
#24 0x00007ffff7a86201 in ykrt::mt::{impl#0}::queue_job::{closure#0} () at ykrt/src/mt.rs:163
#25 0x00007ffff7aa1913 in std::sys_common::backtrace::__rust_begin_short_backtrace<ykrt::mt::{impl#0}::queue_job::{closure_env#0}, ()> (f=...) at /rustc/1d56e3a6d943062e41165bf07fea5ea8324ae011/library/std/src/sys_common/backtrace.rs:135
#26 0x00007ffff7a85ee4 in std::thread::{impl#0}::spawn_unchecked_::{closure#1}::{closure#0}<ykrt::mt::{impl#0}::queue_job::{closure_env#0}, ()> () at /rustc/1d56e3a6d943062e41165bf07fea5ea8324ae011/library/std/src/thread/mod.rs:529
#27 0x00007ffff7aa4924 in core::panic::unwind_safe::{impl#23}::call_once<(), std::thread::{impl#0}::spawn_unchecked_::{closure#1}::{closure_env#0}<ykrt::mt::{impl#0}::queue_job::{closure_env#0}, ()>> (self=...) at /rustc/1d56e3a6d943062e41165bf07fea5ea8324ae011/library/core/src/panic/unwind_safe.rs:271
#28 0x00007ffff7a7ccb6 in std::panicking::try::do_call<core::panic::unwind_safe::AssertUnwindSafe<std::thread::{impl#0}::spawn_unchecked_::{closure#1}::{closure_env#0}<ykrt::mt::{impl#0}::queue_job::{closure_env#0}, ()>>, ()> (data=0x7ffff082aad0) at /rustc/1d56e3a6d943062e41165bf07fea5ea8324ae011/library/std/src/panicking.rs:524
#29 0x00007ffff7a7cf1b in __rust_try () from /home/pd/git-repos/yk/bin/../target/debug/deps/libykcapi.so
#30 0x00007ffff7a7cb6e in std::panicking::try<(), core::panic::unwind_safe::AssertUnwindSafe<std::thread::{impl#0}::spawn_unchecked_::{closure#1}::{closure_env#0}<ykrt::mt::{impl#0}::queue_job::{closure_env#0}, ()>>> (f=...) at /rustc/1d56e3a6d943062e41165bf07fea5ea8324ae011/library/std/src/panicking.rs:488
#31 0x00007ffff7a85d1a in std::panic::catch_unwind<core::panic::unwind_safe::AssertUnwindSafe<std::thread::{impl#0}::spawn_unchecked_::{closure#1}::{closure_env#0}<ykrt::mt::{impl#0}::queue_job::{closure_env#0}, ()>>, ()> (f=...) at /rustc/1d56e3a6d943062e41165bf07fea5ea8324ae011/library/std/src/panic.rs:142
#32 std::thread::{impl#0}::spawn_unchecked_::{closure#1}<ykrt::mt::{impl#0}::queue_job::{closure_env#0}, ()> () at /rustc/1d56e3a6d943062e41165bf07fea5ea8324ae011/library/std/src/thread/mod.rs:528
#33 0x00007ffff7a64daf in core::ops::function::FnOnce::call_once<std::thread::{impl#0}::spawn_unchecked_::{closure_env#1}<ykrt::mt::{impl#0}::queue_job::{closure_env#0}, ()>, ()> () at /rustc/1d56e3a6d943062e41165bf07fea5ea8324ae011/library/core/src/ops/function.rs:250
#34 0x00007ffff7c91455 in alloc::boxed::{impl#47}::call_once<(), dyn core::ops::function::FnOnce<(), Output=()>, alloc::alloc::Global> () at library/alloc/src/boxed.rs:2007
#35 alloc::boxed::{impl#47}::call_once<(), alloc::boxed::Box<dyn core::ops::function::FnOnce<(), Output=()>, alloc::alloc::Global>, alloc::alloc::Global> () at library/alloc/src/boxed.rs:2007
#36 std::sys::unix::thread::{impl#2}::new::thread_start () at library/std/src/sys/unix/thread.rs:108
#37 0x00007ffff78a7fd4 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
#38 0x00007ffff79285bc in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
$ YKD_SERIALISE_COMPILATION=1 gdb --batch -ex "r" -ex "bt" --args  ../src/lua gc.lua
Thread 1 "lua" received signal SIGSEGV, Segmentation fault.
core::sync::atomic::AtomicUsize::fetch_sub () at /rustc/1d56e3a6d943062e41165bf07fea5ea8324ae011/library/core/src/sync/atomic.rs:2529
2529    /rustc/1d56e3a6d943062e41165bf07fea5ea8324ae011/library/core/src/sync/atomic.rs: No such file or directory.
#0  core::sync::atomic::AtomicUsize::fetch_sub () at /rustc/1d56e3a6d943062e41165bf07fea5ea8324ae011/library/core/src/sync/atomic.rs:2529
#1  alloc::sync::{impl#33}::drop<lock_api::mutex::Mutex<parking_lot::raw_mutex::RawMutex, ykrt::location::HotLocation>, alloc::alloc::Global> (self=0x7fffffffbb10) at /rustc/1d56e3a6d943062e41165bf07fea5ea8324ae011/library/alloc/src/sync.rs:2372
#2  0x00007ffff7a657eb in core::ptr::drop_in_place<alloc::sync::Arc<lock_api::mutex::Mutex<parking_lot::raw_mutex::RawMutex, ykrt::location::HotLocation>, alloc::alloc::Global>> () at /rustc/1d56e3a6d943062e41165bf07fea5ea8324ae011/library/core/src/ptr/mod.rs:497
#3  0x00007ffff7a6cd2e in core::mem::drop<alloc::sync::Arc<lock_api::mutex::Mutex<parking_lot::raw_mutex::RawMutex, ykrt::location::HotLocation>, alloc::alloc::Global>> (_x=...) at /rustc/1d56e3a6d943062e41165bf07fea5ea8324ae011/library/core/src/mem/mod.rs:987
#4  0x00007ffff7a6a510 in ykrt::location::{impl#1}::drop (self=0x7fffffffbb68) at ykrt/src/location.rs:196
#5  0x00007ffff7a5d6cb in core::ptr::drop_in_place<ykrt::location::Location> () at /rustc/1d56e3a6d943062e41165bf07fea5ea8324ae011/library/core/src/ptr/mod.rs:497
#6  0x00007ffff7a5cf3d in core::mem::drop<ykrt::location::Location> (_x=...) at /rustc/1d56e3a6d943062e41165bf07fea5ea8324ae011/library/core/src/mem/mod.rs:987
#7  0x00007ffff7a5cc8d in ykcapi::yk_location_drop (loc=...) at ykcapi/src/lib.rs:87
#8  0x000000000088a49e in free_loc (f=<optimized out>, i=<optimized out>, idx=<optimized out>) at lyk.c:66
#9  0x000000000088a608 in yk_free_locactions (f=0x39ce430) at lyk.c:72
#10 0x00000000008071c8 in luaF_freeproto (L=0x916e68, f=0x39ce430) at lfunc.c:276
#11 0x0000000000809a6e in freeobj (L=0x916e68, o=0x39ce430) at lgc.c:767
#12 0x00000000008097da in sweeplist (L=0x916e68, p=<optimized out>, countin=<optimized out>, countout=<optimized out>) at lgc.c:827
#13 0x00000000008141e7 in sweepstep (L=0x916e68, g=<optimized out>, nextstate=<optimized out>, nextlist=<optimized out>) at lgc.c:1566
#14 0x0000000000813914 in singlestep (L=0x916e68) at lgc.c:1606
#15 0x00000000008152b9 in incstep (L=0x916e68, g=<optimized out>) at lgc.c:1667
#16 0x0000000000814b38 in luaC_step (L=0x916e68) at lgc.c:1688
#17 0x0000000000820b18 in close_func (ls=<optimized out>) at lparser.c:772
#18 0x000000000081f5c2 in mainfunc (ls=0x7ffff2b36e80, fs=<optimized out>) at lparser.c:1937
#19 0x000000000081f13a in luaY_parser (L=0x916e68, z=0x7ffff2b36c08, buff=<optimized out>, dyd=<optimized out>, name=<optimized out>, firstchar=<optimized out>) at lparser.c:1959
#20 0x0000000000801a13 in f_parser (L=0x916e68, ud=<optimized out>) at ldo.c:971
#21 0x00000000007f8677 in luaD_rawrunprotected (L=0x916e68, f=0x801600 <f_parser>, ud=0x7ffff2b36c70) at ldo.c:144
#22 0x0000000000800e96 in luaD_pcall (L=0x916e68, func=0x801600 <f_parser>, u=0x7ffff2b36c70, old_top=<optimized out>, ef=<optimized out>) at ldo.c:926
#23 0x00000000008013f1 in luaD_protectedparser (L=0x916e68, z=<optimized out>, name=<optimized out>, mode=<optimized out>) at ldo.c:988
#24 0x00000000007eac28 in lua_load (L=0x916e68, reader=<optimized out>, data=<optimized out>, chunkname=0x926fc8 "", mode=0x2553bc "bt") at lapi.c:1097
#25 0x0000000000893911 in luaL_loadbufferx (L=0x916e68, buff=<optimized out>, size=<optimized out>, name=0x926fc8 "", mode=0x2553bc "bt") at lauxlib.c:833
#26 0x0000000000898721 in luaB_load (L=0x916e68) at lbaselib.c:395
#27 0x00000000007fd505 in precallC (L=0x916e68, func=<optimized out>, nresults=<optimized out>, f=0x8983e0 <luaB_load>) at ldo.c:506
#28 0x00000000007fdb58 in luaD_precall (L=0x916e68, func=0x935ae0, nresults=-1) at ldo.c:572
#29 0x00000000008839f8 in luaV_execute (L=0x916e68, ci=<optimized out>) at lvm.c:1655
#30 0x00000000007fe5cb in ccall (L=0x916e68, func=<optimized out>, nResults=<optimized out>, inc=<optimized out>) at ldo.c:609
#31 0x00000000007fe6f1 in luaD_callnoyield (L=0x916e68, func=0x917720, nResults=-1) at ldo.c:627
#32 0x00000000007ea993 in f_call (L=0x916e68, ud=<optimized out>) at lapi.c:1041
#33 0x00000000007f8677 in luaD_rawrunprotected (L=0x916e68, f=0x7ea8d0 <f_call>, ud=0x7ffff2b36308) at ldo.c:144
#34 0x0000000000800e96 in luaD_pcall (L=0x916e68, func=0x7ea8d0 <f_call>, u=0x7ffff2b36308, old_top=<optimized out>, ef=<optimized out>) at ldo.c:926
#35 0x00000000007ea47c in lua_pcallk (L=0x916e68, nargs=<optimized out>, nresults=<optimized out>, errfunc=<optimized out>, ctx=<optimized out>, k=<optimized out>) at lapi.c:1067
#36 0x00000000007dc0b3 in docall (L=0x916e68, narg=0, nres=-1) at lua.c:160
#37 0x00000000007db7b4 in handle_script (L=0x916e68, argv=<optimized out>) at lua.c:255
#38 0x00000000007d9a73 in pmain (L=0x916e68) at lua.c:634
#39 0x00000000007fd505 in precallC (L=0x916e68, func=<optimized out>, nresults=<optimized out>, f=0x7d9280 <pmain>) at ldo.c:506
#40 0x00000000007fdb58 in luaD_precall (L=0x916e68, func=0x9176e0, nresults=1) at ldo.c:572
#41 0x00000000007fe50f in ccall (L=0x916e68, func=0x9176e0, nResults=1, inc=<optimized out>) at ldo.c:607
#42 0x00000000007fe6f1 in luaD_callnoyield (L=0x916e68, func=0x9176e0, nResults=1) at ldo.c:627
#43 0x00000000007ea993 in f_call (L=0x916e68, ud=<optimized out>) at lapi.c:1041
#44 0x00000000007f8677 in luaD_rawrunprotected (L=0x916e68, f=0x7ea8d0 <f_call>, ud=0x7ffff2b36058) at ldo.c:144
#45 0x0000000000800e96 in luaD_pcall (L=0x916e68, func=0x7ea8d0 <f_call>, u=0x7ffff2b36058, old_top=<optimized out>, ef=<optimized out>) at ldo.c:926
#46 0x00000000007ea47c in lua_pcallk (L=0x916e68, nargs=<optimized out>, nresults=<optimized out>, errfunc=<optimized out>, ctx=<optimized out>, k=<optimized out>) at lapi.c:1067
#47 0x00000000007d8f40 in main (argc=<optimized out>, argv=<optimized out>) at lua.c:660

Versions

YKLua -main/98807dcb129adae7f3a0f43c02061282b0a9d514
YK - master/44b8f950a9c013aba4b5f922418b32baae7594bf

@Pavel-Durov Pavel-Durov added the non-serialised-compilation-error Errors related to non-sync yk compilation - YKD_SERIALISE_COMPILATION=0 label Sep 20, 2023
@Pavel-Durov
Copy link
Contributor Author

YkLua - main/950a7ab826cdc502b91976c28f879a12a3573a3d
Yk - master/4a955668d5a6647c5de8f043314983f057a5039e

Backtrace:

YKD_SERIALISE_COMPILATION=0 gdb -batch --ex 'r' --ex 'bt' --args  ../src/lua gc.lua 

0x00007ffff555ab58 in llvm::StringMapImpl::FindKey(llvm::StringRef) const () from /home/pd/yk-fork/target/debug/ykllvm/lib/libLLVMSupport.so.16git
#0  0x00007ffff555ab58 in llvm::StringMapImpl::FindKey(llvm::StringRef) const () from /home/pd/yk-fork/target/debug/ykllvm/lib/libLLVMSupport.so.16git
#1  0x00007ffff5a95fee in llvm::collectUsedGlobalVariables(llvm::Module const&, llvm::SmallVectorImpl<llvm::GlobalValue*>&, bool) () from /home/pd/yk-fork/target/debug/ykllvm/lib/libLLVMCore.so.16git
#2  0x00007ffff487ca71 in llvm::TargetLoweringObjectFileELF::getModuleMetadata(llvm::Module&) () from /home/pd/yk-fork/target/debug/ykllvm/lib/../lib/libLLVMCodeGen.so.16git
#3  0x00007ffff56e97a5 in llvm::AsmPrinter::doInitialization(llvm::Module&) () from /home/pd/yk-fork/target/debug/ykllvm/lib/../lib/libLLVMAsmPrinter.so.16git
#4  0x00007ffff5a5bbe8 in llvm::FPPassManager::doInitialization(llvm::Module&) () from /home/pd/yk-fork/target/debug/ykllvm/lib/libLLVMCore.so.16git
#5  0x00007ffff5a67d16 in llvm::legacy::PassManagerImpl::run(llvm::Module&) () from /home/pd/yk-fork/target/debug/ykllvm/lib/libLLVMCore.so.16git
#6  0x00007ffff7df49bf in llvm::MCJIT::emitObject(llvm::Module*) () from /home/pd/yk-fork/target/debug/ykllvm/lib/libLLVMMCJIT.so.16git
#7  0x00007ffff7df5282 in llvm::MCJIT::generateCodeForModule(llvm::Module*) () from /home/pd/yk-fork/target/debug/ykllvm/lib/libLLVMMCJIT.so.16git
#8  0x00007ffff7def504 in llvm::MCJIT::finalizeObject() () from /home/pd/yk-fork/target/debug/ykllvm/lib/libLLVMMCJIT.so.16git
#9  0x00007ffff7bedcc1 in compileModule (TraceName="__yk_compiled_trace_9", M=0x7fffd0024b50, GlobalMappings=std::map with 2 elements = {...}, LiveAOTVals=0x7fffd0918610, GuardCount=21) at src/ykllvmwrap.cc:266
#10 0x00007ffff7bef7ab in compileIRTrace<std::tuple<llvm::Module*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::map<llvm::GlobalValue*, void*, std::less<llvm::GlobalValue*>, std::allocator<std::pair<llvm::GlobalValue* const, void*> > >, void*, unsigned long> (*)(llvm::Module*, char**, unsigned long*, unsigned long, char**, void**, unsigned long)> (Func=0x7ffff7bf9b00 <createModule[abi:cxx11](llvm::Module*, char**, unsigned long*, unsigned long, char**, void**, unsigned long)>, FuncNames=0x7fffd00ab430, BBs=0x7fffd0ad2480, TraceLen=101, FAddrKeys=0x7fffd00016b0, FAddrVals=0x7fffd0010040, FAddrLen=6, BitcodeData=0x256f40 <llvm.embedded[module]+8>, BitcodeLen=3618920, DebugInfoFD=-1, DebugInfoPath=0x0) at src/ykllvmwrap.cc:442
#11 0x00007ffff7bef4de in __yktracec_irtrace_compile (FuncNames=0x7fffd00ab430, BBs=0x7fffd0ad2480, TraceLen=101, FAddrKeys=0x7fffd00016b0, FAddrVals=0x7fffd0010040, FAddrLen=6, BitcodeData=0x256f40 <llvm.embedded[module]+8>, BitcodeLen=3618920, DebugInfoFD=-1, DebugInfoPath=0x0) at src/ykllvmwrap.cc:450
#12 0x00007ffff7a7a0f8 in ykrt::compile::jitc_llvm::{impl#0}::compile (self=0x91b720, mt=..., irtrace=...) at ykrt/src/compile/jitc_llvm.rs:38
#13 0x00007ffff7a7ccad in ykrt::mt::{impl#0}::queue_compile_job::{closure#0} () at ykrt/src/mt.rs:397
#14 0x00007ffff7a63bce in core::ops::function::FnOnce::call_once<ykrt::mt::{impl#0}::queue_compile_job::{closure_env#0}, ()> () at /rustc/8142a319ed5c1d1f96e5a1881a6546e463b77c8f/library/core/src/ops/function.rs:250
#15 0x00007ffff7a63928 in alloc::boxed::{impl#47}::call_once<(), (dyn core::ops::function::FnOnce<(), Output=()> + core::marker::Send), alloc::alloc::Global> (self=..., args=()) at /rustc/8142a319ed5c1d1f96e5a1881a6546e463b77c8f/library/alloc/src/boxed.rs:2007
#16 0x00007ffff7a830ab in lock_api::mutex::MutexGuard<parking_lot::raw_mutex::RawMutex, alloc::collections::vec_deque::VecDeque<alloc::boxed::Box<(dyn core::ops::function::FnOnce<(), Output=()> + core::marker::Send), alloc::alloc::Global>, alloc::alloc::Global>>::unlocked<parking_lot::raw_mutex::RawMutex, alloc::collections::vec_deque::VecDeque<alloc::boxed::Box<(dyn core::ops::function::FnOnce<(), Output=()> + core::marker::Send), alloc::alloc::Global>, alloc::alloc::Global>, alloc::boxed::Box<(dyn core::ops::function::FnOnce<(), Output=()> + core::marker::Send), alloc::alloc::Global>, ()> (s=0x7ffff0a399e0, f=...) at /home/pd/.cargo/registry/src/index.crates.io-6f17d22bba15001f/lock_api-0.4.10/src/mutex.rs:567
#17 0x00007ffff7a7b4d1 in ykrt::mt::{impl#0}::queue_job::{closure#0} () at ykrt/src/mt.rs:168
#18 0x00007ffff7a7d3b3 in std::sys_common::backtrace::__rust_begin_short_backtrace<ykrt::mt::{impl#0}::queue_job::{closure_env#0}, ()> (f=...) at /rustc/8142a319ed5c1d1f96e5a1881a6546e463b77c8f/library/std/src/sys_common/backtrace.rs:154
#19 0x00007ffff7a6a254 in std::thread::{impl#0}::spawn_unchecked_::{closure#1}::{closure#0}<ykrt::mt::{impl#0}::queue_job::{closure_env#0}, ()> () at /rustc/8142a319ed5c1d1f96e5a1881a6546e463b77c8f/library/std/src/thread/mod.rs:529
#20 0x00007ffff7a6f424 in core::panic::unwind_safe::{impl#23}::call_once<(), std::thread::{impl#0}::spawn_unchecked_::{closure#1}::{closure_env#0}<ykrt::mt::{impl#0}::queue_job::{closure_env#0}, ()>> (self=...) at /rustc/8142a319ed5c1d1f96e5a1881a6546e463b77c8f/library/core/src/panic/unwind_safe.rs:271
#21 0x00007ffff7a6ea77 in std::panicking::try::do_call<core::panic::unwind_safe::AssertUnwindSafe<std::thread::{impl#0}::spawn_unchecked_::{closure#1}::{closure_env#0}<ykrt::mt::{impl#0}::queue_job::{closure_env#0}, ()>>, ()> (data=0x7ffff0a39b00) at /rustc/8142a319ed5c1d1f96e5a1881a6546e463b77c8f/library/std/src/panicking.rs:526
#22 0x00007ffff7a6ecdb in __rust_try () from /home/pd/yk-fork/bin/../target/debug/deps/libykcapi.so
#23 0x00007ffff7a6e97e in std::panicking::try<(), core::panic::unwind_safe::AssertUnwindSafe<std::thread::{impl#0}::spawn_unchecked_::{closure#1}::{closure_env#0}<ykrt::mt::{impl#0}::queue_job::{closure_env#0}, ()>>> (f=...) at /rustc/8142a319ed5c1d1f96e5a1881a6546e463b77c8f/library/std/src/panicking.rs:490
#24 0x00007ffff7a6a096 in std::panic::catch_unwind<core::panic::unwind_safe::AssertUnwindSafe<std::thread::{impl#0}::spawn_unchecked_::{closure#1}::{closure_env#0}<ykrt::mt::{impl#0}::queue_job::{closure_env#0}, ()>>, ()> (f=...) at /rustc/8142a319ed5c1d1f96e5a1881a6546e463b77c8f/library/std/src/panic.rs:142
#25 std::thread::{impl#0}::spawn_unchecked_::{closure#1}<ykrt::mt::{impl#0}::queue_job::{closure_env#0}, ()> () at /rustc/8142a319ed5c1d1f96e5a1881a6546e463b77c8f/library/std/src/thread/mod.rs:528
#26 0x00007ffff7a63caf in core::ops::function::FnOnce::call_once<std::thread::{impl#0}::spawn_unchecked_::{closure_env#1}<ykrt::mt::{impl#0}::queue_job::{closure_env#0}, ()>, ()> () at /rustc/8142a319ed5c1d1f96e5a1881a6546e463b77c8f/library/core/src/ops/function.rs:250
#27 0x00007ffff7c801e5 in alloc::boxed::{impl#47}::call_once<(), dyn core::ops::function::FnOnce<(), Output=()>, alloc::alloc::Global> () at library/alloc/src/boxed.rs:2007
#28 alloc::boxed::{impl#47}::call_once<(), alloc::boxed::Box<dyn core::ops::function::FnOnce<(), Output=()>, alloc::alloc::Global>, alloc::alloc::Global> () at library/alloc/src/boxed.rs:2007
#29 std::sys::unix::thread::{impl#2}::new::thread_start () at library/std/src/sys/unix/thread.rs:108
#30 0x00007ffff78a8044 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
#31 0x00007ffff79285fc in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81

@Pavel-Durov
Copy link
Contributor Author

Update

SUCESS - YKD_SERIALISE_COMPILATION=1
ERROR - YKD_SERIALISE_COMPILATION=0

Versions

YKLUA - main/810108764e996d727442d6984f7a8318155a08c8
YK - master/a6613631e8e13cfe3ba4cc8ee24df6517831fd6c

Backtrace

$ YKD_SERIALISE_COMPILATION=0 gdb -batch -ex r -ex bt -args ../src/lua -e"_U=true" gc.lua

lua: /home/pd/yk/ykllvm/llvm/lib/IR/Value.cpp:1061: void llvm::ValueHandleBase::AddToUseList(): Assertion `Entry && "Value doesn't have any handles?"' failed.
lua: /home/pd/yk/ykllvm/llvm/lib/IR/Value.cpp:1089: void llvm::ValueHandleBase::AddToUseList(): Assertion `I->second && I->first == I->second->getValPtr() && "List invariant broken!"' failed.
lua: /home/pd/yk/ykllvm/llvm/lib/IR/Value.cpp:1061: void llvm::ValueHandleBase::AddToUseList(): Assertion `Entry && "Value doesn't have any handles?"' failed.

Thread 12 "lua" received signal SIGABRT, Aborted.
[Switching to Thread 0x7fffdf6fd6c0 (LWP 1658177)]
__pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at ./nptl/pthread_kill.c:44
44	./nptl/pthread_kill.c: No such file or directory.
#0  __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at ./nptl/pthread_kill.c:44
#1  0x00007ffff78a9d9f in __pthread_kill_internal (signo=6, threadid=<optimized out>) at ./nptl/pthread_kill.c:78
#2  0x00007ffff785af32 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
#3  0x00007ffff7845472 in __GI_abort () at ./stdlib/abort.c:79
#4  0x00007ffff7845395 in __assert_fail_base (fmt=0x7ffff79b9a90 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x7ffff5c76208 "Entry && \"Value doesn't have any handles?\"", file=file@entry=0x7ffff5c74288 "/home/pd/yk/ykllvm/llvm/lib/IR/Value.cpp", line=line@entry=1061, function=function@entry=0x7ffff5c75d48 "void llvm::ValueHandleBase::AddToUseList()") at ./assert/assert.c:92
#5  0x00007ffff7853e32 in __GI___assert_fail (assertion=0x7ffff5c76208 "Entry && \"Value doesn't have any handles?\"", file=0x7ffff5c74288 "/home/pd/yk/ykllvm/llvm/lib/IR/Value.cpp", line=1061, function=0x7ffff5c75d48 "void llvm::ValueHandleBase::AddToUseList()") at ./assert/assert.c:101
#6  0x00007ffff5aeaa58 in llvm::ValueHandleBase::AddToUseList() () from /home/pd/yk/target/debug/ykllvm/lib/libLLVMCore.so.16git
#7  0x00007ffff3a89c3a in llvm::DenseMapBase<llvm::SmallDenseMap<llvm::AssertingVH<llvm::Value>, llvm::detail::DenseSetEmpty, 4u, llvm::DenseMapInfo<llvm::AssertingVH<llvm::Value>, void>, llvm::detail::DenseSetPair<llvm::AssertingVH<llvm::Value> > >, llvm::AssertingVH<llvm::Value>, llvm::detail::DenseSetEmpty, llvm::DenseMapInfo<llvm::AssertingVH<llvm::Value>, void>, llvm::detail::DenseSetPair<llvm::AssertingVH<llvm::Value> > >::moveFromOldBuckets(llvm::detail::DenseSetPair<llvm::AssertingVH<llvm::Value> >*, llvm::detail::DenseSetPair<llvm::AssertingVH<llvm::Value> >*) () from /home/pd/yk/target/debug/ykllvm/lib/../lib/libLLVMAnalysis.so.16git
#8  0x00007ffff3a89e73 in llvm::SmallDenseMap<llvm::AssertingVH<llvm::Value>, llvm::detail::DenseSetEmpty, 4u, llvm::DenseMapInfo<llvm::AssertingVH<llvm::Value>, void>, llvm::detail::DenseSetPair<llvm::AssertingVH<llvm::Value> > >::grow(unsigned int) () from /home/pd/yk/target/debug/ykllvm/lib/../lib/libLLVMAnalysis.so.16git
#9  0x00007ffff3a8b27a in (anonymous namespace)::LazyValueInfoCache::insertResult(llvm::Value*, llvm::BasicBlock*, llvm::ValueLatticeElement const&) () from /home/pd/yk/target/debug/ykllvm/lib/../lib/libLLVMAnalysis.so.16git
#10 0x00007ffff3a8d71d in (anonymous namespace)::LazyValueInfoImpl::solve() () from /home/pd/yk/target/debug/ykllvm/lib/../lib/libLLVMAnalysis.so.16git
#11 0x00007ffff3a8f834 in (anonymous namespace)::LazyValueInfoImpl::getValueInBlock(llvm::Value*, llvm::BasicBlock*, llvm::Instruction*) () from /home/pd/yk/target/debug/ykllvm/lib/../lib/libLLVMAnalysis.so.16git
#12 0x00007ffff3a8fbde in llvm::LazyValueInfo::getConstant(llvm::Value*, llvm::Instruction*) () from /home/pd/yk/target/debug/ykllvm/lib/../lib/libLLVMAnalysis.so.16git
#13 0x00007ffff30abe83 in processCallSite(llvm::CallBase&, llvm::LazyValueInfo*) () from /home/pd/yk/target/debug/ykllvm/lib/../lib/libLLVMScalarOpts.so.16git
#14 0x00007ffff30af2c4 in runImpl(llvm::Function&, llvm::LazyValueInfo*, llvm::DominatorTree*, llvm::SimplifyQuery const&) () from /home/pd/yk/target/debug/ykllvm/lib/../lib/libLLVMScalarOpts.so.16git
#15 0x00007ffff30b16bb in (anonymous namespace)::CorrelatedValuePropagation::runOnFunction(llvm::Function&) () from /home/pd/yk/target/debug/ykllvm/lib/../lib/libLLVMScalarOpts.so.16git
#16 0x00007ffff5a67570 in llvm::FPPassManager::runOnFunction(llvm::Function&) () from /home/pd/yk/target/debug/ykllvm/lib/libLLVMCore.so.16git
#17 0x00007ffff3941c4f in (anonymous namespace)::CGPassManager::runOnModule(llvm::Module&) () from /home/pd/yk/target/debug/ykllvm/lib/../lib/libLLVMAnalysis.so.16git
#18 0x00007ffff5a67f77 in llvm::legacy::PassManagerImpl::run(llvm::Module&) () from /home/pd/yk/target/debug/ykllvm/lib/libLLVMCore.so.16git
#19 0x00007ffff7c0fa95 in compileIRTrace<std::tuple<llvm::Module*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::map<llvm::GlobalValue*, void*, std::less<llvm::GlobalValue*>, std::allocator<std::pair<llvm::GlobalValue* const, void*> > >, void*, unsigned long> (*)(llvm::Module*, char**, unsigned long*, unsigned long, char**, void**, unsigned long, void*, void*, unsigned long)> (Func=0x7ffff7c19f30 <createModule[abi:cxx11](llvm::Module*, char**, unsigned long*, unsigned long, char**, void**, unsigned long, void*, void*, unsigned long)>, FuncNames=0x7fffcc00cd80, BBs=0x7fffcc001c90, TraceLen=194, FAddrKeys=0x7fffcc0022b0, FAddrVals=0x7fffcc003380, FAddrLen=16, BitcodeData=0x257ba0 <llvm.embedded[module]+8>, BitcodeLen=3622888, DebugInfoFD=-1, DebugInfoPath=0x0, CallStack=0x0, AOTValsPtr=0x0, AOTValsLen=0) at src/ykllvmwrap.cc:434
#20 0x00007ffff7c0f87b in __yktracec_irtrace_compile (FuncNames=0x7fffcc00cd80, BBs=0x7fffcc001c90, TraceLen=194, FAddrKeys=0x7fffcc0022b0, FAddrVals=0x7fffcc003380, FAddrLen=16, BitcodeData=0x257ba0 <llvm.embedded[module]+8>, BitcodeLen=3622888, DebugInfoFD=-1, DebugInfoPath=0x0, CallStack=0x0, AOTValsPtr=0x0, AOTValsLen=0) at src/ykllvmwrap.cc:453
#21 0x00007ffff7a89680 in ykrt::compile::jitc_llvm::{impl#0}::compile (self=0x91d930, mt=..., irtrace=..., sti=..., hl=...) at ykrt/src/compile/jitc_llvm.rs:51
#22 0x00007ffff7a883e4 in ykrt::mt::{impl#2}::queue_compile_job::{closure#0} () at ykrt/src/mt.rs:480
#23 0x00007ffff7a6a87e in core::ops::function::FnOnce::call_once<ykrt::mt::{impl#2}::queue_compile_job::{closure_env#0}, ()> () at /rustc/8142a319ed5c1d1f96e5a1881a6546e463b77c8f/library/core/src/ops/function.rs:250
#24 0x00007ffff7ab7288 in alloc::boxed::{impl#47}::call_once<(), (dyn core::ops::function::FnOnce<(), Output=()> + core::marker::Send), alloc::alloc::Global> (self=..., args=()) at /rustc/8142a319ed5c1d1f96e5a1881a6546e463b77c8f/library/alloc/src/boxed.rs:2007
#25 0x00007ffff7a99a9b in lock_api::mutex::MutexGuard<parking_lot::raw_mutex::RawMutex, alloc::collections::vec_deque::VecDeque<alloc::boxed::Box<(dyn core::ops::function::FnOnce<(), Output=()> + core::marker::Send), alloc::alloc::Global>, alloc::alloc::Global>>::unlocked<parking_lot::raw_mutex::RawMutex, alloc::collections::vec_deque::VecDeque<alloc::boxed::Box<(dyn core::ops::function::FnOnce<(), Output=()> + core::marker::Send), alloc::alloc::Global>, alloc::alloc::Global>, alloc::boxed::Box<(dyn core::ops::function::FnOnce<(), Output=()> + core::marker::Send), alloc::alloc::Global>, ()> (s=0x7fffdf6fc9e0, f=...) at /home/pd/.cargo/registry/src/index.crates.io-6f17d22bba15001f/lock_api-0.4.11/src/mutex.rs:577
#26 0x00007ffff7a86351 in ykrt::mt::{impl#2}::queue_job::{closure#0} () at ykrt/src/mt.rs:204
#27 0x00007ffff7aba583 in std::sys_common::backtrace::__rust_begin_short_backtrace<ykrt::mt::{impl#2}::queue_job::{closure_env#0}, ()> (f=...) at /rustc/8142a319ed5c1d1f96e5a1881a6546e463b77c8f/library/std/src/sys_common/backtrace.rs:154
#28 0x00007ffff7a903d4 in std::thread::{impl#0}::spawn_unchecked_::{closure#1}::{closure#0}<ykrt::mt::{impl#2}::queue_job::{closure_env#0}, ()> () at /rustc/8142a319ed5c1d1f96e5a1881a6546e463b77c8f/library/std/src/thread/mod.rs:529
#29 0x00007ffff7add9e4 in core::panic::unwind_safe::{impl#23}::call_once<(), std::thread::{impl#0}::spawn_unchecked_::{closure#1}::{closure_env#0}<ykrt::mt::{impl#2}::queue_job::{closure_env#0}, ()>> (self=...) at /rustc/8142a319ed5c1d1f96e5a1881a6546e463b77c8f/library/core/src/panic/unwind_safe.rs:271
#30 0x00007ffff7ad6127 in std::panicking::try::do_call<core::panic::unwind_safe::AssertUnwindSafe<std::thread::{impl#0}::spawn_unchecked_::{closure#1}::{closure_env#0}<ykrt::mt::{impl#2}::queue_job::{closure_env#0}, ()>>, ()> (data=0x7fffdf6fcb00) at /rustc/8142a319ed5c1d1f96e5a1881a6546e463b77c8f/library/std/src/panicking.rs:526
#31 0x00007ffff7ad657b in __rust_try () from /home/pd/yk/bin/../target/debug/deps/libykcapi.so
#32 0x00007ffff7ad5dfe in std::panicking::try<(), core::panic::unwind_safe::AssertUnwindSafe<std::thread::{impl#0}::spawn_unchecked_::{closure#1}::{closure_env#0}<ykrt::mt::{impl#2}::queue_job::{closure_env#0}, ()>>> (f=...) at /rustc/8142a319ed5c1d1f96e5a1881a6546e463b77c8f/library/std/src/panicking.rs:490
#33 0x00007ffff7a90216 in std::panic::catch_unwind<core::panic::unwind_safe::AssertUnwindSafe<std::thread::{impl#0}::spawn_unchecked_::{closure#1}::{closure_env#0}<ykrt::mt::{impl#2}::queue_job::{closure_env#0}, ()>>, ()> (f=...) at /rustc/8142a319ed5c1d1f96e5a1881a6546e463b77c8f/library/std/src/panic.rs:142
#34 std::thread::{impl#0}::spawn_unchecked_::{closure#1}<ykrt::mt::{impl#2}::queue_job::{closure_env#0}, ()> () at /rustc/8142a319ed5c1d1f96e5a1881a6546e463b77c8f/library/std/src/thread/mod.rs:528
#35 0x00007ffff7a6a85f in core::ops::function::FnOnce::call_once<std::thread::{impl#0}::spawn_unchecked_::{closure_env#1}<ykrt::mt::{impl#2}::queue_job::{closure_env#0}, ()>, ()> () at /rustc/8142a319ed5c1d1f96e5a1881a6546e463b77c8f/library/core/src/ops/function.rs:250
#36 0x00007ffff7cfb225 in alloc::boxed::{impl#47}::call_once<(), dyn core::ops::function::FnOnce<(), Output=()>, alloc::alloc::Global> () at library/alloc/src/boxed.rs:2007
#37 alloc::boxed::{impl#47}::call_once<(), alloc::boxed::Box<dyn core::ops::function::FnOnce<(), Output=()>, alloc::alloc::Global>, alloc::alloc::Global> () at library/alloc/src/boxed.rs:2007
#38 std::sys::unix::thread::{impl#2}::new::thread_start () at library/std/src/sys/unix/thread.rs:108
#39 0x00007ffff78a8044 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
#40 0x00007ffff792861c in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
non-serialised-compilation-error Errors related to non-sync yk compilation - YKD_SERIALISE_COMPILATION=0
Projects
None yet
Development

No branches or pull requests

1 participant