ykjit / yklua

yk-enabled Lua interpreter

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Failing test - constructs.lua

Pavel-Durov opened this issue · comments

Issue

Error on running constructs.lua test withwith both compilation modes.

Steps to reproduce

$ YKD_SERIALISE_COMPILATION=1 try_repeat 1000  ../src/lua -e"_U=true" constructs.lua
+
+
+
+
OK

$ YKD_SERIALISE_COMPILATION=0 try_repeat 1000  ../src/lua -e"_U=true" constructs.lua
testing syntax
+
testing short-circuit optimizations (1)
+
+
+
+
OK
testing syntax
+
testing short-circuit optimizations (1)
+
+
+
+
OK
testing syntax
+
testing short-circuit optimizations (1)
+
lua: /home/kimchi/git-repos/yk-fork/ykllvm/llvm/lib/IR/Value.cpp:285: llvm::ValueName* llvm::Value::getValueName() const: Assertion `I != Ctx.pImpl->ValueNames.end() && "No name entry found!"' failed.
Aborted (core dumped)

Notes

This error is non-deterministic.

Versions:

YkLua - yk-location-allocation/056cf6ae7cb3ebd59a7e0dc89df99c03f0e8d3d9
Yk - master/a690e6eaf7253a4fa9c04bb54406c07b7efc0085

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

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

lua: /home/pd/yk-fork/ykllvm/llvm/lib/IR/Value.cpp:1101: void llvm::ValueHandleBase::RemoveFromUseList(): Assertion `*PrevPtr == this && "List invariant broken"' failed.

Thread 5 "lua" received signal SIGABRT, Aborted.
[Switching to Thread 0x7fffedc9b6c0 (LWP 2242012)]
__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=0x7ffff5c75db8 "*PrevPtr == this && \"List invariant broken\"", file=file@entry=0x7ffff5c744f8 "/home/pd/yk-fork/ykllvm/llvm/lib/IR/Value.cpp", line=line@entry=1101, function=function@entry=0x7ffff5c75d30 "void llvm::ValueHandleBase::RemoveFromUseList()") at ./assert/assert.c:92
#5  0x00007ffff7853e32 in __GI___assert_fail (assertion=0x7ffff5c75db8 "*PrevPtr == this && \"List invariant broken\"", file=0x7ffff5c744f8 "/home/pd/yk-fork/ykllvm/llvm/lib/IR/Value.cpp", line=1101, function=0x7ffff5c75d30 "void llvm::ValueHandleBase::RemoveFromUseList()") at ./assert/assert.c:101
#6  0x00007ffff5aea588 in llvm::ValueHandleBase::RemoveFromUseList() () from /home/pd/yk-fork/target/debug/ykllvm/lib/libLLVMCore.so.16git
#7  0x00007ffff7c0531b in llvm::ValueHandleBase::operator= (this=0x7fffe0290d58, RHS=0x7fffe02b9260) at /home/pd/yk-fork/target/debug/ykllvm/include/llvm/IR/ValueHandle.h:73
#8  0x00007ffff7bff22d in llvm::WeakTrackingVH::operator= (this=0x7fffe0290d58, RHS=0x7fffe02b9260) at /home/pd/yk-fork/target/debug/ykllvm/include/llvm/IR/ValueHandle.h:214
#9  0x00007ffff7c0846b in JITModBuilder::copyInstruction (this=0x7fffedc99bc8, Builder=0x7fffedc99bf8, I=0x7fffe9efb110, CurBBIdx=615, CurInstrIdx=5) at src/jitmodbuilder.cc:1056
#10 0x00007ffff7bfb0a0 in JITModBuilder::createModule (this=0x7fffedc99bc8) at src/jitmodbuilder.cc:1672
#11 0x00007ffff7bf9b79 in createModule[abi:cxx11](llvm::Module*, char**, unsigned long*, unsigned long, char**, void**, unsigned long) (AOTMod=0x7fffe808bb80, FuncNames=0x7fffe00e87a0, BBs=0x7fffe00ea430, TraceLen=913, FAddrKeys=0x7fffe00ec160, FAddrVals=0x7fffe00ec1f0, FAddrLen=11) at src/jitmodbuilder.cc:1747
#12 0x00007ffff7bf7b17 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)>(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), char**, unsigned long*, unsigned long, char**, void**, unsigned long, void*, unsigned long, int, char*)::{lambda(llvm::Module&)#1}::operator()(llvm::Module&) const (this=0x7fffedc9a078, AOTMod=...) at src/ykllvmwrap.cc:411
#13 0x00007ffff7bf75ae 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)>(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), char**, unsigned long*, unsigned long, char**, void**, unsigned long, void*, unsigned long, int, char*)::{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)>(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), char**, unsigned long*, unsigned long, char**, void**, unsigned long, void*, unsigned long, int, char*)::{lambda(llvm::Module&)#1}&&) (this=0x7ffff7d9c300 <GlobalAOTMod>, F=...) at /home/pd/yk-fork/target/debug/ykllvm/include/llvm/ExecutionEngine/Orc/ThreadSafeModule.h:136
#14 0x00007ffff7bef609 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=0x7fffe00e87a0, BBs=0x7fffe00ea430, TraceLen=913, FAddrKeys=0x7fffe00ec160, FAddrVals=0x7fffe00ec1f0, FAddrLen=11, BitcodeData=0x256f40 <llvm.embedded[module]+8>, BitcodeLen=3618920, DebugInfoFD=-1, DebugInfoPath=0x0) at src/ykllvmwrap.cc:408
#15 0x00007ffff7bef4de in __yktracec_irtrace_compile (FuncNames=0x7fffe00e87a0, BBs=0x7fffe00ea430, TraceLen=913, FAddrKeys=0x7fffe00ec160, FAddrVals=0x7fffe00ec1f0, FAddrLen=11, BitcodeData=0x256f40 <llvm.embedded[module]+8>, BitcodeLen=3618920, DebugInfoFD=-1, DebugInfoPath=0x0) at src/ykllvmwrap.cc:450
#16 0x00007ffff7a7a0f8 in ykrt::compile::jitc_llvm::{impl#0}::compile (self=0x91b720, mt=..., irtrace=...) at ykrt/src/compile/jitc_llvm.rs:38
#17 0x00007ffff7a7ccad in ykrt::mt::{impl#0}::queue_compile_job::{closure#0} () at ykrt/src/mt.rs:397
#18 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
#19 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
#20 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=0x7fffedc9a9e0, f=...) at /home/pd/.cargo/registry/src/index.crates.io-6f17d22bba15001f/lock_api-0.4.10/src/mutex.rs:567
#21 0x00007ffff7a7b4d1 in ykrt::mt::{impl#0}::queue_job::{closure#0} () at ykrt/src/mt.rs:168
#22 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
#23 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
#24 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
#25 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=0x7fffedc9ab00) at /rustc/8142a319ed5c1d1f96e5a1881a6546e463b77c8f/library/std/src/panicking.rs:526
#26 0x00007ffff7a6ecdb in __rust_try () from /home/pd/yk-fork/bin/../target/debug/deps/libykcapi.so
#27 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
#28 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
#29 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
#30 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
#31 0x00007ffff7c801e5 in alloc::boxed::{impl#47}::call_once<(), dyn core::ops::function::FnOnce<(), Output=()>, alloc::alloc::Global> () at library/alloc/src/boxed.rs:2007
#32 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
#33 std::sys::unix::thread::{impl#2}::new::thread_start () at library/std/src/sys/unix/thread.rs:108
#34 0x00007ffff78a8044 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
#35 0x00007ffff79285fc in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81

Update

SUCCESS - YKD_SERIALISE_COMPILATION=1
ERROR - YKD_SERIALISE_COMPILATION=0

Versions

YKLUA - main/810108764e996d727442d6984f7a8318155a08c8
YK - master/a6613631e8e13cfe3ba4cc8ee24df6517831fd6c

Backtrace

Same erroe as before