zed-industries / zed

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
https://zed.dev
Other
50.45k stars 3.12k forks source link

Panic reports for dropping tasks from spawn_local on a different thread #21020

Closed mgsloan closed 11 hours ago

mgsloan commented 12 hours ago

Check for existing issues

Describe the bug / provide steps to reproduce it

Unknown repro steps. Panic reports look like:

Version: remote-server-0.162.1
OS: Linux Headless ubuntu 24.04
local task dropped by a thread that didn't spawn it
core::panicking::panic_fmt
async_task::raw::RawTask[F,T,S,M](https://app.slack.com/client/T04S308G3PX/F,T,S,M)::drop_future
gpui::platform::linux::dispatcher::LinuxDispatcher as gpui::platform::PlatformDispatcher::dispatch_on_main_thread
async_task::raw::RawTask[F,T,S,M](https://app.slack.com/client/T04S308G3PX/F,T,S,M)::wake
async_io::reactor::ReactorLock::react
std::sys::backtrace::__rust_begin_short_backtrace
core::ops::function::FnOnce::call_once{{vtable.shim}}
std::sys::pal::unix::thread::Thread::new::thread_start

Environment

N/A

If applicable, add mockups / screenshots to help explain present your vision of the feature

No response

If applicable, attach your Zed.log file to this issue.

No response

mgsloan commented 12 hours ago

If investigating a future such issue then having a variant of spawn_local which reports source location in these may be helpful. I've put this on https://github.com/zed-industries/zed/tree/spawn-local-with-source-location