You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: lua state trampolines should be "C-unwind", not "C"
This is due to the fact that lua_error calls _Unwind_RaiseException
under the hood, which causes rust's extern "C" functions to misbehave
when an exception passes through their frame.
Without this change we crash with a following log:
```
i1 | 2024-10-09 02:13:28.940 [120075] main/111/main C> panicked at library/core/src/panicking.rs:221:5:
i1 | panic in a function that cannot unwind
i1 | 2024-10-09 02:13:28.940 [120075] main/111/main C> backtrace:
i1 | disabled backtrace
i1 | 2024-10-09 02:13:28.940 [120075] main/111/main C> aborting due to panic
i1 | [supervisor:120065] no ipc message from child
i1 | [supervisor:120065] subprocess 120075 was signaled with SIGABRT
i1 | [supervisor:120065] core dumped
```
picodata repro:
```shell
pipenv run pytest -k test_submit_sql_after_revoke
```
backtrace:
```
#0 0x00007e04dc2a53f4 in ?? () from /usr/lib/libc.so.6
#1 0x00007e04dc24c120 in raise () from /usr/lib/libc.so.6
#2 0x00007e04dc2334c3 in abort () from /usr/lib/libc.so.6
#3 0x0000000005961a6a in std::sys::pal::unix::abort_internal () at library/std/src/sys/pal/unix/mod.rs:370
#4 0x0000000001e3227a in std::process::abort () at library/std/src/process.rs:2388
#5 0x0000000002e2d476 in picodata::cli::run::main::{closure#0}::{closure#1} (info=0x7e04bb8800f8) at src/cli/run.rs:120
#6 0x000000000595691f in alloc::boxed::{impl#50}::call<(&std::panic::PanicHookInfo), (dyn core::ops::function::Fn<(&std::panic::PanicHookInfo), Output=()> + core::marker::Send + core::marker::Sync), alloc::alloc::Global> ()
at library/alloc/src/boxed.rs:2084
#7 std::panicking::rust_panic_with_hook () at library/std/src/panicking.rs:808
#8 0x0000000005956513 in std::panicking::begin_panic_handler::{closure#0} () at library/std/src/panicking.rs:667
#9 0x0000000005953c99 in std::sys::backtrace::__rust_end_short_backtrace<std::panicking::begin_panic_handler::{closure_env#0}, !> () at library/std/src/sys/backtrace.rs:168
#10 0x00000000059561d4 in std::panicking::begin_panic_handler () at library/std/src/panicking.rs:665
#11 0x0000000001e34e35 in core::panicking::panic_nounwind_fmt::runtime () at library/core/src/panicking.rs:112
#12 core::panicking::panic_nounwind_fmt () at library/core/src/panicking.rs:122
#13 0x0000000001e34ec2 in core::panicking::panic_nounwind () at library/core/src/panicking.rs:221
#14 0x0000000001e350e6 in core::panicking::panic_cannot_unwind () at library/core/src/panicking.rs:309
#15 0x0000000002c17f7a in tlua::functions_write::wrapper<tlua::functions_write::Function<picodata::set_login_check::{closure_env#1}, (alloc::string::String, bool, *mut tlua::ffi::lua_State), ()>, (alloc::string::String, bool, *mut tlua::ffi::lua_State), ()> (lua=0x40c2cc90) at tarantool/tlua/src/functions_write.rs:455
#16 0x000000000321d513 in lj_BC_FUNCC () at buildvm_x86.dasc:811
#17 0x0000000003224253 in lua_pcall (L=L@entry=0x40c2cc90, nargs=<optimized out>, nresults=nresults@entry=-1, errfunc=errfunc@entry=0) at picodata/tarantool-sys/third_party/luajit/src/lj_api.c:1172
#18 0x000000000301b47b in luaT_call (L=L@entry=0x40c2cc90, nargs=<optimized out>, nreturns=nreturns@entry=-1) at picodata/tarantool-sys/src/lua/utils.c:619
```
0 commit comments