You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi! I'm upgrading the mlua version of Yazi from 0.9.9 to 0.10.0. It compiles fine now, but I'm getting random panics at runtime:
The application panicked(crashed).mlua internal error:1 too many stack values popped(this is a bug, please file an issue)
in rust:library/core/src/ptr/mod.rs, line 574
thread: tokio-runtime-worker
Here's the stack trace:
File"/Users/alice/.cargo/registry/src/index.crates.io-6f17d22bba15001f/mlua-0.10.0/src/macros.rs", line 27,in <mlua::util::StackGuardas core::ops::drop::Drop>::drop
panic!(bug_msg!($msg), $($arg),+)File"rust:library/core/src/ptr/mod.rs", line 574,in core::ptr::drop_in_place<mlua::util::StackGuard>
File"/Users/alice/.cargo/registry/src/index.crates.io-6f17d22bba15001f/mlua-0.10.0/src/state/raw.rs", line 987,in mlua::state::raw::RawLua::push_userdata_metatable
}File"/Users/alice/.cargo/registry/src/index.crates.io-6f17d22bba15001f/mlua-0.10.0/src/state/raw.rs", line 818,in mlua::state::raw::RawLua::create_userdata_metatableself.push_userdata_metatable(registry)?;File"/Users/alice/.cargo/registry/src/index.crates.io-6f17d22bba15001f/mlua-0.10.0/src/state/raw.rs", line 758,in mlua::state::raw::RawLua::make_userdata::{{closure}}self.create_userdata_metatable(registry)File"/Users/alice/.cargo/registry/src/index.crates.io-6f17d22bba15001f/mlua-0.10.0/src/state/raw.rs", line 790,in mlua::state::raw::RawLua::make_userdata_with_metatable
ffi::lua_rawgeti(state, ffi::LUA_REGISTRYINDEX,get_metatable_id()?);File"/Users/alice/.cargo/registry/src/index.crates.io-6f17d22bba15001f/mlua-0.10.0/src/state/raw.rs", line 747,in mlua::state::raw::RawLua::make_userdataself.make_userdata_with_metatable(data, || {File"/Users/alice/.cargo/registry/src/index.crates.io-6f17d22bba15001f/mlua-0.10.0/src/state.rs", line 1255,in mlua::state::Lua::create_userdataunsafe{self.lock().make_userdata(UserDataStorage::new(data))}File"/Users/alice/.cargo/registry/src/index.crates.io-6f17d22bba15001f/mlua-0.10.0/src/conversion.rs", line 233, in mlua::conversion::<impl mlua::traits::IntoLuaforT>::into_luaOk(Value::UserData(lua.create_userdata(self)?))File"/Users/alice/.cargo/registry/src/index.crates.io-6f17d22bba15001f/mlua-0.10.0/src/traits.rs", line 28, in mlua::traits::IntoLua::push_into_stack
lua.push_value(&self.into_lua(lua.lua())?)File"/Users/alice/.cargo/registry/src/index.crates.io-6f17d22bba15001f/mlua-0.10.0/src/table.rs", line 256, in mlua::table::Table::raw_set
value.push_into_stack(&lua)?;File"/Users/alice/Desktop/yazi/yazi-plugin/src/isolate/peek.rs", line 49, in yazi_plugin::isolate::peek::peek::{{closure}}::{{closure}}
plugin.raw_set("window",Window::default())?;File"/Users/alice/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.41.0/src/macros/select.rs", line 557, in yazi_plugin::isolate::peek::peek::{{closure}}::{{closure}}::{{closure}}
let out = matchFuture::poll(fut, cx){File"rust:library/core/src/future/poll_fn.rs",line151,in<core::future::poll_fn::PollFn<F>as core::future::future::Future>::pollFile"/Users/alice/Desktop/yazi/yazi-plugin/src/isolate/peek.rs", line 55,in yazi_plugin::isolate::peek::peek::{{closure}}::{{closure}}
select! {File"/Users/alice/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.41.0/src/runtime/park.rs", line 281, in tokio::runtime::park::CachedParkThread::block_on::{{closure}}ifletReady(v) = crate::runtime::coop::budget(|| f.as_mut().poll(&mut cx)){File"/Users/alice/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.41.0/src/runtime/coop.rs", line 107, in tokio::runtime::coop::with_budget
f()File"/Users/alice/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.41.0/src/runtime/coop.rs", line 73, in tokio::runtime::coop::budget
with_budget(Budget::initial(), f)File"/Users/alice/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.41.0/src/runtime/park.rs", line 281, in tokio::runtime::park::CachedParkThread::block_on
ifletReady(v) = crate::runtime::coop::budget(|| f.as_mut().poll(&mut cx)){File"/Users/alice/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.41.0/src/runtime/context/blocking.rs", line 66, in tokio::runtime::context::blocking::BlockingRegionGuard::block_on
park.block_on(f)File"/Users/alice/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.41.0/src/runtime/handle.rs", line 327, in tokio::runtime::handle::Handle::block_on_inner::{{closure}}
blocking.block_on(future).expect("failed to park thread")File"/Users/alice/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.41.0/src/runtime/context/runtime.rs", line 65, in tokio::runtime::context::runtime::enter_runtime
return f(&mut guard.blocking);
File"/Users/alice/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.41.0/src/runtime/handle.rs", line 326, in tokio::runtime::handle::Handle::block_on_inner
context::enter_runtime(&self.inner, true, |blocking| {File"/Users/alice/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.41.0/src/runtime/handle.rs", line 305, in tokio::runtime::handle::Handle::block_on
self.block_on_inner(future, SpawnMeta::new_unnamed(fut_size))File"/Users/alice/Desktop/yazi/yazi-plugin/src/isolate/peek.rs", line 54, in yazi_plugin::isolate::peek::peek::{{closure}}let result = Handle::current().block_on(async{File"/Users/alice/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.41.0/src/runtime/blocking/task.rs", line 42, in <tokio::runtime::blocking::task::BlockingTask<T> as core::future::future::Future>::poll
Poll::Ready(func())File"/Users/alice/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.41.0/src/runtime/task/core.rs", line 331, in tokio::runtime::task::core::Core<T,S>::poll::{{closure}}
future.poll(&mut cx)File"/Users/alice/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.41.0/src/loom/std/unsafe_cell.rs", line 16, in tokio::loom::std::unsafe_cell::UnsafeCell<T>::with_mut
f(self.0.get())File"/Users/alice/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.41.0/src/runtime/task/core.rs", line 320, in tokio::runtime::task::core::Core<T,S>::poll
self.stage.stage.with_mut(|ptr| {File"/Users/alice/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.41.0/src/runtime/task/harness.rs", line 499, in tokio::runtime::task::harness::poll_future::{{closure}}let res = guard.core.poll(cx);
File"rust:library/core/src/panic/unwind_safe.rs", line 272, in <core::panic::unwind_safe::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once
File"rust:library/std/src/panicking.rs", line 557, in std::panicking::try::do_call
File"<unknown>", line 0, in ___rust_try
File"rust:library/std/src/panicking.rs", line 520, in std::panicking::try
File"rust:library/std/src/panic.rs", line 348, in std::panic::catch_unwind
File"/Users/alice/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.41.0/src/runtime/task/harness.rs", line 487, in tokio::runtime::task::harness::poll_future
let output = panic::catch_unwind(panic::AssertUnwindSafe(|| {File"/Users/alice/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.41.0/src/runtime/task/harness.rs", line 209, in tokio::runtime::task::harness::Harness<T,S>::poll_inner
let res = poll_future(self.core(), cx);
File"/Users/alice/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.41.0/src/runtime/task/harness.rs", line 154, in tokio::runtime::task::harness::Harness<T,S>::poll
matchself.poll_inner(){File"/Users/alice/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.41.0/src/runtime/task/raw.rs", line 271, in tokio::runtime::task::raw::poll
harness.poll();
File"/Users/alice/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.41.0/src/runtime/task/raw.rs", line 201, in tokio::runtime::task::raw::RawTask::poll
unsafe{(vtable.poll)(self.ptr)}File"/Users/alice/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.41.0/src/runtime/task/mod.rs", line 472, in tokio::runtime::task::UnownedTask<S>::run
raw.poll();
File"/Users/alice/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.41.0/src/runtime/blocking/pool.rs", line 161, in tokio::runtime::blocking::pool::Task::run
self.task.run();
File"/Users/alice/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.41.0/src/runtime/blocking/pool.rs", line 511, in tokio::runtime::blocking::pool::Inner::run
task.run();
File"/Users/alice/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.41.0/src/runtime/blocking/pool.rs", line 469, in tokio::runtime::blocking::pool::Spawner::spawn_thread::{{closure}}
rt.inner.blocking_spawner().inner.run(id);
File"rust:library/std/src/sys/backtrace.rs", line 154, in std::sys::backtrace::__rust_begin_short_backtrace
File"rust:library/std/src/thread/mod.rs", line 522, in std::thread::Builder::spawn_unchecked_::{{closure}}::{{closure}}File"rust:library/core/src/panic/unwind_safe.rs", line 272, in <core::panic::unwind_safe::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once
File"rust:library/std/src/panicking.rs", line 557, in std::panicking::try::do_call
File"<unknown>", line 0, in ___rust_try
File"rust:library/std/src/panicking.rs", line 520, in std::panicking::try
File"rust:library/std/src/panic.rs", line 348, in std::panic::catch_unwind
File"rust:library/std/src/thread/mod.rs", line 521, in std::thread::Builder::spawn_unchecked_::{{closure}}File"rust:library/core/src/ops/function.rs", line 250, in core::ops::function::FnOnce::call_once{{vtable.shim}}File"rust:library/alloc/src/boxed.rs", line 2453, in <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
File"rust:library/alloc/src/boxed.rs", line 2453, in <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
File"rust:library/std/src/sys/pal/unix/thread.rs", line 105, in std::sys::pal::unix::thread::Thread::new::thread_start
File"<unknown>", line 0, in __pthread_joiner_wake
Hi! I'm upgrading the mlua version of Yazi from 0.9.9 to 0.10.0. It compiles fine now, but I'm getting random panics at runtime:
Here's the stack trace:
In my case, I'm using
tokio::task::spawn_blocking()
to concurrently create multiple Lua 5.4 instances to do some time-consuming operations, and this error occurs when setting userdata for a table:The
Window
struct is a normal structure that implementsUserData
:This issue comes up really randomly, and I've tried for a long time to create a minimal reproduction for it, but no luck :(
I think it might be related to
set_hook()
, after I commented out the following code no more panicking again:The text was updated successfully, but these errors were encountered: