ykjit / yklua

yk-enabled Lua interpreter
4 stars 4 forks source link

Failing test - verybig.lua #56

Open Pavel-Durov opened 1 year ago

Pavel-Durov commented 1 year ago

Issue

Failing test verybig.lua

Reproduction steps:

YKD_SERIALISE_COMPILATION=1 ../src/lua verybig.lua
testing RK
testing large programs (>64k)
Floating point instructions are not supported yet:   %2732 = sitofp i64 %2731 to double, !dbg !10066 

YKD_SERIALISE_COMPILATION=1 try_repeat 1000 ../src/lua verybig.lua
testing RK
testing large programs (>64k)
Floating point instructions are not supported yet:   %2732 = sitofp i64 %2731 to double, !dbg !10066

Backtrace:

No Backtrace. No stack.

Versions

YkLua - buildbot-locals-test/fb6b1763b22f75715ded5b033f9b3f9f4ec9764e YK - master/a690e6eaf7253a4fa9c04bb54406c07b7efc0085

vext01 commented 1 year ago

Didn't you raise a PR for another test with a similar outcome?

Pavel-Durov commented 1 year ago

not a PR but I submitted multiple issues with the same error

Pavel-Durov commented 10 months ago

Update

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" ./verybig.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.

Thread 6 "lua" received signal SIGABRT, Aborted.
[Switching to Thread 0x7ffff26346c0 (LWP 1663003)]
__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  0x00007ffff7c21bae in llvm::ValueHandleBase::ValueHandleBase (this=0x7ffff2631ab0, Kind=llvm::ValueHandleBase::Callback, V=0x7fffe17b1ac0) at /home/pd/yk/target/debug/ykllvm/include/llvm/IR/ValueHandle.h:61
#8  0x00007ffff7c2182a in llvm::CallbackVH::CallbackVH (this=0x7ffff2631aa8, P=0x7fffe17b1ac0) at /home/pd/yk/target/debug/ykllvm/include/llvm/IR/ValueHandle.h:396
#9  0x00007ffff7c242e5 in llvm::ValueMapCallbackVH<llvm::Value const*, llvm::WeakTrackingVH, llvm::ValueMapConfig<llvm::Value const*, llvm::sys::SmartMutex<false> > >::ValueMapCallbackVH (this=0x7ffff2631aa8, Key=0x7fffe17b1ac0, Map=0x7ffff2632998) at /home/pd/yk/target/debug/ykllvm/include/llvm/IR/ValueMap.h:250
#10 0x00007ffff7c23948 in llvm::ValueMap<llvm::Value const*, llvm::WeakTrackingVH, llvm::ValueMapConfig<llvm::Value const*, llvm::sys::SmartMutex<false> > >::Wrap (this=0x7ffff2632998, key=0x7fffe17b1ac0) at /home/pd/yk/target/debug/ykllvm/include/llvm/IR/ValueMap.h:233
#11 0x00007ffff7c1f7e8 in llvm::ValueMap<llvm::Value const*, llvm::WeakTrackingVH, llvm::ValueMapConfig<llvm::Value const*, llvm::sys::SmartMutex<false> > >::operator[] (this=0x7ffff2632998, Key=@0x7ffff2631f10: 0x7fffe17b1ac0) at /home/pd/yk/target/debug/ykllvm/include/llvm/IR/ValueMap.h:207
#12 0x00007ffff7c2c121 in JITModBuilder::getGuardFailureBlock (this=0x7ffff26327e0, CurBB=0x7fffe0f712e0, CurBBIdx=508, Instr=0x7fffe1fbabe0, CurInstrIdx=14, GuardId=55, IsSwitch=0) at src/jitmodbuilder.cc:868
#13 0x00007ffff7c3588c in JITModBuilder::handleBranchInst (this=0x7ffff26327e0, JITFunc=0x7fffecf500e8, NextBlock=0x7fffe0f71330, I=0x7fffe1fbabe0, CurBBIdx=508, CurInstrIdx=14) at src/jitmodbuilder.cc:625
#14 0x00007ffff7c2b874 in JITModBuilder::handleBranchingControlFlow (this=0x7ffff26327e0, I=0x7fffe1fbabe0, TraceIdx=232, JITFunc=0x7fffecf500e8, CurBBIdx=508, CurInstrIdx=14) at src/jitmodbuilder.cc:963
#15 0x00007ffff7c1afb6 in JITModBuilder::createModule (this=0x7ffff26327e0) at src/jitmodbuilder.cc:1663
#16 0x00007ffff7c19fd3 in createModule[abi:cxx11](llvm::Module*, char**, unsigned long*, unsigned long, char**, void**, unsigned long, void*, void*, unsigned long) (AOTMod=0x7fffe01719b0, FuncNames=0x7fffecf9e1a0, BBs=0x7fffecf9fb00, TraceLen=810, FAddrKeys=0x7fffecf4b740, FAddrVals=0x7fffecf4b060, FAddrLen=27, CallStack=0x0, AOTValsPtr=0x0, AOTValsLen=0) at src/jitmodbuilder.cc:1827
#17 0x00007ffff7c17f33 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)>(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), char**, unsigned long*, unsigned long, char**, void**, unsigned long, void*, unsigned long, int, char*, void*, void*, unsigned long)::{lambda(llvm::Module&)#1}::operator()(llvm::Module&) const (this=0x7ffff2632ce0, AOTMod=...) at src/ykllvmwrap.cc:412
#18 0x00007ffff7c1799e in llvm::orc::ThreadSafeModule::withModuleDo<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)>(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), char**, unsigned long*, unsigned long, char**, void**, unsigned long, void*, unsigned long, int, char*, void*, void*, unsigned long)::{lambda(llvm::Module&)#1}>(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)>(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), char**, unsigned long*, unsigned long, char**, void**, unsigned long, void*, unsigned long, int, char*, void*, void*, unsigned long)::{lambda(llvm::Module&)#1}&&) (this=0x7ffff7e48868 <GlobalAOTMod>, F=...) at /home/pd/yk/target/debug/ykllvm/include/llvm/ExecutionEngine/Orc/ThreadSafeModule.h:136
#19 0x00007ffff7c0f9d6 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=0x7fffecf9e1a0, BBs=0x7fffecf9fb00, TraceLen=810, FAddrKeys=0x7fffecf4b740, FAddrVals=0x7fffecf4b060, FAddrLen=27, BitcodeData=0x257ba0 <llvm.embedded[module]+8>, BitcodeLen=3622888, DebugInfoFD=-1, DebugInfoPath=0x0, CallStack=0x0, AOTValsPtr=0x0, AOTValsLen=0) at src/ykllvmwrap.cc:409
#20 0x00007ffff7c0f87b in __yktracec_irtrace_compile (FuncNames=0x7fffecf9e1a0, BBs=0x7fffecf9fb00, TraceLen=810, FAddrKeys=0x7fffecf4b740, FAddrVals=0x7fffecf4b060, FAddrLen=27, 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=0x7ffff26339e0, 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=0x7ffff2633b00) 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