Assertion failed on mlua 0.11.0 #615

Description

@sxyazi

First of all, congratulations on the new release, you really did an outstanding job, @khvzak! 🎉🎉

I'm upgrading my project to mlua 0.11.0 and encountered an error:

Assertion failed: ((L->top.p <= L->ci->top.p) && "stack overflow"), function lua_pushnil, file lapi.c, line 500.

Minimal reproducer (run in debug mode):

use mlua::{Lua,Result,Table};fnmain() -> Result<()>{fntbl_with_mt(lua:&Lua) -> Result<Table>{let tbl = lua.create_table()?;
tbl.set_metatable(Some(lua.create_table()?))?;Ok(tbl)}let lua = Lua::new();let _:Vec<Table> = (0..10000).map(|_| tbl_with_mt(&lua)).collect::<Result<_>>()?;Ok(())}
[dependencies]
mlua = { version = "0.11.0", features = [ "lua54", "vendored" ] }

Here's the full backtrace:

Stop reason: hit program assert
> bt
* thread #1, name = 'main', queue = 'com.apple.main-thread', stop reason = hit program assert* frame #0: 0x000000018200c764 libsystem_kernel.dylib`__pthread_kill + 8
frame #1: 0x0000000182043c28 libsystem_pthread.dylib`pthread_kill + 288
frame #2: 0x0000000181f51ae8 libsystem_c.dylib`abort + 180
frame #3: 0x0000000181f50e44 libsystem_c.dylib`__assert_rtn + 272
frame #4: 0x0000000101b54218 yazi`lua_pushnil(L=0x0000000105048008) at lapi.c:500:3
frame #5: 0x0000000101ab81b0 yazi`mlua::state::raw::RawLua::drop_ref(self=0x0000000105043450, vref=0x000000016fdf46c0) at raw.rs:843:9
frame #6: 0x0000000101ae3164 yazi`<mlua::types::value_ref::ValueRef as core::ops::drop::Drop>::drop(self=0x000000016fdf46c0) at value_ref.rs:56:30
frame #7: 0x0000000101ac2ab8 yazi`core::ptr::drop_in_place<mlua::types::value_ref::ValueRef>((null)=0x000000016fdf46c0) at mod.rs:799:1
frame #8: 0x0000000101ac20e0 yazi`core::ptr::drop_in_place<mlua::table::Table>((null)=0x000000016fdf46c0) at mod.rs:799:1
frame #9: 0x0000000101ae0afc yazi`mlua::table::Table::set_metatable(self=0x000000016fdf4b30, metatable=Option<mlua::table::Table> @ 0x000000016fdf4d10) at table.rs:515:13
frame #10: 0x00000001007c78fc yazi`yazi_plugin::loader::require::Require::create_mt(lua=0x000000010504ac68, id="folder-rules", mod=Table @ 0x000000016fdf5510, sync=true) at require.rs:66:6
frame #11: 0x0000000100976ff4 yazi`yazi_plugin::loader::require::Require::install::{{closure}}((null)=0x0000000000000001, lua=0x000000010504ac68, id=String @ 0x000000016fdf5790) at require.rs:22:5
frame #12: 0x0000000100b5ed50 yazi`mlua::state::Lua::create_function::{{closure}}(rawlua=0x0000000105043450, nargs=1) at state.rs:1264:13
frame #13: 0x0000000101ac58e0 yazi`<alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call(self=0x0000000105074380, args=(&mlua::state::raw::RawLua, i32) @ 0x000000016fdf5898) at boxed.rs:1985:9
frame #14: 0x0000000101abc294 yazi`mlua::state::raw::RawLua::create_callback::call_callback::{{closure}}(extra=0x000000010504ab90, nargs=1) at raw.rs:1191:39
frame #15: 0x0000000101acdb9c yazi`mlua::state::util::callback_error_ext::{{closure}} at util.rs:108:9
frame #16: 0x0000000101aa68e8 yazi`<core::panic::unwind_safe::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once(self=<unavailable>, (null)=<unavailable>) at unwind_safe.rs:272:9
frame #17: 0x0000000101acef1c yazi`std::panicking::catch_unwind::do_call(data=6171876320) at panicking.rs:589:40
frame #18: 0x0000000101a99804 yazi`__rust_try + 32
frame #19: 0x0000000101a92064 yazi`std::panic::catch_unwind [inlined] std::panicking::catch_unwind(f=<unavailable>) at panicking.rs:552:19
frame #20: 0x0000000101a92024 yazi`std::panic::catch_unwind(f=<unavailable>) at panic.rs:359:14
frame #21: 0x0000000101accbc8 yazi`mlua::state::util::callback_error_ext(state=0x000000010588c008, extra=0x000000010504ab90, wrap_error=true, f={closure_env#0} @ 0x000000016fdf60d0) at util.rs:105:11
frame #22: 0x0000000101abc0e8 yazi`mlua::state::raw::RawLua::create_callback::call_callback(state=0x000000010588c008) at raw.rs:1186:13
frame #23: 0x0000000101b6838c yazi`precallC(L=0x000000010588c008, func=0x0000000105894a40, nresults=1, f=0x0000000101abc044) at ldo.c:536:7
frame #24: 0x0000000101b68680 yazi`luaD_precall(L=0x000000010588c008, func=0x0000000105894a40, nresults=1) at ldo.c:599:7
frame #25: 0x0000000101b350c0 yazi`luaV_execute(L=0x000000010588c008, ci=0x000000010504ae10) at lvm.c:1685:22
frame #26: 0x0000000101b68a60 yazi`ccall(L=0x000000010588c008, func=0x0000000105049030, nResults=-1, inc=65537) at ldo.c:644:5
frame #27: 0x0000000101b68ab0 yazi`luaD_callnoyield(L=0x000000010588c008, func=0x0000000105049030, nResults=-1) at ldo.c:662:3
frame #28: 0x0000000101b5732c yazi`f_call(L=0x000000010588c008, ud=0x000000016fdf7208) at lapi.c:1038:3
frame #29: 0x0000000101b66de4 yazi`luaD_rawrunprotected(L=0x000000010588c008, f=0x0000000101b572f8, ud=0x000000016fdf7208) at ldo.c:141:3
frame #30: 0x0000000101b69580 yazi`luaD_pcall(L=0x000000010588c008, func=0x0000000101b572f8, u=0x000000016fdf7208, old_top=32, ef=16) at ldo.c:964:12
frame #31: 0x0000000101b571d0 yazi`lua_pcallk(L=0x000000010588c008, nargs=0, nresults=-1, errfunc=1, ctx=0, k=0x0000000000000000) at lapi.c:1064:14
frame #32: 0x0000000101aabb28 yazi`mlua::function::Function::call [inlined] mlua_sys::lua54::lua::lua_pcall(L=0x000000010588c008, n=0, r=-1, f=1) at lua.rs:278:5
frame #33: 0x0000000101aabb1c yazi`mlua::function::Function::call(self=0x000000016fdf7590, args=<unavailable>) at function.rs:121:23
frame #34: 0x0000000101ad84dc yazi`mlua::chunk::Chunk::call(self=<unavailable>, args=<unavailable>) at chunk.rs:627:31
frame #35: 0x0000000101ad8414 yazi`mlua::chunk::Chunk::exec(self=<unavailable>) at chunk.rs:570:14
frame #36: 0x0000000100b7e294 yazi`yazi_plugin::lua::stage_2(lua=0x0000000102a50038) at lua.rs:64:36
frame #37: 0x0000000100b7c494 yazi`yazi_plugin::lua::init_lua at lua.rs:14:2
frame #38: 0x000000010075cf48 yazi`yazi_plugin::init at lib.rs:9:2
frame #39: 0x0000000100029228 yazi`yazi::main::{{closure}}((null)=0x000000016fdf90e8) at main.rs:35:2
frame #40: 0x000000010019dddc yazi`tokio::runtime::park::CachedParkThread::block_on::{{closure}} at park.rs:285:71
frame #41: 0x000000010019d91c yazi`tokio::runtime::park::CachedParkThread::block_on [inlined] tokio::task::coop::with_budget(budget=Budget @ 0x000000016fdf997b, f={closure_env#0}<yazi::main::{async_block_env#0}> @ 0x000000016fdf9980) at mod.rs:167:5
frame #42: 0x000000010019d8c8 yazi`tokio::runtime::park::CachedParkThread::block_on [inlined] tokio::task::coop::budget(f={closure_env#0}<yazi::main::{async_block_env#0}> @ 0x000000016fdf9958) at mod.rs:133:5
frame #43: 0x000000010019d850 yazi`tokio::runtime::park::CachedParkThread::block_on(self=0x000000016fdf99ef, f={async_block_env#0} @ 0x000000016fdf99f0) at park.rs:285:31
frame #44: 0x00000001000e979c yazi`tokio::runtime::context::blocking::BlockingRegionGuard::block_on(self=0x000000016fdfaad0, f={async_block_env#0} @ 0x000000016fdfa240) at blocking.rs:66:14
frame #45: 0x0000000100029db8 yazi`tokio::runtime::scheduler::multi_thread::MultiThread::block_on::{{closure}}(blocking=0x000000016fdfaad0) at mod.rs:87:22
frame #46: 0x0000000100121310 yazi`tokio::runtime::context::runtime::enter_runtime(handle=0x000000016fdfe4f0, allow_block_in_place=true, f={closure_env#0}<yazi::main::{async_block_env#0}> @ 0x000000016fdfb348) at runtime.rs:65:16
frame #47: 0x0000000100029d0c yazi`tokio::runtime::scheduler::multi_thread::MultiThread::block_on(self=0x000000016fdfe4c8, handle=0x000000016fdfe4f0, future=<unavailable>) at mod.rs:86:9
frame #48: 0x000000010009b578 yazi`tokio::runtime::runtime::Runtime::block_on_inner(self=0x000000016fdfe4c0, future={async_block_env#0} @ 0x000000016fdfd468, (null)=SpawnMeta @ 0x000000016fdfcbce) at runtime.rs:358:50
frame #49: 0x000000010009b8dc yazi`tokio::runtime::runtime::Runtime::block_on(self=0x000000016fdfe4c0, future={async_block_env#0} @ 0x000000016fdfe640) at runtime.rs:330:18
frame #50: 0x00000001000ecdd0 yazi`yazi::main at main.rs:40:20
frame #51: 0x0000000100005d70 yazi`core::ops::function::FnOnce::call_once((null)=0x00000001000eccdc, (null)=<unavailable>) at function.rs:253:5
frame #52: 0x00000001000e9144 yazi`std::sys::backtrace::__rust_begin_short_backtrace(f=0x00000001000eccdc) at backtrace.rs:152:18
frame #53: 0x00000001000d07cc yazi`std::rt::lang_start::{{closure}} at rt.rs:206:18
frame #54: 0x0000000101b9a2d0 yazi`std::rt::lang_start_internal [inlined] core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once at function.rs:290:21 [opt]
frame #55: 0x0000000101b9a2c8 yazi`std::rt::lang_start_internal [inlined] std::panicking::catch_unwind::do_call at panicking.rs:589:40 [opt]
frame #56: 0x0000000101b9a2c4 yazi`std::rt::lang_start_internal [inlined] std::panicking::catch_unwind at panicking.rs:552:19 [opt]
frame #57: 0x0000000101b9a2c4 yazi`std::rt::lang_start_internal [inlined] std::panic::catch_unwind at panic.rs:359:14 [opt]
frame #58: 0x0000000101b9a2c4 yazi`std::rt::lang_start_internal [inlined] std::rt::lang_start_internal::{{closure}} at rt.rs:175:24 [opt]
frame #59: 0x0000000101b99dbc yazi`std::rt::lang_start_internal [inlined] std::panicking::catch_unwind::do_call at panicking.rs:589:40 [opt]
frame #60: 0x0000000101b99dbc yazi`std::rt::lang_start_internal [inlined] std::panicking::catch_unwind at panicking.rs:552:19 [opt]
frame #61: 0x0000000101b99dbc yazi`std::rt::lang_start_internal [inlined] std::panic::catch_unwind at panic.rs:359:14 [opt]
frame #62: 0x0000000101b99dbc yazi`std::rt::lang_start_internal at rt.rs:171:5 [opt]
frame #63: 0x00000001000d07a4 yazi`std::rt::lang_start(main=0x00000001000eccdc, argc=1, argv=6171914888, sigpipe=0) at rt.rs:205:5
frame #64: 0x00000001000ece68 yazi`main + 36
frame #65: 0x0000000181cebf28 dyld`start + 2236

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      , 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Add copy buttons to all
       blocks\n(function() {\n function addCopyButtons() {\n document.querySelectorAll('pre code').forEach(function(codeBlock) {\n if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;\n codeBlock.parentElement.setAttribute('data-copy-added', 'true');\n \n var btn = document.createElement('button');\n btn.textContent = 'Copy';\n btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';\n btn.onmouseover = function() { this.style.opacity = '1'; };\n btn.onmouseout = function() { this.style.opacity = '0.7'; };\n btn.onclick = function() {\n navigator.clipboard.writeText(codeBlock.textContent).then(function() {\n btn.textContent = 'Copied!';\n setTimeout(function() { btn.textContent = 'Copy'; }, 1500);\n });\n };\n codeBlock.parentElement.style.position = 'relative';\n codeBlock.parentElement.appendChild(btn);\n });\n }\n \n addCopyButtons();\n \n // Re-run on dynamic content\n var observer = new MutationObserver(addCopyButtons);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Add Copy Buttons to Code Blocks");
      }
      } catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
      })();
      (function(){
      try {
      var __m = "github.com";
      var __re = new RegExp('^' + "github\\.com" + '
      
      Skip to content

      Assertion failed on mlua 0.11.0 #615

      Description

      @sxyazi

      First of all, congratulations on the new release, you really did an outstanding job, @khvzak! 🎉🎉

      I'm upgrading my project to mlua 0.11.0 and encountered an error:

      Assertion failed: ((L->top.p <= L->ci->top.p) && "stack overflow"), function lua_pushnil, file lapi.c, line 500.
      

      Minimal reproducer (run in debug mode):

      use mlua::{Lua,Result,Table};fnmain() -> Result<()>{fntbl_with_mt(lua:&Lua) -> Result<Table>{let tbl = lua.create_table()?;
      tbl.set_metatable(Some(lua.create_table()?))?;Ok(tbl)}let lua = Lua::new();let _:Vec<Table> = (0..10000).map(|_| tbl_with_mt(&lua)).collect::<Result<_>>()?;Ok(())}
      [dependencies]
      mlua = { version = "0.11.0", features = [ "lua54", "vendored" ] }

      Here's the full backtrace:

      Stop reason: hit program assert
      > bt
      * thread #1, name = 'main', queue = 'com.apple.main-thread', stop reason = hit program assert* frame #0: 0x000000018200c764 libsystem_kernel.dylib`__pthread_kill + 8
      frame #1: 0x0000000182043c28 libsystem_pthread.dylib`pthread_kill + 288
      frame #2: 0x0000000181f51ae8 libsystem_c.dylib`abort + 180
      frame #3: 0x0000000181f50e44 libsystem_c.dylib`__assert_rtn + 272
      frame #4: 0x0000000101b54218 yazi`lua_pushnil(L=0x0000000105048008) at lapi.c:500:3
      frame #5: 0x0000000101ab81b0 yazi`mlua::state::raw::RawLua::drop_ref(self=0x0000000105043450, vref=0x000000016fdf46c0) at raw.rs:843:9
      frame #6: 0x0000000101ae3164 yazi`<mlua::types::value_ref::ValueRef as core::ops::drop::Drop>::drop(self=0x000000016fdf46c0) at value_ref.rs:56:30
      frame #7: 0x0000000101ac2ab8 yazi`core::ptr::drop_in_place<mlua::types::value_ref::ValueRef>((null)=0x000000016fdf46c0) at mod.rs:799:1
      frame #8: 0x0000000101ac20e0 yazi`core::ptr::drop_in_place<mlua::table::Table>((null)=0x000000016fdf46c0) at mod.rs:799:1
      frame #9: 0x0000000101ae0afc yazi`mlua::table::Table::set_metatable(self=0x000000016fdf4b30, metatable=Option<mlua::table::Table> @ 0x000000016fdf4d10) at table.rs:515:13
      frame #10: 0x00000001007c78fc yazi`yazi_plugin::loader::require::Require::create_mt(lua=0x000000010504ac68, id="folder-rules", mod=Table @ 0x000000016fdf5510, sync=true) at require.rs:66:6
      frame #11: 0x0000000100976ff4 yazi`yazi_plugin::loader::require::Require::install::{{closure}}((null)=0x0000000000000001, lua=0x000000010504ac68, id=String @ 0x000000016fdf5790) at require.rs:22:5
      frame #12: 0x0000000100b5ed50 yazi`mlua::state::Lua::create_function::{{closure}}(rawlua=0x0000000105043450, nargs=1) at state.rs:1264:13
      frame #13: 0x0000000101ac58e0 yazi`<alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call(self=0x0000000105074380, args=(&mlua::state::raw::RawLua, i32) @ 0x000000016fdf5898) at boxed.rs:1985:9
      frame #14: 0x0000000101abc294 yazi`mlua::state::raw::RawLua::create_callback::call_callback::{{closure}}(extra=0x000000010504ab90, nargs=1) at raw.rs:1191:39
      frame #15: 0x0000000101acdb9c yazi`mlua::state::util::callback_error_ext::{{closure}} at util.rs:108:9
      frame #16: 0x0000000101aa68e8 yazi`<core::panic::unwind_safe::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once(self=<unavailable>, (null)=<unavailable>) at unwind_safe.rs:272:9
      frame #17: 0x0000000101acef1c yazi`std::panicking::catch_unwind::do_call(data=6171876320) at panicking.rs:589:40
      frame #18: 0x0000000101a99804 yazi`__rust_try + 32
      frame #19: 0x0000000101a92064 yazi`std::panic::catch_unwind [inlined] std::panicking::catch_unwind(f=<unavailable>) at panicking.rs:552:19
      frame #20: 0x0000000101a92024 yazi`std::panic::catch_unwind(f=<unavailable>) at panic.rs:359:14
      frame #21: 0x0000000101accbc8 yazi`mlua::state::util::callback_error_ext(state=0x000000010588c008, extra=0x000000010504ab90, wrap_error=true, f={closure_env#0} @ 0x000000016fdf60d0) at util.rs:105:11
      frame #22: 0x0000000101abc0e8 yazi`mlua::state::raw::RawLua::create_callback::call_callback(state=0x000000010588c008) at raw.rs:1186:13
      frame #23: 0x0000000101b6838c yazi`precallC(L=0x000000010588c008, func=0x0000000105894a40, nresults=1, f=0x0000000101abc044) at ldo.c:536:7
      frame #24: 0x0000000101b68680 yazi`luaD_precall(L=0x000000010588c008, func=0x0000000105894a40, nresults=1) at ldo.c:599:7
      frame #25: 0x0000000101b350c0 yazi`luaV_execute(L=0x000000010588c008, ci=0x000000010504ae10) at lvm.c:1685:22
      frame #26: 0x0000000101b68a60 yazi`ccall(L=0x000000010588c008, func=0x0000000105049030, nResults=-1, inc=65537) at ldo.c:644:5
      frame #27: 0x0000000101b68ab0 yazi`luaD_callnoyield(L=0x000000010588c008, func=0x0000000105049030, nResults=-1) at ldo.c:662:3
      frame #28: 0x0000000101b5732c yazi`f_call(L=0x000000010588c008, ud=0x000000016fdf7208) at lapi.c:1038:3
      frame #29: 0x0000000101b66de4 yazi`luaD_rawrunprotected(L=0x000000010588c008, f=0x0000000101b572f8, ud=0x000000016fdf7208) at ldo.c:141:3
      frame #30: 0x0000000101b69580 yazi`luaD_pcall(L=0x000000010588c008, func=0x0000000101b572f8, u=0x000000016fdf7208, old_top=32, ef=16) at ldo.c:964:12
      frame #31: 0x0000000101b571d0 yazi`lua_pcallk(L=0x000000010588c008, nargs=0, nresults=-1, errfunc=1, ctx=0, k=0x0000000000000000) at lapi.c:1064:14
      frame #32: 0x0000000101aabb28 yazi`mlua::function::Function::call [inlined] mlua_sys::lua54::lua::lua_pcall(L=0x000000010588c008, n=0, r=-1, f=1) at lua.rs:278:5
      frame #33: 0x0000000101aabb1c yazi`mlua::function::Function::call(self=0x000000016fdf7590, args=<unavailable>) at function.rs:121:23
      frame #34: 0x0000000101ad84dc yazi`mlua::chunk::Chunk::call(self=<unavailable>, args=<unavailable>) at chunk.rs:627:31
      frame #35: 0x0000000101ad8414 yazi`mlua::chunk::Chunk::exec(self=<unavailable>) at chunk.rs:570:14
      frame #36: 0x0000000100b7e294 yazi`yazi_plugin::lua::stage_2(lua=0x0000000102a50038) at lua.rs:64:36
      frame #37: 0x0000000100b7c494 yazi`yazi_plugin::lua::init_lua at lua.rs:14:2
      frame #38: 0x000000010075cf48 yazi`yazi_plugin::init at lib.rs:9:2
      frame #39: 0x0000000100029228 yazi`yazi::main::{{closure}}((null)=0x000000016fdf90e8) at main.rs:35:2
      frame #40: 0x000000010019dddc yazi`tokio::runtime::park::CachedParkThread::block_on::{{closure}} at park.rs:285:71
      frame #41: 0x000000010019d91c yazi`tokio::runtime::park::CachedParkThread::block_on [inlined] tokio::task::coop::with_budget(budget=Budget @ 0x000000016fdf997b, f={closure_env#0}<yazi::main::{async_block_env#0}> @ 0x000000016fdf9980) at mod.rs:167:5
      frame #42: 0x000000010019d8c8 yazi`tokio::runtime::park::CachedParkThread::block_on [inlined] tokio::task::coop::budget(f={closure_env#0}<yazi::main::{async_block_env#0}> @ 0x000000016fdf9958) at mod.rs:133:5
      frame #43: 0x000000010019d850 yazi`tokio::runtime::park::CachedParkThread::block_on(self=0x000000016fdf99ef, f={async_block_env#0} @ 0x000000016fdf99f0) at park.rs:285:31
      frame #44: 0x00000001000e979c yazi`tokio::runtime::context::blocking::BlockingRegionGuard::block_on(self=0x000000016fdfaad0, f={async_block_env#0} @ 0x000000016fdfa240) at blocking.rs:66:14
      frame #45: 0x0000000100029db8 yazi`tokio::runtime::scheduler::multi_thread::MultiThread::block_on::{{closure}}(blocking=0x000000016fdfaad0) at mod.rs:87:22
      frame #46: 0x0000000100121310 yazi`tokio::runtime::context::runtime::enter_runtime(handle=0x000000016fdfe4f0, allow_block_in_place=true, f={closure_env#0}<yazi::main::{async_block_env#0}> @ 0x000000016fdfb348) at runtime.rs:65:16
      frame #47: 0x0000000100029d0c yazi`tokio::runtime::scheduler::multi_thread::MultiThread::block_on(self=0x000000016fdfe4c8, handle=0x000000016fdfe4f0, future=<unavailable>) at mod.rs:86:9
      frame #48: 0x000000010009b578 yazi`tokio::runtime::runtime::Runtime::block_on_inner(self=0x000000016fdfe4c0, future={async_block_env#0} @ 0x000000016fdfd468, (null)=SpawnMeta @ 0x000000016fdfcbce) at runtime.rs:358:50
      frame #49: 0x000000010009b8dc yazi`tokio::runtime::runtime::Runtime::block_on(self=0x000000016fdfe4c0, future={async_block_env#0} @ 0x000000016fdfe640) at runtime.rs:330:18
      frame #50: 0x00000001000ecdd0 yazi`yazi::main at main.rs:40:20
      frame #51: 0x0000000100005d70 yazi`core::ops::function::FnOnce::call_once((null)=0x00000001000eccdc, (null)=<unavailable>) at function.rs:253:5
      frame #52: 0x00000001000e9144 yazi`std::sys::backtrace::__rust_begin_short_backtrace(f=0x00000001000eccdc) at backtrace.rs:152:18
      frame #53: 0x00000001000d07cc yazi`std::rt::lang_start::{{closure}} at rt.rs:206:18
      frame #54: 0x0000000101b9a2d0 yazi`std::rt::lang_start_internal [inlined] core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once at function.rs:290:21 [opt]
      frame #55: 0x0000000101b9a2c8 yazi`std::rt::lang_start_internal [inlined] std::panicking::catch_unwind::do_call at panicking.rs:589:40 [opt]
      frame #56: 0x0000000101b9a2c4 yazi`std::rt::lang_start_internal [inlined] std::panicking::catch_unwind at panicking.rs:552:19 [opt]
      frame #57: 0x0000000101b9a2c4 yazi`std::rt::lang_start_internal [inlined] std::panic::catch_unwind at panic.rs:359:14 [opt]
      frame #58: 0x0000000101b9a2c4 yazi`std::rt::lang_start_internal [inlined] std::rt::lang_start_internal::{{closure}} at rt.rs:175:24 [opt]
      frame #59: 0x0000000101b99dbc yazi`std::rt::lang_start_internal [inlined] std::panicking::catch_unwind::do_call at panicking.rs:589:40 [opt]
      frame #60: 0x0000000101b99dbc yazi`std::rt::lang_start_internal [inlined] std::panicking::catch_unwind at panicking.rs:552:19 [opt]
      frame #61: 0x0000000101b99dbc yazi`std::rt::lang_start_internal [inlined] std::panic::catch_unwind at panic.rs:359:14 [opt]
      frame #62: 0x0000000101b99dbc yazi`std::rt::lang_start_internal at rt.rs:171:5 [opt]
      frame #63: 0x00000001000d07a4 yazi`std::rt::lang_start(main=0x00000001000eccdc, argc=1, argv=6171914888, sigpipe=0) at rt.rs:205:5
      frame #64: 0x00000001000ece68 yazi`main + 36
      frame #65: 0x0000000181cebf28 dyld`start + 2236

      Metadata

      Metadata

      Assignees

      No one assigned

        Labels

        No labels
        No labels

        Type

        No type

        Projects

        No projects

          Milestone

          No milestone

          Relationships

          None yet

          Development

          No branches or pull requests

          Issue actions

          , 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Force GitHub README to respect dark mode\n(function() {\n var style = document.createElement('style');\n style.textContent = '\n .markdown-body {\n color-scheme: dark light;\n }\n .markdown-body pre { background: #161b22 !important; }\n .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; }\n .markdown-body table th, .markdown-body table td { border-color: #30363d !important; }\n .markdown-body img { background: #0d1117; }\n .markdown-body blockquote { border-left-color: #8b949e; }\n .markdown-body hr { border-color: #30363d; }\n ';\n document.head.appendChild(style);\n})();", "GitHub Dark Mode README Fix"); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
          Skip to content

          Assertion failed on mlua 0.11.0 #615

          Description

          @sxyazi

          First of all, congratulations on the new release, you really did an outstanding job, @khvzak! 🎉🎉

          I'm upgrading my project to mlua 0.11.0 and encountered an error:

          Assertion failed: ((L->top.p <= L->ci->top.p) && "stack overflow"), function lua_pushnil, file lapi.c, line 500.
          

          Minimal reproducer (run in debug mode):

          use mlua::{Lua,Result,Table};fnmain() -> Result<()>{fntbl_with_mt(lua:&Lua) -> Result<Table>{let tbl = lua.create_table()?;
          tbl.set_metatable(Some(lua.create_table()?))?;Ok(tbl)}let lua = Lua::new();let _:Vec<Table> = (0..10000).map(|_| tbl_with_mt(&lua)).collect::<Result<_>>()?;Ok(())}
          [dependencies]
          mlua = { version = "0.11.0", features = [ "lua54", "vendored" ] }

          Here's the full backtrace:

          Stop reason: hit program assert
          > bt
          * thread #1, name = 'main', queue = 'com.apple.main-thread', stop reason = hit program assert* frame #0: 0x000000018200c764 libsystem_kernel.dylib`__pthread_kill + 8
          frame #1: 0x0000000182043c28 libsystem_pthread.dylib`pthread_kill + 288
          frame #2: 0x0000000181f51ae8 libsystem_c.dylib`abort + 180
          frame #3: 0x0000000181f50e44 libsystem_c.dylib`__assert_rtn + 272
          frame #4: 0x0000000101b54218 yazi`lua_pushnil(L=0x0000000105048008) at lapi.c:500:3
          frame #5: 0x0000000101ab81b0 yazi`mlua::state::raw::RawLua::drop_ref(self=0x0000000105043450, vref=0x000000016fdf46c0) at raw.rs:843:9
          frame #6: 0x0000000101ae3164 yazi`<mlua::types::value_ref::ValueRef as core::ops::drop::Drop>::drop(self=0x000000016fdf46c0) at value_ref.rs:56:30
          frame #7: 0x0000000101ac2ab8 yazi`core::ptr::drop_in_place<mlua::types::value_ref::ValueRef>((null)=0x000000016fdf46c0) at mod.rs:799:1
          frame #8: 0x0000000101ac20e0 yazi`core::ptr::drop_in_place<mlua::table::Table>((null)=0x000000016fdf46c0) at mod.rs:799:1
          frame #9: 0x0000000101ae0afc yazi`mlua::table::Table::set_metatable(self=0x000000016fdf4b30, metatable=Option<mlua::table::Table> @ 0x000000016fdf4d10) at table.rs:515:13
          frame #10: 0x00000001007c78fc yazi`yazi_plugin::loader::require::Require::create_mt(lua=0x000000010504ac68, id="folder-rules", mod=Table @ 0x000000016fdf5510, sync=true) at require.rs:66:6
          frame #11: 0x0000000100976ff4 yazi`yazi_plugin::loader::require::Require::install::{{closure}}((null)=0x0000000000000001, lua=0x000000010504ac68, id=String @ 0x000000016fdf5790) at require.rs:22:5
          frame #12: 0x0000000100b5ed50 yazi`mlua::state::Lua::create_function::{{closure}}(rawlua=0x0000000105043450, nargs=1) at state.rs:1264:13
          frame #13: 0x0000000101ac58e0 yazi`<alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call(self=0x0000000105074380, args=(&mlua::state::raw::RawLua, i32) @ 0x000000016fdf5898) at boxed.rs:1985:9
          frame #14: 0x0000000101abc294 yazi`mlua::state::raw::RawLua::create_callback::call_callback::{{closure}}(extra=0x000000010504ab90, nargs=1) at raw.rs:1191:39
          frame #15: 0x0000000101acdb9c yazi`mlua::state::util::callback_error_ext::{{closure}} at util.rs:108:9
          frame #16: 0x0000000101aa68e8 yazi`<core::panic::unwind_safe::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once(self=<unavailable>, (null)=<unavailable>) at unwind_safe.rs:272:9
          frame #17: 0x0000000101acef1c yazi`std::panicking::catch_unwind::do_call(data=6171876320) at panicking.rs:589:40
          frame #18: 0x0000000101a99804 yazi`__rust_try + 32
          frame #19: 0x0000000101a92064 yazi`std::panic::catch_unwind [inlined] std::panicking::catch_unwind(f=<unavailable>) at panicking.rs:552:19
          frame #20: 0x0000000101a92024 yazi`std::panic::catch_unwind(f=<unavailable>) at panic.rs:359:14
          frame #21: 0x0000000101accbc8 yazi`mlua::state::util::callback_error_ext(state=0x000000010588c008, extra=0x000000010504ab90, wrap_error=true, f={closure_env#0} @ 0x000000016fdf60d0) at util.rs:105:11
          frame #22: 0x0000000101abc0e8 yazi`mlua::state::raw::RawLua::create_callback::call_callback(state=0x000000010588c008) at raw.rs:1186:13
          frame #23: 0x0000000101b6838c yazi`precallC(L=0x000000010588c008, func=0x0000000105894a40, nresults=1, f=0x0000000101abc044) at ldo.c:536:7
          frame #24: 0x0000000101b68680 yazi`luaD_precall(L=0x000000010588c008, func=0x0000000105894a40, nresults=1) at ldo.c:599:7
          frame #25: 0x0000000101b350c0 yazi`luaV_execute(L=0x000000010588c008, ci=0x000000010504ae10) at lvm.c:1685:22
          frame #26: 0x0000000101b68a60 yazi`ccall(L=0x000000010588c008, func=0x0000000105049030, nResults=-1, inc=65537) at ldo.c:644:5
          frame #27: 0x0000000101b68ab0 yazi`luaD_callnoyield(L=0x000000010588c008, func=0x0000000105049030, nResults=-1) at ldo.c:662:3
          frame #28: 0x0000000101b5732c yazi`f_call(L=0x000000010588c008, ud=0x000000016fdf7208) at lapi.c:1038:3
          frame #29: 0x0000000101b66de4 yazi`luaD_rawrunprotected(L=0x000000010588c008, f=0x0000000101b572f8, ud=0x000000016fdf7208) at ldo.c:141:3
          frame #30: 0x0000000101b69580 yazi`luaD_pcall(L=0x000000010588c008, func=0x0000000101b572f8, u=0x000000016fdf7208, old_top=32, ef=16) at ldo.c:964:12
          frame #31: 0x0000000101b571d0 yazi`lua_pcallk(L=0x000000010588c008, nargs=0, nresults=-1, errfunc=1, ctx=0, k=0x0000000000000000) at lapi.c:1064:14
          frame #32: 0x0000000101aabb28 yazi`mlua::function::Function::call [inlined] mlua_sys::lua54::lua::lua_pcall(L=0x000000010588c008, n=0, r=-1, f=1) at lua.rs:278:5
          frame #33: 0x0000000101aabb1c yazi`mlua::function::Function::call(self=0x000000016fdf7590, args=<unavailable>) at function.rs:121:23
          frame #34: 0x0000000101ad84dc yazi`mlua::chunk::Chunk::call(self=<unavailable>, args=<unavailable>) at chunk.rs:627:31
          frame #35: 0x0000000101ad8414 yazi`mlua::chunk::Chunk::exec(self=<unavailable>) at chunk.rs:570:14
          frame #36: 0x0000000100b7e294 yazi`yazi_plugin::lua::stage_2(lua=0x0000000102a50038) at lua.rs:64:36
          frame #37: 0x0000000100b7c494 yazi`yazi_plugin::lua::init_lua at lua.rs:14:2
          frame #38: 0x000000010075cf48 yazi`yazi_plugin::init at lib.rs:9:2
          frame #39: 0x0000000100029228 yazi`yazi::main::{{closure}}((null)=0x000000016fdf90e8) at main.rs:35:2
          frame #40: 0x000000010019dddc yazi`tokio::runtime::park::CachedParkThread::block_on::{{closure}} at park.rs:285:71
          frame #41: 0x000000010019d91c yazi`tokio::runtime::park::CachedParkThread::block_on [inlined] tokio::task::coop::with_budget(budget=Budget @ 0x000000016fdf997b, f={closure_env#0}<yazi::main::{async_block_env#0}> @ 0x000000016fdf9980) at mod.rs:167:5
          frame #42: 0x000000010019d8c8 yazi`tokio::runtime::park::CachedParkThread::block_on [inlined] tokio::task::coop::budget(f={closure_env#0}<yazi::main::{async_block_env#0}> @ 0x000000016fdf9958) at mod.rs:133:5
          frame #43: 0x000000010019d850 yazi`tokio::runtime::park::CachedParkThread::block_on(self=0x000000016fdf99ef, f={async_block_env#0} @ 0x000000016fdf99f0) at park.rs:285:31
          frame #44: 0x00000001000e979c yazi`tokio::runtime::context::blocking::BlockingRegionGuard::block_on(self=0x000000016fdfaad0, f={async_block_env#0} @ 0x000000016fdfa240) at blocking.rs:66:14
          frame #45: 0x0000000100029db8 yazi`tokio::runtime::scheduler::multi_thread::MultiThread::block_on::{{closure}}(blocking=0x000000016fdfaad0) at mod.rs:87:22
          frame #46: 0x0000000100121310 yazi`tokio::runtime::context::runtime::enter_runtime(handle=0x000000016fdfe4f0, allow_block_in_place=true, f={closure_env#0}<yazi::main::{async_block_env#0}> @ 0x000000016fdfb348) at runtime.rs:65:16
          frame #47: 0x0000000100029d0c yazi`tokio::runtime::scheduler::multi_thread::MultiThread::block_on(self=0x000000016fdfe4c8, handle=0x000000016fdfe4f0, future=<unavailable>) at mod.rs:86:9
          frame #48: 0x000000010009b578 yazi`tokio::runtime::runtime::Runtime::block_on_inner(self=0x000000016fdfe4c0, future={async_block_env#0} @ 0x000000016fdfd468, (null)=SpawnMeta @ 0x000000016fdfcbce) at runtime.rs:358:50
          frame #49: 0x000000010009b8dc yazi`tokio::runtime::runtime::Runtime::block_on(self=0x000000016fdfe4c0, future={async_block_env#0} @ 0x000000016fdfe640) at runtime.rs:330:18
          frame #50: 0x00000001000ecdd0 yazi`yazi::main at main.rs:40:20
          frame #51: 0x0000000100005d70 yazi`core::ops::function::FnOnce::call_once((null)=0x00000001000eccdc, (null)=<unavailable>) at function.rs:253:5
          frame #52: 0x00000001000e9144 yazi`std::sys::backtrace::__rust_begin_short_backtrace(f=0x00000001000eccdc) at backtrace.rs:152:18
          frame #53: 0x00000001000d07cc yazi`std::rt::lang_start::{{closure}} at rt.rs:206:18
          frame #54: 0x0000000101b9a2d0 yazi`std::rt::lang_start_internal [inlined] core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once at function.rs:290:21 [opt]
          frame #55: 0x0000000101b9a2c8 yazi`std::rt::lang_start_internal [inlined] std::panicking::catch_unwind::do_call at panicking.rs:589:40 [opt]
          frame #56: 0x0000000101b9a2c4 yazi`std::rt::lang_start_internal [inlined] std::panicking::catch_unwind at panicking.rs:552:19 [opt]
          frame #57: 0x0000000101b9a2c4 yazi`std::rt::lang_start_internal [inlined] std::panic::catch_unwind at panic.rs:359:14 [opt]
          frame #58: 0x0000000101b9a2c4 yazi`std::rt::lang_start_internal [inlined] std::rt::lang_start_internal::{{closure}} at rt.rs:175:24 [opt]
          frame #59: 0x0000000101b99dbc yazi`std::rt::lang_start_internal [inlined] std::panicking::catch_unwind::do_call at panicking.rs:589:40 [opt]
          frame #60: 0x0000000101b99dbc yazi`std::rt::lang_start_internal [inlined] std::panicking::catch_unwind at panicking.rs:552:19 [opt]
          frame #61: 0x0000000101b99dbc yazi`std::rt::lang_start_internal [inlined] std::panic::catch_unwind at panic.rs:359:14 [opt]
          frame #62: 0x0000000101b99dbc yazi`std::rt::lang_start_internal at rt.rs:171:5 [opt]
          frame #63: 0x00000001000d07a4 yazi`std::rt::lang_start(main=0x00000001000eccdc, argc=1, argv=6171914888, sigpipe=0) at rt.rs:205:5
          frame #64: 0x00000001000ece68 yazi`main + 36
          frame #65: 0x0000000181cebf28 dyld`start + 2236

          Metadata

          Metadata

          Assignees

          No one assigned

            Labels

            No labels
            No labels

            Type

            No type

            Projects

            No projects

              Milestone

              No milestone

              Relationships

              None yet

              Development

              No branches or pull requests

              Issue actions

              , 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Highlight search terms from Google/DuckDuckGo/Bing referrer\n(function() {\n var ref = document.referrer;\n var terms = [];\n \n if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) {\n var url = new URL(ref);\n var q = url.searchParams.get('q') || url.searchParams.get('p');\n if (q) {\n terms = q.split(/\\s+/).filter(function(t) { return t.length > 2; });\n }\n }\n \n if (terms.length === 0) return;\n \n var style = document.createElement('style');\n style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }';\n document.head.appendChild(style);\n \n function highlight(node) {\n if (node.nodeType === 3) { // text node\n var text = node.textContent;\n var found = false;\n terms.forEach(function(term) {\n var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\') + ')', 'gi');\n if (regex.test(text)) {\n found = true;\n var frag = document.createDocumentFragment();\n var parts = text.split(regex);\n parts.forEach(function(part, i) {\n if (i % 2 === 0) {\n frag.appendChild(document.createTextNode(part));\n } else {\n var span = document.createElement('span');\n span.className = 'userscript-highlight';\n span.textContent = part;\n frag.appendChild(span);\n }\n });\n node.parentNode.replaceChild(frag, node);\n }\n });\n } else if (node.nodeType === 1 && node.childNodes) { // element\n var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT'];\n if (!skipTags.includes(node.tagName)) {\n Array.from(node.childNodes).forEach(highlight);\n }\n }\n }\n \n highlight(document.body);\n \n // Re-highlight on dynamic content\n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1 || node.nodeType === 3) highlight(node);\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Highlight Search Terms"); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
              Skip to content

              Assertion failed on mlua 0.11.0 #615

              Description

              @sxyazi

              First of all, congratulations on the new release, you really did an outstanding job, @khvzak! 🎉🎉

              I'm upgrading my project to mlua 0.11.0 and encountered an error:

              Assertion failed: ((L->top.p <= L->ci->top.p) && "stack overflow"), function lua_pushnil, file lapi.c, line 500.
              

              Minimal reproducer (run in debug mode):

              use mlua::{Lua,Result,Table};fnmain() -> Result<()>{fntbl_with_mt(lua:&Lua) -> Result<Table>{let tbl = lua.create_table()?;
              tbl.set_metatable(Some(lua.create_table()?))?;Ok(tbl)}let lua = Lua::new();let _:Vec<Table> = (0..10000).map(|_| tbl_with_mt(&lua)).collect::<Result<_>>()?;Ok(())}
              [dependencies]
              mlua = { version = "0.11.0", features = [ "lua54", "vendored" ] }

              Here's the full backtrace:

              Stop reason: hit program assert
              > bt
              * thread #1, name = 'main', queue = 'com.apple.main-thread', stop reason = hit program assert* frame #0: 0x000000018200c764 libsystem_kernel.dylib`__pthread_kill + 8
              frame #1: 0x0000000182043c28 libsystem_pthread.dylib`pthread_kill + 288
              frame #2: 0x0000000181f51ae8 libsystem_c.dylib`abort + 180
              frame #3: 0x0000000181f50e44 libsystem_c.dylib`__assert_rtn + 272
              frame #4: 0x0000000101b54218 yazi`lua_pushnil(L=0x0000000105048008) at lapi.c:500:3
              frame #5: 0x0000000101ab81b0 yazi`mlua::state::raw::RawLua::drop_ref(self=0x0000000105043450, vref=0x000000016fdf46c0) at raw.rs:843:9
              frame #6: 0x0000000101ae3164 yazi`<mlua::types::value_ref::ValueRef as core::ops::drop::Drop>::drop(self=0x000000016fdf46c0) at value_ref.rs:56:30
              frame #7: 0x0000000101ac2ab8 yazi`core::ptr::drop_in_place<mlua::types::value_ref::ValueRef>((null)=0x000000016fdf46c0) at mod.rs:799:1
              frame #8: 0x0000000101ac20e0 yazi`core::ptr::drop_in_place<mlua::table::Table>((null)=0x000000016fdf46c0) at mod.rs:799:1
              frame #9: 0x0000000101ae0afc yazi`mlua::table::Table::set_metatable(self=0x000000016fdf4b30, metatable=Option<mlua::table::Table> @ 0x000000016fdf4d10) at table.rs:515:13
              frame #10: 0x00000001007c78fc yazi`yazi_plugin::loader::require::Require::create_mt(lua=0x000000010504ac68, id="folder-rules", mod=Table @ 0x000000016fdf5510, sync=true) at require.rs:66:6
              frame #11: 0x0000000100976ff4 yazi`yazi_plugin::loader::require::Require::install::{{closure}}((null)=0x0000000000000001, lua=0x000000010504ac68, id=String @ 0x000000016fdf5790) at require.rs:22:5
              frame #12: 0x0000000100b5ed50 yazi`mlua::state::Lua::create_function::{{closure}}(rawlua=0x0000000105043450, nargs=1) at state.rs:1264:13
              frame #13: 0x0000000101ac58e0 yazi`<alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call(self=0x0000000105074380, args=(&mlua::state::raw::RawLua, i32) @ 0x000000016fdf5898) at boxed.rs:1985:9
              frame #14: 0x0000000101abc294 yazi`mlua::state::raw::RawLua::create_callback::call_callback::{{closure}}(extra=0x000000010504ab90, nargs=1) at raw.rs:1191:39
              frame #15: 0x0000000101acdb9c yazi`mlua::state::util::callback_error_ext::{{closure}} at util.rs:108:9
              frame #16: 0x0000000101aa68e8 yazi`<core::panic::unwind_safe::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once(self=<unavailable>, (null)=<unavailable>) at unwind_safe.rs:272:9
              frame #17: 0x0000000101acef1c yazi`std::panicking::catch_unwind::do_call(data=6171876320) at panicking.rs:589:40
              frame #18: 0x0000000101a99804 yazi`__rust_try + 32
              frame #19: 0x0000000101a92064 yazi`std::panic::catch_unwind [inlined] std::panicking::catch_unwind(f=<unavailable>) at panicking.rs:552:19
              frame #20: 0x0000000101a92024 yazi`std::panic::catch_unwind(f=<unavailable>) at panic.rs:359:14
              frame #21: 0x0000000101accbc8 yazi`mlua::state::util::callback_error_ext(state=0x000000010588c008, extra=0x000000010504ab90, wrap_error=true, f={closure_env#0} @ 0x000000016fdf60d0) at util.rs:105:11
              frame #22: 0x0000000101abc0e8 yazi`mlua::state::raw::RawLua::create_callback::call_callback(state=0x000000010588c008) at raw.rs:1186:13
              frame #23: 0x0000000101b6838c yazi`precallC(L=0x000000010588c008, func=0x0000000105894a40, nresults=1, f=0x0000000101abc044) at ldo.c:536:7
              frame #24: 0x0000000101b68680 yazi`luaD_precall(L=0x000000010588c008, func=0x0000000105894a40, nresults=1) at ldo.c:599:7
              frame #25: 0x0000000101b350c0 yazi`luaV_execute(L=0x000000010588c008, ci=0x000000010504ae10) at lvm.c:1685:22
              frame #26: 0x0000000101b68a60 yazi`ccall(L=0x000000010588c008, func=0x0000000105049030, nResults=-1, inc=65537) at ldo.c:644:5
              frame #27: 0x0000000101b68ab0 yazi`luaD_callnoyield(L=0x000000010588c008, func=0x0000000105049030, nResults=-1) at ldo.c:662:3
              frame #28: 0x0000000101b5732c yazi`f_call(L=0x000000010588c008, ud=0x000000016fdf7208) at lapi.c:1038:3
              frame #29: 0x0000000101b66de4 yazi`luaD_rawrunprotected(L=0x000000010588c008, f=0x0000000101b572f8, ud=0x000000016fdf7208) at ldo.c:141:3
              frame #30: 0x0000000101b69580 yazi`luaD_pcall(L=0x000000010588c008, func=0x0000000101b572f8, u=0x000000016fdf7208, old_top=32, ef=16) at ldo.c:964:12
              frame #31: 0x0000000101b571d0 yazi`lua_pcallk(L=0x000000010588c008, nargs=0, nresults=-1, errfunc=1, ctx=0, k=0x0000000000000000) at lapi.c:1064:14
              frame #32: 0x0000000101aabb28 yazi`mlua::function::Function::call [inlined] mlua_sys::lua54::lua::lua_pcall(L=0x000000010588c008, n=0, r=-1, f=1) at lua.rs:278:5
              frame #33: 0x0000000101aabb1c yazi`mlua::function::Function::call(self=0x000000016fdf7590, args=<unavailable>) at function.rs:121:23
              frame #34: 0x0000000101ad84dc yazi`mlua::chunk::Chunk::call(self=<unavailable>, args=<unavailable>) at chunk.rs:627:31
              frame #35: 0x0000000101ad8414 yazi`mlua::chunk::Chunk::exec(self=<unavailable>) at chunk.rs:570:14
              frame #36: 0x0000000100b7e294 yazi`yazi_plugin::lua::stage_2(lua=0x0000000102a50038) at lua.rs:64:36
              frame #37: 0x0000000100b7c494 yazi`yazi_plugin::lua::init_lua at lua.rs:14:2
              frame #38: 0x000000010075cf48 yazi`yazi_plugin::init at lib.rs:9:2
              frame #39: 0x0000000100029228 yazi`yazi::main::{{closure}}((null)=0x000000016fdf90e8) at main.rs:35:2
              frame #40: 0x000000010019dddc yazi`tokio::runtime::park::CachedParkThread::block_on::{{closure}} at park.rs:285:71
              frame #41: 0x000000010019d91c yazi`tokio::runtime::park::CachedParkThread::block_on [inlined] tokio::task::coop::with_budget(budget=Budget @ 0x000000016fdf997b, f={closure_env#0}<yazi::main::{async_block_env#0}> @ 0x000000016fdf9980) at mod.rs:167:5
              frame #42: 0x000000010019d8c8 yazi`tokio::runtime::park::CachedParkThread::block_on [inlined] tokio::task::coop::budget(f={closure_env#0}<yazi::main::{async_block_env#0}> @ 0x000000016fdf9958) at mod.rs:133:5
              frame #43: 0x000000010019d850 yazi`tokio::runtime::park::CachedParkThread::block_on(self=0x000000016fdf99ef, f={async_block_env#0} @ 0x000000016fdf99f0) at park.rs:285:31
              frame #44: 0x00000001000e979c yazi`tokio::runtime::context::blocking::BlockingRegionGuard::block_on(self=0x000000016fdfaad0, f={async_block_env#0} @ 0x000000016fdfa240) at blocking.rs:66:14
              frame #45: 0x0000000100029db8 yazi`tokio::runtime::scheduler::multi_thread::MultiThread::block_on::{{closure}}(blocking=0x000000016fdfaad0) at mod.rs:87:22
              frame #46: 0x0000000100121310 yazi`tokio::runtime::context::runtime::enter_runtime(handle=0x000000016fdfe4f0, allow_block_in_place=true, f={closure_env#0}<yazi::main::{async_block_env#0}> @ 0x000000016fdfb348) at runtime.rs:65:16
              frame #47: 0x0000000100029d0c yazi`tokio::runtime::scheduler::multi_thread::MultiThread::block_on(self=0x000000016fdfe4c8, handle=0x000000016fdfe4f0, future=<unavailable>) at mod.rs:86:9
              frame #48: 0x000000010009b578 yazi`tokio::runtime::runtime::Runtime::block_on_inner(self=0x000000016fdfe4c0, future={async_block_env#0} @ 0x000000016fdfd468, (null)=SpawnMeta @ 0x000000016fdfcbce) at runtime.rs:358:50
              frame #49: 0x000000010009b8dc yazi`tokio::runtime::runtime::Runtime::block_on(self=0x000000016fdfe4c0, future={async_block_env#0} @ 0x000000016fdfe640) at runtime.rs:330:18
              frame #50: 0x00000001000ecdd0 yazi`yazi::main at main.rs:40:20
              frame #51: 0x0000000100005d70 yazi`core::ops::function::FnOnce::call_once((null)=0x00000001000eccdc, (null)=<unavailable>) at function.rs:253:5
              frame #52: 0x00000001000e9144 yazi`std::sys::backtrace::__rust_begin_short_backtrace(f=0x00000001000eccdc) at backtrace.rs:152:18
              frame #53: 0x00000001000d07cc yazi`std::rt::lang_start::{{closure}} at rt.rs:206:18
              frame #54: 0x0000000101b9a2d0 yazi`std::rt::lang_start_internal [inlined] core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once at function.rs:290:21 [opt]
              frame #55: 0x0000000101b9a2c8 yazi`std::rt::lang_start_internal [inlined] std::panicking::catch_unwind::do_call at panicking.rs:589:40 [opt]
              frame #56: 0x0000000101b9a2c4 yazi`std::rt::lang_start_internal [inlined] std::panicking::catch_unwind at panicking.rs:552:19 [opt]
              frame #57: 0x0000000101b9a2c4 yazi`std::rt::lang_start_internal [inlined] std::panic::catch_unwind at panic.rs:359:14 [opt]
              frame #58: 0x0000000101b9a2c4 yazi`std::rt::lang_start_internal [inlined] std::rt::lang_start_internal::{{closure}} at rt.rs:175:24 [opt]
              frame #59: 0x0000000101b99dbc yazi`std::rt::lang_start_internal [inlined] std::panicking::catch_unwind::do_call at panicking.rs:589:40 [opt]
              frame #60: 0x0000000101b99dbc yazi`std::rt::lang_start_internal [inlined] std::panicking::catch_unwind at panicking.rs:552:19 [opt]
              frame #61: 0x0000000101b99dbc yazi`std::rt::lang_start_internal [inlined] std::panic::catch_unwind at panic.rs:359:14 [opt]
              frame #62: 0x0000000101b99dbc yazi`std::rt::lang_start_internal at rt.rs:171:5 [opt]
              frame #63: 0x00000001000d07a4 yazi`std::rt::lang_start(main=0x00000001000eccdc, argc=1, argv=6171914888, sigpipe=0) at rt.rs:205:5
              frame #64: 0x00000001000ece68 yazi`main + 36
              frame #65: 0x0000000181cebf28 dyld`start + 2236

              Metadata

              Metadata

              Assignees

              No one assigned

                Labels

                No labels
                No labels

                Type

                No type

                Projects

                No projects

                  Milestone

                  No milestone

                  Relationships

                  None yet

                  Development

                  No branches or pull requests

                  Issue actions

                  , 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Strip utm_, fbclid, gclid, etc. from all links on page\n(function() {\n var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content',\n 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid',\n 'ref', 'ref_src', 'source', 'medium', 'campaign'];\n \n function cleanUrl(url) {\n try {\n var u = new URL(url, window.location.origin);\n var changed = false;\n trackingParams.forEach(function(p) {\n if (u.searchParams.has(p)) {\n u.searchParams.delete(p);\n changed = true;\n }\n });\n return changed ? u.toString() : url;\n } catch (e) {\n return url;\n }\n }\n \n function cleanLinks() {\n document.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n \n cleanLinks();\n \n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1) {\n if (node.tagName === 'A') cleanLinks();\n node.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Remove Tracking Parameters from Links"); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + '
                  Skip to content

                  Assertion failed on mlua 0.11.0 #615

                  Description

                  @sxyazi

                  First of all, congratulations on the new release, you really did an outstanding job, @khvzak! 🎉🎉

                  I'm upgrading my project to mlua 0.11.0 and encountered an error:

                  Assertion failed: ((L->top.p <= L->ci->top.p) && "stack overflow"), function lua_pushnil, file lapi.c, line 500.
                  

                  Minimal reproducer (run in debug mode):

                  use mlua::{Lua,Result,Table};fnmain() -> Result<()>{fntbl_with_mt(lua:&Lua) -> Result<Table>{let tbl = lua.create_table()?;
                  tbl.set_metatable(Some(lua.create_table()?))?;Ok(tbl)}let lua = Lua::new();let _:Vec<Table> = (0..10000).map(|_| tbl_with_mt(&lua)).collect::<Result<_>>()?;Ok(())}
                  [dependencies]
                  mlua = { version = "0.11.0", features = [ "lua54", "vendored" ] }

                  Here's the full backtrace:

                  Stop reason: hit program assert
                  > bt
                  * thread #1, name = 'main', queue = 'com.apple.main-thread', stop reason = hit program assert* frame #0: 0x000000018200c764 libsystem_kernel.dylib`__pthread_kill + 8
                  frame #1: 0x0000000182043c28 libsystem_pthread.dylib`pthread_kill + 288
                  frame #2: 0x0000000181f51ae8 libsystem_c.dylib`abort + 180
                  frame #3: 0x0000000181f50e44 libsystem_c.dylib`__assert_rtn + 272
                  frame #4: 0x0000000101b54218 yazi`lua_pushnil(L=0x0000000105048008) at lapi.c:500:3
                  frame #5: 0x0000000101ab81b0 yazi`mlua::state::raw::RawLua::drop_ref(self=0x0000000105043450, vref=0x000000016fdf46c0) at raw.rs:843:9
                  frame #6: 0x0000000101ae3164 yazi`<mlua::types::value_ref::ValueRef as core::ops::drop::Drop>::drop(self=0x000000016fdf46c0) at value_ref.rs:56:30
                  frame #7: 0x0000000101ac2ab8 yazi`core::ptr::drop_in_place<mlua::types::value_ref::ValueRef>((null)=0x000000016fdf46c0) at mod.rs:799:1
                  frame #8: 0x0000000101ac20e0 yazi`core::ptr::drop_in_place<mlua::table::Table>((null)=0x000000016fdf46c0) at mod.rs:799:1
                  frame #9: 0x0000000101ae0afc yazi`mlua::table::Table::set_metatable(self=0x000000016fdf4b30, metatable=Option<mlua::table::Table> @ 0x000000016fdf4d10) at table.rs:515:13
                  frame #10: 0x00000001007c78fc yazi`yazi_plugin::loader::require::Require::create_mt(lua=0x000000010504ac68, id="folder-rules", mod=Table @ 0x000000016fdf5510, sync=true) at require.rs:66:6
                  frame #11: 0x0000000100976ff4 yazi`yazi_plugin::loader::require::Require::install::{{closure}}((null)=0x0000000000000001, lua=0x000000010504ac68, id=String @ 0x000000016fdf5790) at require.rs:22:5
                  frame #12: 0x0000000100b5ed50 yazi`mlua::state::Lua::create_function::{{closure}}(rawlua=0x0000000105043450, nargs=1) at state.rs:1264:13
                  frame #13: 0x0000000101ac58e0 yazi`<alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call(self=0x0000000105074380, args=(&mlua::state::raw::RawLua, i32) @ 0x000000016fdf5898) at boxed.rs:1985:9
                  frame #14: 0x0000000101abc294 yazi`mlua::state::raw::RawLua::create_callback::call_callback::{{closure}}(extra=0x000000010504ab90, nargs=1) at raw.rs:1191:39
                  frame #15: 0x0000000101acdb9c yazi`mlua::state::util::callback_error_ext::{{closure}} at util.rs:108:9
                  frame #16: 0x0000000101aa68e8 yazi`<core::panic::unwind_safe::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once(self=<unavailable>, (null)=<unavailable>) at unwind_safe.rs:272:9
                  frame #17: 0x0000000101acef1c yazi`std::panicking::catch_unwind::do_call(data=6171876320) at panicking.rs:589:40
                  frame #18: 0x0000000101a99804 yazi`__rust_try + 32
                  frame #19: 0x0000000101a92064 yazi`std::panic::catch_unwind [inlined] std::panicking::catch_unwind(f=<unavailable>) at panicking.rs:552:19
                  frame #20: 0x0000000101a92024 yazi`std::panic::catch_unwind(f=<unavailable>) at panic.rs:359:14
                  frame #21: 0x0000000101accbc8 yazi`mlua::state::util::callback_error_ext(state=0x000000010588c008, extra=0x000000010504ab90, wrap_error=true, f={closure_env#0} @ 0x000000016fdf60d0) at util.rs:105:11
                  frame #22: 0x0000000101abc0e8 yazi`mlua::state::raw::RawLua::create_callback::call_callback(state=0x000000010588c008) at raw.rs:1186:13
                  frame #23: 0x0000000101b6838c yazi`precallC(L=0x000000010588c008, func=0x0000000105894a40, nresults=1, f=0x0000000101abc044) at ldo.c:536:7
                  frame #24: 0x0000000101b68680 yazi`luaD_precall(L=0x000000010588c008, func=0x0000000105894a40, nresults=1) at ldo.c:599:7
                  frame #25: 0x0000000101b350c0 yazi`luaV_execute(L=0x000000010588c008, ci=0x000000010504ae10) at lvm.c:1685:22
                  frame #26: 0x0000000101b68a60 yazi`ccall(L=0x000000010588c008, func=0x0000000105049030, nResults=-1, inc=65537) at ldo.c:644:5
                  frame #27: 0x0000000101b68ab0 yazi`luaD_callnoyield(L=0x000000010588c008, func=0x0000000105049030, nResults=-1) at ldo.c:662:3
                  frame #28: 0x0000000101b5732c yazi`f_call(L=0x000000010588c008, ud=0x000000016fdf7208) at lapi.c:1038:3
                  frame #29: 0x0000000101b66de4 yazi`luaD_rawrunprotected(L=0x000000010588c008, f=0x0000000101b572f8, ud=0x000000016fdf7208) at ldo.c:141:3
                  frame #30: 0x0000000101b69580 yazi`luaD_pcall(L=0x000000010588c008, func=0x0000000101b572f8, u=0x000000016fdf7208, old_top=32, ef=16) at ldo.c:964:12
                  frame #31: 0x0000000101b571d0 yazi`lua_pcallk(L=0x000000010588c008, nargs=0, nresults=-1, errfunc=1, ctx=0, k=0x0000000000000000) at lapi.c:1064:14
                  frame #32: 0x0000000101aabb28 yazi`mlua::function::Function::call [inlined] mlua_sys::lua54::lua::lua_pcall(L=0x000000010588c008, n=0, r=-1, f=1) at lua.rs:278:5
                  frame #33: 0x0000000101aabb1c yazi`mlua::function::Function::call(self=0x000000016fdf7590, args=<unavailable>) at function.rs:121:23
                  frame #34: 0x0000000101ad84dc yazi`mlua::chunk::Chunk::call(self=<unavailable>, args=<unavailable>) at chunk.rs:627:31
                  frame #35: 0x0000000101ad8414 yazi`mlua::chunk::Chunk::exec(self=<unavailable>) at chunk.rs:570:14
                  frame #36: 0x0000000100b7e294 yazi`yazi_plugin::lua::stage_2(lua=0x0000000102a50038) at lua.rs:64:36
                  frame #37: 0x0000000100b7c494 yazi`yazi_plugin::lua::init_lua at lua.rs:14:2
                  frame #38: 0x000000010075cf48 yazi`yazi_plugin::init at lib.rs:9:2
                  frame #39: 0x0000000100029228 yazi`yazi::main::{{closure}}((null)=0x000000016fdf90e8) at main.rs:35:2
                  frame #40: 0x000000010019dddc yazi`tokio::runtime::park::CachedParkThread::block_on::{{closure}} at park.rs:285:71
                  frame #41: 0x000000010019d91c yazi`tokio::runtime::park::CachedParkThread::block_on [inlined] tokio::task::coop::with_budget(budget=Budget @ 0x000000016fdf997b, f={closure_env#0}<yazi::main::{async_block_env#0}> @ 0x000000016fdf9980) at mod.rs:167:5
                  frame #42: 0x000000010019d8c8 yazi`tokio::runtime::park::CachedParkThread::block_on [inlined] tokio::task::coop::budget(f={closure_env#0}<yazi::main::{async_block_env#0}> @ 0x000000016fdf9958) at mod.rs:133:5
                  frame #43: 0x000000010019d850 yazi`tokio::runtime::park::CachedParkThread::block_on(self=0x000000016fdf99ef, f={async_block_env#0} @ 0x000000016fdf99f0) at park.rs:285:31
                  frame #44: 0x00000001000e979c yazi`tokio::runtime::context::blocking::BlockingRegionGuard::block_on(self=0x000000016fdfaad0, f={async_block_env#0} @ 0x000000016fdfa240) at blocking.rs:66:14
                  frame #45: 0x0000000100029db8 yazi`tokio::runtime::scheduler::multi_thread::MultiThread::block_on::{{closure}}(blocking=0x000000016fdfaad0) at mod.rs:87:22
                  frame #46: 0x0000000100121310 yazi`tokio::runtime::context::runtime::enter_runtime(handle=0x000000016fdfe4f0, allow_block_in_place=true, f={closure_env#0}<yazi::main::{async_block_env#0}> @ 0x000000016fdfb348) at runtime.rs:65:16
                  frame #47: 0x0000000100029d0c yazi`tokio::runtime::scheduler::multi_thread::MultiThread::block_on(self=0x000000016fdfe4c8, handle=0x000000016fdfe4f0, future=<unavailable>) at mod.rs:86:9
                  frame #48: 0x000000010009b578 yazi`tokio::runtime::runtime::Runtime::block_on_inner(self=0x000000016fdfe4c0, future={async_block_env#0} @ 0x000000016fdfd468, (null)=SpawnMeta @ 0x000000016fdfcbce) at runtime.rs:358:50
                  frame #49: 0x000000010009b8dc yazi`tokio::runtime::runtime::Runtime::block_on(self=0x000000016fdfe4c0, future={async_block_env#0} @ 0x000000016fdfe640) at runtime.rs:330:18
                  frame #50: 0x00000001000ecdd0 yazi`yazi::main at main.rs:40:20
                  frame #51: 0x0000000100005d70 yazi`core::ops::function::FnOnce::call_once((null)=0x00000001000eccdc, (null)=<unavailable>) at function.rs:253:5
                  frame #52: 0x00000001000e9144 yazi`std::sys::backtrace::__rust_begin_short_backtrace(f=0x00000001000eccdc) at backtrace.rs:152:18
                  frame #53: 0x00000001000d07cc yazi`std::rt::lang_start::{{closure}} at rt.rs:206:18
                  frame #54: 0x0000000101b9a2d0 yazi`std::rt::lang_start_internal [inlined] core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once at function.rs:290:21 [opt]
                  frame #55: 0x0000000101b9a2c8 yazi`std::rt::lang_start_internal [inlined] std::panicking::catch_unwind::do_call at panicking.rs:589:40 [opt]
                  frame #56: 0x0000000101b9a2c4 yazi`std::rt::lang_start_internal [inlined] std::panicking::catch_unwind at panicking.rs:552:19 [opt]
                  frame #57: 0x0000000101b9a2c4 yazi`std::rt::lang_start_internal [inlined] std::panic::catch_unwind at panic.rs:359:14 [opt]
                  frame #58: 0x0000000101b9a2c4 yazi`std::rt::lang_start_internal [inlined] std::rt::lang_start_internal::{{closure}} at rt.rs:175:24 [opt]
                  frame #59: 0x0000000101b99dbc yazi`std::rt::lang_start_internal [inlined] std::panicking::catch_unwind::do_call at panicking.rs:589:40 [opt]
                  frame #60: 0x0000000101b99dbc yazi`std::rt::lang_start_internal [inlined] std::panicking::catch_unwind at panicking.rs:552:19 [opt]
                  frame #61: 0x0000000101b99dbc yazi`std::rt::lang_start_internal [inlined] std::panic::catch_unwind at panic.rs:359:14 [opt]
                  frame #62: 0x0000000101b99dbc yazi`std::rt::lang_start_internal at rt.rs:171:5 [opt]
                  frame #63: 0x00000001000d07a4 yazi`std::rt::lang_start(main=0x00000001000eccdc, argc=1, argv=6171914888, sigpipe=0) at rt.rs:205:5
                  frame #64: 0x00000001000ece68 yazi`main + 36
                  frame #65: 0x0000000181cebf28 dyld`start + 2236

                  Metadata

                  Metadata

                  Assignees

                  No one assigned

                    Labels

                    No labels
                    No labels

                    Type

                    No type

                    Projects

                    No projects

                      Milestone

                      No milestone

                      Relationships

                      None yet

                      Development

                      No branches or pull requests

                      Issue actions

                      , 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Auto-enable theater mode on YouTube\n(function() {\n function tryTheater() {\n var btn = document.querySelector('button[aria-label=\"Theater mode\"], ytd-player #player button[title=\"Theater mode\"]');\n if (btn && !btn.classList.contains('activated')) {\n btn.click();\n }\n }\n \n // Try immediately\n tryTheater();\n \n // Try after navigation (SPA)\n var lastUrl = location.href;\n setInterval(function() {\n if (location.href !== lastUrl) {\n lastUrl = location.href;\n setTimeout(tryTheater, 500);\n }\n }, 1000);\n \n // Also try on player load\n var observer = new MutationObserver(tryTheater);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "YouTube Theater Mode Default"); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
                      Skip to content

                      Assertion failed on mlua 0.11.0 #615

                      Description

                      @sxyazi

                      First of all, congratulations on the new release, you really did an outstanding job, @khvzak! 🎉🎉

                      I'm upgrading my project to mlua 0.11.0 and encountered an error:

                      Assertion failed: ((L->top.p <= L->ci->top.p) && "stack overflow"), function lua_pushnil, file lapi.c, line 500.
                      

                      Minimal reproducer (run in debug mode):

                      use mlua::{Lua,Result,Table};fnmain() -> Result<()>{fntbl_with_mt(lua:&Lua) -> Result<Table>{let tbl = lua.create_table()?;
                      tbl.set_metatable(Some(lua.create_table()?))?;Ok(tbl)}let lua = Lua::new();let _:Vec<Table> = (0..10000).map(|_| tbl_with_mt(&lua)).collect::<Result<_>>()?;Ok(())}
                      [dependencies]
                      mlua = { version = "0.11.0", features = [ "lua54", "vendored" ] }

                      Here's the full backtrace:

                      Stop reason: hit program assert
                      > bt
                      * thread #1, name = 'main', queue = 'com.apple.main-thread', stop reason = hit program assert* frame #0: 0x000000018200c764 libsystem_kernel.dylib`__pthread_kill + 8
                      frame #1: 0x0000000182043c28 libsystem_pthread.dylib`pthread_kill + 288
                      frame #2: 0x0000000181f51ae8 libsystem_c.dylib`abort + 180
                      frame #3: 0x0000000181f50e44 libsystem_c.dylib`__assert_rtn + 272
                      frame #4: 0x0000000101b54218 yazi`lua_pushnil(L=0x0000000105048008) at lapi.c:500:3
                      frame #5: 0x0000000101ab81b0 yazi`mlua::state::raw::RawLua::drop_ref(self=0x0000000105043450, vref=0x000000016fdf46c0) at raw.rs:843:9
                      frame #6: 0x0000000101ae3164 yazi`<mlua::types::value_ref::ValueRef as core::ops::drop::Drop>::drop(self=0x000000016fdf46c0) at value_ref.rs:56:30
                      frame #7: 0x0000000101ac2ab8 yazi`core::ptr::drop_in_place<mlua::types::value_ref::ValueRef>((null)=0x000000016fdf46c0) at mod.rs:799:1
                      frame #8: 0x0000000101ac20e0 yazi`core::ptr::drop_in_place<mlua::table::Table>((null)=0x000000016fdf46c0) at mod.rs:799:1
                      frame #9: 0x0000000101ae0afc yazi`mlua::table::Table::set_metatable(self=0x000000016fdf4b30, metatable=Option<mlua::table::Table> @ 0x000000016fdf4d10) at table.rs:515:13
                      frame #10: 0x00000001007c78fc yazi`yazi_plugin::loader::require::Require::create_mt(lua=0x000000010504ac68, id="folder-rules", mod=Table @ 0x000000016fdf5510, sync=true) at require.rs:66:6
                      frame #11: 0x0000000100976ff4 yazi`yazi_plugin::loader::require::Require::install::{{closure}}((null)=0x0000000000000001, lua=0x000000010504ac68, id=String @ 0x000000016fdf5790) at require.rs:22:5
                      frame #12: 0x0000000100b5ed50 yazi`mlua::state::Lua::create_function::{{closure}}(rawlua=0x0000000105043450, nargs=1) at state.rs:1264:13
                      frame #13: 0x0000000101ac58e0 yazi`<alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call(self=0x0000000105074380, args=(&mlua::state::raw::RawLua, i32) @ 0x000000016fdf5898) at boxed.rs:1985:9
                      frame #14: 0x0000000101abc294 yazi`mlua::state::raw::RawLua::create_callback::call_callback::{{closure}}(extra=0x000000010504ab90, nargs=1) at raw.rs:1191:39
                      frame #15: 0x0000000101acdb9c yazi`mlua::state::util::callback_error_ext::{{closure}} at util.rs:108:9
                      frame #16: 0x0000000101aa68e8 yazi`<core::panic::unwind_safe::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once(self=<unavailable>, (null)=<unavailable>) at unwind_safe.rs:272:9
                      frame #17: 0x0000000101acef1c yazi`std::panicking::catch_unwind::do_call(data=6171876320) at panicking.rs:589:40
                      frame #18: 0x0000000101a99804 yazi`__rust_try + 32
                      frame #19: 0x0000000101a92064 yazi`std::panic::catch_unwind [inlined] std::panicking::catch_unwind(f=<unavailable>) at panicking.rs:552:19
                      frame #20: 0x0000000101a92024 yazi`std::panic::catch_unwind(f=<unavailable>) at panic.rs:359:14
                      frame #21: 0x0000000101accbc8 yazi`mlua::state::util::callback_error_ext(state=0x000000010588c008, extra=0x000000010504ab90, wrap_error=true, f={closure_env#0} @ 0x000000016fdf60d0) at util.rs:105:11
                      frame #22: 0x0000000101abc0e8 yazi`mlua::state::raw::RawLua::create_callback::call_callback(state=0x000000010588c008) at raw.rs:1186:13
                      frame #23: 0x0000000101b6838c yazi`precallC(L=0x000000010588c008, func=0x0000000105894a40, nresults=1, f=0x0000000101abc044) at ldo.c:536:7
                      frame #24: 0x0000000101b68680 yazi`luaD_precall(L=0x000000010588c008, func=0x0000000105894a40, nresults=1) at ldo.c:599:7
                      frame #25: 0x0000000101b350c0 yazi`luaV_execute(L=0x000000010588c008, ci=0x000000010504ae10) at lvm.c:1685:22
                      frame #26: 0x0000000101b68a60 yazi`ccall(L=0x000000010588c008, func=0x0000000105049030, nResults=-1, inc=65537) at ldo.c:644:5
                      frame #27: 0x0000000101b68ab0 yazi`luaD_callnoyield(L=0x000000010588c008, func=0x0000000105049030, nResults=-1) at ldo.c:662:3
                      frame #28: 0x0000000101b5732c yazi`f_call(L=0x000000010588c008, ud=0x000000016fdf7208) at lapi.c:1038:3
                      frame #29: 0x0000000101b66de4 yazi`luaD_rawrunprotected(L=0x000000010588c008, f=0x0000000101b572f8, ud=0x000000016fdf7208) at ldo.c:141:3
                      frame #30: 0x0000000101b69580 yazi`luaD_pcall(L=0x000000010588c008, func=0x0000000101b572f8, u=0x000000016fdf7208, old_top=32, ef=16) at ldo.c:964:12
                      frame #31: 0x0000000101b571d0 yazi`lua_pcallk(L=0x000000010588c008, nargs=0, nresults=-1, errfunc=1, ctx=0, k=0x0000000000000000) at lapi.c:1064:14
                      frame #32: 0x0000000101aabb28 yazi`mlua::function::Function::call [inlined] mlua_sys::lua54::lua::lua_pcall(L=0x000000010588c008, n=0, r=-1, f=1) at lua.rs:278:5
                      frame #33: 0x0000000101aabb1c yazi`mlua::function::Function::call(self=0x000000016fdf7590, args=<unavailable>) at function.rs:121:23
                      frame #34: 0x0000000101ad84dc yazi`mlua::chunk::Chunk::call(self=<unavailable>, args=<unavailable>) at chunk.rs:627:31
                      frame #35: 0x0000000101ad8414 yazi`mlua::chunk::Chunk::exec(self=<unavailable>) at chunk.rs:570:14
                      frame #36: 0x0000000100b7e294 yazi`yazi_plugin::lua::stage_2(lua=0x0000000102a50038) at lua.rs:64:36
                      frame #37: 0x0000000100b7c494 yazi`yazi_plugin::lua::init_lua at lua.rs:14:2
                      frame #38: 0x000000010075cf48 yazi`yazi_plugin::init at lib.rs:9:2
                      frame #39: 0x0000000100029228 yazi`yazi::main::{{closure}}((null)=0x000000016fdf90e8) at main.rs:35:2
                      frame #40: 0x000000010019dddc yazi`tokio::runtime::park::CachedParkThread::block_on::{{closure}} at park.rs:285:71
                      frame #41: 0x000000010019d91c yazi`tokio::runtime::park::CachedParkThread::block_on [inlined] tokio::task::coop::with_budget(budget=Budget @ 0x000000016fdf997b, f={closure_env#0}<yazi::main::{async_block_env#0}> @ 0x000000016fdf9980) at mod.rs:167:5
                      frame #42: 0x000000010019d8c8 yazi`tokio::runtime::park::CachedParkThread::block_on [inlined] tokio::task::coop::budget(f={closure_env#0}<yazi::main::{async_block_env#0}> @ 0x000000016fdf9958) at mod.rs:133:5
                      frame #43: 0x000000010019d850 yazi`tokio::runtime::park::CachedParkThread::block_on(self=0x000000016fdf99ef, f={async_block_env#0} @ 0x000000016fdf99f0) at park.rs:285:31
                      frame #44: 0x00000001000e979c yazi`tokio::runtime::context::blocking::BlockingRegionGuard::block_on(self=0x000000016fdfaad0, f={async_block_env#0} @ 0x000000016fdfa240) at blocking.rs:66:14
                      frame #45: 0x0000000100029db8 yazi`tokio::runtime::scheduler::multi_thread::MultiThread::block_on::{{closure}}(blocking=0x000000016fdfaad0) at mod.rs:87:22
                      frame #46: 0x0000000100121310 yazi`tokio::runtime::context::runtime::enter_runtime(handle=0x000000016fdfe4f0, allow_block_in_place=true, f={closure_env#0}<yazi::main::{async_block_env#0}> @ 0x000000016fdfb348) at runtime.rs:65:16
                      frame #47: 0x0000000100029d0c yazi`tokio::runtime::scheduler::multi_thread::MultiThread::block_on(self=0x000000016fdfe4c8, handle=0x000000016fdfe4f0, future=<unavailable>) at mod.rs:86:9
                      frame #48: 0x000000010009b578 yazi`tokio::runtime::runtime::Runtime::block_on_inner(self=0x000000016fdfe4c0, future={async_block_env#0} @ 0x000000016fdfd468, (null)=SpawnMeta @ 0x000000016fdfcbce) at runtime.rs:358:50
                      frame #49: 0x000000010009b8dc yazi`tokio::runtime::runtime::Runtime::block_on(self=0x000000016fdfe4c0, future={async_block_env#0} @ 0x000000016fdfe640) at runtime.rs:330:18
                      frame #50: 0x00000001000ecdd0 yazi`yazi::main at main.rs:40:20
                      frame #51: 0x0000000100005d70 yazi`core::ops::function::FnOnce::call_once((null)=0x00000001000eccdc, (null)=<unavailable>) at function.rs:253:5
                      frame #52: 0x00000001000e9144 yazi`std::sys::backtrace::__rust_begin_short_backtrace(f=0x00000001000eccdc) at backtrace.rs:152:18
                      frame #53: 0x00000001000d07cc yazi`std::rt::lang_start::{{closure}} at rt.rs:206:18
                      frame #54: 0x0000000101b9a2d0 yazi`std::rt::lang_start_internal [inlined] core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once at function.rs:290:21 [opt]
                      frame #55: 0x0000000101b9a2c8 yazi`std::rt::lang_start_internal [inlined] std::panicking::catch_unwind::do_call at panicking.rs:589:40 [opt]
                      frame #56: 0x0000000101b9a2c4 yazi`std::rt::lang_start_internal [inlined] std::panicking::catch_unwind at panicking.rs:552:19 [opt]
                      frame #57: 0x0000000101b9a2c4 yazi`std::rt::lang_start_internal [inlined] std::panic::catch_unwind at panic.rs:359:14 [opt]
                      frame #58: 0x0000000101b9a2c4 yazi`std::rt::lang_start_internal [inlined] std::rt::lang_start_internal::{{closure}} at rt.rs:175:24 [opt]
                      frame #59: 0x0000000101b99dbc yazi`std::rt::lang_start_internal [inlined] std::panicking::catch_unwind::do_call at panicking.rs:589:40 [opt]
                      frame #60: 0x0000000101b99dbc yazi`std::rt::lang_start_internal [inlined] std::panicking::catch_unwind at panicking.rs:552:19 [opt]
                      frame #61: 0x0000000101b99dbc yazi`std::rt::lang_start_internal [inlined] std::panic::catch_unwind at panic.rs:359:14 [opt]
                      frame #62: 0x0000000101b99dbc yazi`std::rt::lang_start_internal at rt.rs:171:5 [opt]
                      frame #63: 0x00000001000d07a4 yazi`std::rt::lang_start(main=0x00000001000eccdc, argc=1, argv=6171914888, sigpipe=0) at rt.rs:205:5
                      frame #64: 0x00000001000ece68 yazi`main + 36
                      frame #65: 0x0000000181cebf28 dyld`start + 2236

                      Metadata

                      Metadata

                      Assignees

                      No one assigned

                        Labels

                        No labels
                        No labels

                        Type

                        No type

                        Projects

                        No projects

                          Milestone

                          No milestone

                          Relationships

                          None yet

                          Development

                          No branches or pull requests

                          Issue actions

                          , 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Remove or un-stick sticky/fixed headers that block content\n(function() {\n function unstick() {\n document.querySelectorAll('header, nav, [role=\"banner\"], .header, .navbar, .sticky, .fixed-top, [style*=\"position: fixed\"], [style*=\"position:sticky\"]').forEach(function(el) {\n if (el.style.position === 'fixed' || el.style.position === 'sticky' || \n getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') {\n el.style.position = 'static';\n el.style.top = 'auto';\n el.style.zIndex = 'auto';\n }\n });\n }\n \n unstick();\n \n var observer = new MutationObserver(unstick);\n observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] });\n})();", "Kill Sticky Headers"); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
                          Skip to content

                          Assertion failed on mlua 0.11.0 #615

                          Description

                          @sxyazi

                          First of all, congratulations on the new release, you really did an outstanding job, @khvzak! 🎉🎉

                          I'm upgrading my project to mlua 0.11.0 and encountered an error:

                          Assertion failed: ((L->top.p <= L->ci->top.p) && "stack overflow"), function lua_pushnil, file lapi.c, line 500.
                          

                          Minimal reproducer (run in debug mode):

                          use mlua::{Lua,Result,Table};fnmain() -> Result<()>{fntbl_with_mt(lua:&Lua) -> Result<Table>{let tbl = lua.create_table()?;
                          tbl.set_metatable(Some(lua.create_table()?))?;Ok(tbl)}let lua = Lua::new();let _:Vec<Table> = (0..10000).map(|_| tbl_with_mt(&lua)).collect::<Result<_>>()?;Ok(())}
                          [dependencies]
                          mlua = { version = "0.11.0", features = [ "lua54", "vendored" ] }

                          Here's the full backtrace:

                          Stop reason: hit program assert
                          > bt
                          * thread #1, name = 'main', queue = 'com.apple.main-thread', stop reason = hit program assert* frame #0: 0x000000018200c764 libsystem_kernel.dylib`__pthread_kill + 8
                          frame #1: 0x0000000182043c28 libsystem_pthread.dylib`pthread_kill + 288
                          frame #2: 0x0000000181f51ae8 libsystem_c.dylib`abort + 180
                          frame #3: 0x0000000181f50e44 libsystem_c.dylib`__assert_rtn + 272
                          frame #4: 0x0000000101b54218 yazi`lua_pushnil(L=0x0000000105048008) at lapi.c:500:3
                          frame #5: 0x0000000101ab81b0 yazi`mlua::state::raw::RawLua::drop_ref(self=0x0000000105043450, vref=0x000000016fdf46c0) at raw.rs:843:9
                          frame #6: 0x0000000101ae3164 yazi`<mlua::types::value_ref::ValueRef as core::ops::drop::Drop>::drop(self=0x000000016fdf46c0) at value_ref.rs:56:30
                          frame #7: 0x0000000101ac2ab8 yazi`core::ptr::drop_in_place<mlua::types::value_ref::ValueRef>((null)=0x000000016fdf46c0) at mod.rs:799:1
                          frame #8: 0x0000000101ac20e0 yazi`core::ptr::drop_in_place<mlua::table::Table>((null)=0x000000016fdf46c0) at mod.rs:799:1
                          frame #9: 0x0000000101ae0afc yazi`mlua::table::Table::set_metatable(self=0x000000016fdf4b30, metatable=Option<mlua::table::Table> @ 0x000000016fdf4d10) at table.rs:515:13
                          frame #10: 0x00000001007c78fc yazi`yazi_plugin::loader::require::Require::create_mt(lua=0x000000010504ac68, id="folder-rules", mod=Table @ 0x000000016fdf5510, sync=true) at require.rs:66:6
                          frame #11: 0x0000000100976ff4 yazi`yazi_plugin::loader::require::Require::install::{{closure}}((null)=0x0000000000000001, lua=0x000000010504ac68, id=String @ 0x000000016fdf5790) at require.rs:22:5
                          frame #12: 0x0000000100b5ed50 yazi`mlua::state::Lua::create_function::{{closure}}(rawlua=0x0000000105043450, nargs=1) at state.rs:1264:13
                          frame #13: 0x0000000101ac58e0 yazi`<alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call(self=0x0000000105074380, args=(&mlua::state::raw::RawLua, i32) @ 0x000000016fdf5898) at boxed.rs:1985:9
                          frame #14: 0x0000000101abc294 yazi`mlua::state::raw::RawLua::create_callback::call_callback::{{closure}}(extra=0x000000010504ab90, nargs=1) at raw.rs:1191:39
                          frame #15: 0x0000000101acdb9c yazi`mlua::state::util::callback_error_ext::{{closure}} at util.rs:108:9
                          frame #16: 0x0000000101aa68e8 yazi`<core::panic::unwind_safe::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once(self=<unavailable>, (null)=<unavailable>) at unwind_safe.rs:272:9
                          frame #17: 0x0000000101acef1c yazi`std::panicking::catch_unwind::do_call(data=6171876320) at panicking.rs:589:40
                          frame #18: 0x0000000101a99804 yazi`__rust_try + 32
                          frame #19: 0x0000000101a92064 yazi`std::panic::catch_unwind [inlined] std::panicking::catch_unwind(f=<unavailable>) at panicking.rs:552:19
                          frame #20: 0x0000000101a92024 yazi`std::panic::catch_unwind(f=<unavailable>) at panic.rs:359:14
                          frame #21: 0x0000000101accbc8 yazi`mlua::state::util::callback_error_ext(state=0x000000010588c008, extra=0x000000010504ab90, wrap_error=true, f={closure_env#0} @ 0x000000016fdf60d0) at util.rs:105:11
                          frame #22: 0x0000000101abc0e8 yazi`mlua::state::raw::RawLua::create_callback::call_callback(state=0x000000010588c008) at raw.rs:1186:13
                          frame #23: 0x0000000101b6838c yazi`precallC(L=0x000000010588c008, func=0x0000000105894a40, nresults=1, f=0x0000000101abc044) at ldo.c:536:7
                          frame #24: 0x0000000101b68680 yazi`luaD_precall(L=0x000000010588c008, func=0x0000000105894a40, nresults=1) at ldo.c:599:7
                          frame #25: 0x0000000101b350c0 yazi`luaV_execute(L=0x000000010588c008, ci=0x000000010504ae10) at lvm.c:1685:22
                          frame #26: 0x0000000101b68a60 yazi`ccall(L=0x000000010588c008, func=0x0000000105049030, nResults=-1, inc=65537) at ldo.c:644:5
                          frame #27: 0x0000000101b68ab0 yazi`luaD_callnoyield(L=0x000000010588c008, func=0x0000000105049030, nResults=-1) at ldo.c:662:3
                          frame #28: 0x0000000101b5732c yazi`f_call(L=0x000000010588c008, ud=0x000000016fdf7208) at lapi.c:1038:3
                          frame #29: 0x0000000101b66de4 yazi`luaD_rawrunprotected(L=0x000000010588c008, f=0x0000000101b572f8, ud=0x000000016fdf7208) at ldo.c:141:3
                          frame #30: 0x0000000101b69580 yazi`luaD_pcall(L=0x000000010588c008, func=0x0000000101b572f8, u=0x000000016fdf7208, old_top=32, ef=16) at ldo.c:964:12
                          frame #31: 0x0000000101b571d0 yazi`lua_pcallk(L=0x000000010588c008, nargs=0, nresults=-1, errfunc=1, ctx=0, k=0x0000000000000000) at lapi.c:1064:14
                          frame #32: 0x0000000101aabb28 yazi`mlua::function::Function::call [inlined] mlua_sys::lua54::lua::lua_pcall(L=0x000000010588c008, n=0, r=-1, f=1) at lua.rs:278:5
                          frame #33: 0x0000000101aabb1c yazi`mlua::function::Function::call(self=0x000000016fdf7590, args=<unavailable>) at function.rs:121:23
                          frame #34: 0x0000000101ad84dc yazi`mlua::chunk::Chunk::call(self=<unavailable>, args=<unavailable>) at chunk.rs:627:31
                          frame #35: 0x0000000101ad8414 yazi`mlua::chunk::Chunk::exec(self=<unavailable>) at chunk.rs:570:14
                          frame #36: 0x0000000100b7e294 yazi`yazi_plugin::lua::stage_2(lua=0x0000000102a50038) at lua.rs:64:36
                          frame #37: 0x0000000100b7c494 yazi`yazi_plugin::lua::init_lua at lua.rs:14:2
                          frame #38: 0x000000010075cf48 yazi`yazi_plugin::init at lib.rs:9:2
                          frame #39: 0x0000000100029228 yazi`yazi::main::{{closure}}((null)=0x000000016fdf90e8) at main.rs:35:2
                          frame #40: 0x000000010019dddc yazi`tokio::runtime::park::CachedParkThread::block_on::{{closure}} at park.rs:285:71
                          frame #41: 0x000000010019d91c yazi`tokio::runtime::park::CachedParkThread::block_on [inlined] tokio::task::coop::with_budget(budget=Budget @ 0x000000016fdf997b, f={closure_env#0}<yazi::main::{async_block_env#0}> @ 0x000000016fdf9980) at mod.rs:167:5
                          frame #42: 0x000000010019d8c8 yazi`tokio::runtime::park::CachedParkThread::block_on [inlined] tokio::task::coop::budget(f={closure_env#0}<yazi::main::{async_block_env#0}> @ 0x000000016fdf9958) at mod.rs:133:5
                          frame #43: 0x000000010019d850 yazi`tokio::runtime::park::CachedParkThread::block_on(self=0x000000016fdf99ef, f={async_block_env#0} @ 0x000000016fdf99f0) at park.rs:285:31
                          frame #44: 0x00000001000e979c yazi`tokio::runtime::context::blocking::BlockingRegionGuard::block_on(self=0x000000016fdfaad0, f={async_block_env#0} @ 0x000000016fdfa240) at blocking.rs:66:14
                          frame #45: 0x0000000100029db8 yazi`tokio::runtime::scheduler::multi_thread::MultiThread::block_on::{{closure}}(blocking=0x000000016fdfaad0) at mod.rs:87:22
                          frame #46: 0x0000000100121310 yazi`tokio::runtime::context::runtime::enter_runtime(handle=0x000000016fdfe4f0, allow_block_in_place=true, f={closure_env#0}<yazi::main::{async_block_env#0}> @ 0x000000016fdfb348) at runtime.rs:65:16
                          frame #47: 0x0000000100029d0c yazi`tokio::runtime::scheduler::multi_thread::MultiThread::block_on(self=0x000000016fdfe4c8, handle=0x000000016fdfe4f0, future=<unavailable>) at mod.rs:86:9
                          frame #48: 0x000000010009b578 yazi`tokio::runtime::runtime::Runtime::block_on_inner(self=0x000000016fdfe4c0, future={async_block_env#0} @ 0x000000016fdfd468, (null)=SpawnMeta @ 0x000000016fdfcbce) at runtime.rs:358:50
                          frame #49: 0x000000010009b8dc yazi`tokio::runtime::runtime::Runtime::block_on(self=0x000000016fdfe4c0, future={async_block_env#0} @ 0x000000016fdfe640) at runtime.rs:330:18
                          frame #50: 0x00000001000ecdd0 yazi`yazi::main at main.rs:40:20
                          frame #51: 0x0000000100005d70 yazi`core::ops::function::FnOnce::call_once((null)=0x00000001000eccdc, (null)=<unavailable>) at function.rs:253:5
                          frame #52: 0x00000001000e9144 yazi`std::sys::backtrace::__rust_begin_short_backtrace(f=0x00000001000eccdc) at backtrace.rs:152:18
                          frame #53: 0x00000001000d07cc yazi`std::rt::lang_start::{{closure}} at rt.rs:206:18
                          frame #54: 0x0000000101b9a2d0 yazi`std::rt::lang_start_internal [inlined] core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once at function.rs:290:21 [opt]
                          frame #55: 0x0000000101b9a2c8 yazi`std::rt::lang_start_internal [inlined] std::panicking::catch_unwind::do_call at panicking.rs:589:40 [opt]
                          frame #56: 0x0000000101b9a2c4 yazi`std::rt::lang_start_internal [inlined] std::panicking::catch_unwind at panicking.rs:552:19 [opt]
                          frame #57: 0x0000000101b9a2c4 yazi`std::rt::lang_start_internal [inlined] std::panic::catch_unwind at panic.rs:359:14 [opt]
                          frame #58: 0x0000000101b9a2c4 yazi`std::rt::lang_start_internal [inlined] std::rt::lang_start_internal::{{closure}} at rt.rs:175:24 [opt]
                          frame #59: 0x0000000101b99dbc yazi`std::rt::lang_start_internal [inlined] std::panicking::catch_unwind::do_call at panicking.rs:589:40 [opt]
                          frame #60: 0x0000000101b99dbc yazi`std::rt::lang_start_internal [inlined] std::panicking::catch_unwind at panicking.rs:552:19 [opt]
                          frame #61: 0x0000000101b99dbc yazi`std::rt::lang_start_internal [inlined] std::panic::catch_unwind at panic.rs:359:14 [opt]
                          frame #62: 0x0000000101b99dbc yazi`std::rt::lang_start_internal at rt.rs:171:5 [opt]
                          frame #63: 0x00000001000d07a4 yazi`std::rt::lang_start(main=0x00000001000eccdc, argc=1, argv=6171914888, sigpipe=0) at rt.rs:205:5
                          frame #64: 0x00000001000ece68 yazi`main + 36
                          frame #65: 0x0000000181cebf28 dyld`start + 2236

                          Metadata

                          Metadata

                          Assignees

                          No one assigned

                            Labels

                            No labels
                            No labels

                            Type

                            No type

                            Projects

                            No projects

                              Milestone

                              No milestone

                              Relationships

                              None yet

                              Development

                              No branches or pull requests

                              Issue actions

                              , 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Universal Dark Mode - works on any site\n(function() {\n var enabled = true;\n \n function applyDarkMode() {\n if (!enabled) return;\n \n // Create style element if it doesn't exist\n var style = document.getElementById('universal-dark-mode-style');\n if (!style) {\n style = document.createElement('style');\n style.id = 'universal-dark-mode-style';\n document.head.appendChild(style);\n }\n \n // Dark mode CSS - inverts colors but preserves images/video\n style.textContent = '\n /* Invert everything except media */\n html {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #1a1a2e !important;\n }\n \n /* Restore images, videos, iframes, canvas */\n img, video, iframe, canvas, svg, picture, [style*=\"background-image\"] {\n filter: invert(1) hue-rotate(180deg) !important;\n }\n \n /* Preserve specific elements that should not be inverted */\n .no-dark-mode, .no-dark-mode *,\n [data-theme=\"light\"], [data-theme=\"light\"],\n .ace_editor, .ace_editor *,\n .CodeMirror, .CodeMirror *,\n .monaco-editor, .monaco-editor *,\n .markdown-body pre, .markdown-body pre *,\n .highlight, .highlight *,\n pre code, pre code * {\n filter: none !important;\n }\n \n /* Fix common UI elements */\n .modal, .popup, .dropdown-menu, .tooltip, .popover {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #2d2d44 !important;\n border-color: #444 !important;\n }\n \n /* Scrollbars */\n ::-webkit-scrollbar { background: #1a1a2e !important; }\n ::-webkit-scrollbar-thumb { background: #444 !important; }\n ::-webkit-scrollbar-thumb:hover { background: #555 !important; }\n \n /* Selection */\n ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ';\n }\n \n function removeDarkMode() {\n var style = document.getElementById('universal-dark-mode-style');\n if (style) style.remove();\n }\n \n // Toggle with Alt+Shift+D\n document.addEventListener('keydown', function(e) {\n if (e.altKey && e.shiftKey && e.key === 'D') {\n e.preventDefault();\n enabled = !enabled;\n if (enabled) {\n applyDarkMode();\n console.log('[Universal Dark Mode] Enabled');\n } else {\n removeDarkMode();\n console.log('[Universal Dark Mode] Disabled');\n }\n }\n });\n \n // Apply on load\n applyDarkMode();\n \n // Re-apply on dynamic content\n var observer = new MutationObserver(function(mutations) {\n if (enabled && !document.getElementById('universal-dark-mode-style')) {\n applyDarkMode();\n }\n });\n observer.observe(document.head, { childList: true });\n \n console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle');\n})();", "Universal Dark Mode"); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })();
                              Skip to content

                              Assertion failed on mlua 0.11.0 #615

                              Description

                              @sxyazi

                              First of all, congratulations on the new release, you really did an outstanding job, @khvzak! 🎉🎉

                              I'm upgrading my project to mlua 0.11.0 and encountered an error:

                              Assertion failed: ((L->top.p <= L->ci->top.p) && "stack overflow"), function lua_pushnil, file lapi.c, line 500.
                              

                              Minimal reproducer (run in debug mode):

                              use mlua::{Lua,Result,Table};fnmain() -> Result<()>{fntbl_with_mt(lua:&Lua) -> Result<Table>{let tbl = lua.create_table()?;
                              tbl.set_metatable(Some(lua.create_table()?))?;Ok(tbl)}let lua = Lua::new();let _:Vec<Table> = (0..10000).map(|_| tbl_with_mt(&lua)).collect::<Result<_>>()?;Ok(())}
                              [dependencies]
                              mlua = { version = "0.11.0", features = [ "lua54", "vendored" ] }

                              Here's the full backtrace:

                              Stop reason: hit program assert
                              > bt
                              * thread #1, name = 'main', queue = 'com.apple.main-thread', stop reason = hit program assert* frame #0: 0x000000018200c764 libsystem_kernel.dylib`__pthread_kill + 8
                              frame #1: 0x0000000182043c28 libsystem_pthread.dylib`pthread_kill + 288
                              frame #2: 0x0000000181f51ae8 libsystem_c.dylib`abort + 180
                              frame #3: 0x0000000181f50e44 libsystem_c.dylib`__assert_rtn + 272
                              frame #4: 0x0000000101b54218 yazi`lua_pushnil(L=0x0000000105048008) at lapi.c:500:3
                              frame #5: 0x0000000101ab81b0 yazi`mlua::state::raw::RawLua::drop_ref(self=0x0000000105043450, vref=0x000000016fdf46c0) at raw.rs:843:9
                              frame #6: 0x0000000101ae3164 yazi`<mlua::types::value_ref::ValueRef as core::ops::drop::Drop>::drop(self=0x000000016fdf46c0) at value_ref.rs:56:30
                              frame #7: 0x0000000101ac2ab8 yazi`core::ptr::drop_in_place<mlua::types::value_ref::ValueRef>((null)=0x000000016fdf46c0) at mod.rs:799:1
                              frame #8: 0x0000000101ac20e0 yazi`core::ptr::drop_in_place<mlua::table::Table>((null)=0x000000016fdf46c0) at mod.rs:799:1
                              frame #9: 0x0000000101ae0afc yazi`mlua::table::Table::set_metatable(self=0x000000016fdf4b30, metatable=Option<mlua::table::Table> @ 0x000000016fdf4d10) at table.rs:515:13
                              frame #10: 0x00000001007c78fc yazi`yazi_plugin::loader::require::Require::create_mt(lua=0x000000010504ac68, id="folder-rules", mod=Table @ 0x000000016fdf5510, sync=true) at require.rs:66:6
                              frame #11: 0x0000000100976ff4 yazi`yazi_plugin::loader::require::Require::install::{{closure}}((null)=0x0000000000000001, lua=0x000000010504ac68, id=String @ 0x000000016fdf5790) at require.rs:22:5
                              frame #12: 0x0000000100b5ed50 yazi`mlua::state::Lua::create_function::{{closure}}(rawlua=0x0000000105043450, nargs=1) at state.rs:1264:13
                              frame #13: 0x0000000101ac58e0 yazi`<alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call(self=0x0000000105074380, args=(&mlua::state::raw::RawLua, i32) @ 0x000000016fdf5898) at boxed.rs:1985:9
                              frame #14: 0x0000000101abc294 yazi`mlua::state::raw::RawLua::create_callback::call_callback::{{closure}}(extra=0x000000010504ab90, nargs=1) at raw.rs:1191:39
                              frame #15: 0x0000000101acdb9c yazi`mlua::state::util::callback_error_ext::{{closure}} at util.rs:108:9
                              frame #16: 0x0000000101aa68e8 yazi`<core::panic::unwind_safe::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once(self=<unavailable>, (null)=<unavailable>) at unwind_safe.rs:272:9
                              frame #17: 0x0000000101acef1c yazi`std::panicking::catch_unwind::do_call(data=6171876320) at panicking.rs:589:40
                              frame #18: 0x0000000101a99804 yazi`__rust_try + 32
                              frame #19: 0x0000000101a92064 yazi`std::panic::catch_unwind [inlined] std::panicking::catch_unwind(f=<unavailable>) at panicking.rs:552:19
                              frame #20: 0x0000000101a92024 yazi`std::panic::catch_unwind(f=<unavailable>) at panic.rs:359:14
                              frame #21: 0x0000000101accbc8 yazi`mlua::state::util::callback_error_ext(state=0x000000010588c008, extra=0x000000010504ab90, wrap_error=true, f={closure_env#0} @ 0x000000016fdf60d0) at util.rs:105:11
                              frame #22: 0x0000000101abc0e8 yazi`mlua::state::raw::RawLua::create_callback::call_callback(state=0x000000010588c008) at raw.rs:1186:13
                              frame #23: 0x0000000101b6838c yazi`precallC(L=0x000000010588c008, func=0x0000000105894a40, nresults=1, f=0x0000000101abc044) at ldo.c:536:7
                              frame #24: 0x0000000101b68680 yazi`luaD_precall(L=0x000000010588c008, func=0x0000000105894a40, nresults=1) at ldo.c:599:7
                              frame #25: 0x0000000101b350c0 yazi`luaV_execute(L=0x000000010588c008, ci=0x000000010504ae10) at lvm.c:1685:22
                              frame #26: 0x0000000101b68a60 yazi`ccall(L=0x000000010588c008, func=0x0000000105049030, nResults=-1, inc=65537) at ldo.c:644:5
                              frame #27: 0x0000000101b68ab0 yazi`luaD_callnoyield(L=0x000000010588c008, func=0x0000000105049030, nResults=-1) at ldo.c:662:3
                              frame #28: 0x0000000101b5732c yazi`f_call(L=0x000000010588c008, ud=0x000000016fdf7208) at lapi.c:1038:3
                              frame #29: 0x0000000101b66de4 yazi`luaD_rawrunprotected(L=0x000000010588c008, f=0x0000000101b572f8, ud=0x000000016fdf7208) at ldo.c:141:3
                              frame #30: 0x0000000101b69580 yazi`luaD_pcall(L=0x000000010588c008, func=0x0000000101b572f8, u=0x000000016fdf7208, old_top=32, ef=16) at ldo.c:964:12
                              frame #31: 0x0000000101b571d0 yazi`lua_pcallk(L=0x000000010588c008, nargs=0, nresults=-1, errfunc=1, ctx=0, k=0x0000000000000000) at lapi.c:1064:14
                              frame #32: 0x0000000101aabb28 yazi`mlua::function::Function::call [inlined] mlua_sys::lua54::lua::lua_pcall(L=0x000000010588c008, n=0, r=-1, f=1) at lua.rs:278:5
                              frame #33: 0x0000000101aabb1c yazi`mlua::function::Function::call(self=0x000000016fdf7590, args=<unavailable>) at function.rs:121:23
                              frame #34: 0x0000000101ad84dc yazi`mlua::chunk::Chunk::call(self=<unavailable>, args=<unavailable>) at chunk.rs:627:31
                              frame #35: 0x0000000101ad8414 yazi`mlua::chunk::Chunk::exec(self=<unavailable>) at chunk.rs:570:14
                              frame #36: 0x0000000100b7e294 yazi`yazi_plugin::lua::stage_2(lua=0x0000000102a50038) at lua.rs:64:36
                              frame #37: 0x0000000100b7c494 yazi`yazi_plugin::lua::init_lua at lua.rs:14:2
                              frame #38: 0x000000010075cf48 yazi`yazi_plugin::init at lib.rs:9:2
                              frame #39: 0x0000000100029228 yazi`yazi::main::{{closure}}((null)=0x000000016fdf90e8) at main.rs:35:2
                              frame #40: 0x000000010019dddc yazi`tokio::runtime::park::CachedParkThread::block_on::{{closure}} at park.rs:285:71
                              frame #41: 0x000000010019d91c yazi`tokio::runtime::park::CachedParkThread::block_on [inlined] tokio::task::coop::with_budget(budget=Budget @ 0x000000016fdf997b, f={closure_env#0}<yazi::main::{async_block_env#0}> @ 0x000000016fdf9980) at mod.rs:167:5
                              frame #42: 0x000000010019d8c8 yazi`tokio::runtime::park::CachedParkThread::block_on [inlined] tokio::task::coop::budget(f={closure_env#0}<yazi::main::{async_block_env#0}> @ 0x000000016fdf9958) at mod.rs:133:5
                              frame #43: 0x000000010019d850 yazi`tokio::runtime::park::CachedParkThread::block_on(self=0x000000016fdf99ef, f={async_block_env#0} @ 0x000000016fdf99f0) at park.rs:285:31
                              frame #44: 0x00000001000e979c yazi`tokio::runtime::context::blocking::BlockingRegionGuard::block_on(self=0x000000016fdfaad0, f={async_block_env#0} @ 0x000000016fdfa240) at blocking.rs:66:14
                              frame #45: 0x0000000100029db8 yazi`tokio::runtime::scheduler::multi_thread::MultiThread::block_on::{{closure}}(blocking=0x000000016fdfaad0) at mod.rs:87:22
                              frame #46: 0x0000000100121310 yazi`tokio::runtime::context::runtime::enter_runtime(handle=0x000000016fdfe4f0, allow_block_in_place=true, f={closure_env#0}<yazi::main::{async_block_env#0}> @ 0x000000016fdfb348) at runtime.rs:65:16
                              frame #47: 0x0000000100029d0c yazi`tokio::runtime::scheduler::multi_thread::MultiThread::block_on(self=0x000000016fdfe4c8, handle=0x000000016fdfe4f0, future=<unavailable>) at mod.rs:86:9
                              frame #48: 0x000000010009b578 yazi`tokio::runtime::runtime::Runtime::block_on_inner(self=0x000000016fdfe4c0, future={async_block_env#0} @ 0x000000016fdfd468, (null)=SpawnMeta @ 0x000000016fdfcbce) at runtime.rs:358:50
                              frame #49: 0x000000010009b8dc yazi`tokio::runtime::runtime::Runtime::block_on(self=0x000000016fdfe4c0, future={async_block_env#0} @ 0x000000016fdfe640) at runtime.rs:330:18
                              frame #50: 0x00000001000ecdd0 yazi`yazi::main at main.rs:40:20
                              frame #51: 0x0000000100005d70 yazi`core::ops::function::FnOnce::call_once((null)=0x00000001000eccdc, (null)=<unavailable>) at function.rs:253:5
                              frame #52: 0x00000001000e9144 yazi`std::sys::backtrace::__rust_begin_short_backtrace(f=0x00000001000eccdc) at backtrace.rs:152:18
                              frame #53: 0x00000001000d07cc yazi`std::rt::lang_start::{{closure}} at rt.rs:206:18
                              frame #54: 0x0000000101b9a2d0 yazi`std::rt::lang_start_internal [inlined] core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once at function.rs:290:21 [opt]
                              frame #55: 0x0000000101b9a2c8 yazi`std::rt::lang_start_internal [inlined] std::panicking::catch_unwind::do_call at panicking.rs:589:40 [opt]
                              frame #56: 0x0000000101b9a2c4 yazi`std::rt::lang_start_internal [inlined] std::panicking::catch_unwind at panicking.rs:552:19 [opt]
                              frame #57: 0x0000000101b9a2c4 yazi`std::rt::lang_start_internal [inlined] std::panic::catch_unwind at panic.rs:359:14 [opt]
                              frame #58: 0x0000000101b9a2c4 yazi`std::rt::lang_start_internal [inlined] std::rt::lang_start_internal::{{closure}} at rt.rs:175:24 [opt]
                              frame #59: 0x0000000101b99dbc yazi`std::rt::lang_start_internal [inlined] std::panicking::catch_unwind::do_call at panicking.rs:589:40 [opt]
                              frame #60: 0x0000000101b99dbc yazi`std::rt::lang_start_internal [inlined] std::panicking::catch_unwind at panicking.rs:552:19 [opt]
                              frame #61: 0x0000000101b99dbc yazi`std::rt::lang_start_internal [inlined] std::panic::catch_unwind at panic.rs:359:14 [opt]
                              frame #62: 0x0000000101b99dbc yazi`std::rt::lang_start_internal at rt.rs:171:5 [opt]
                              frame #63: 0x00000001000d07a4 yazi`std::rt::lang_start(main=0x00000001000eccdc, argc=1, argv=6171914888, sigpipe=0) at rt.rs:205:5
                              frame #64: 0x00000001000ece68 yazi`main + 36
                              frame #65: 0x0000000181cebf28 dyld`start + 2236

                              Metadata

                              Metadata

                              Assignees

                              No one assigned

                                Labels

                                No labels
                                No labels

                                Type

                                No type

                                Projects

                                No projects

                                  Milestone

                                  No milestone

                                  Relationships

                                  None yet

                                  Development

                                  No branches or pull requests

                                  Issue actions