Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Zed main branch build windows crash #8825

Closed
1 task done
JunkuiZhang opened this issue Mar 4, 2024 · 4 comments · Fixed by #8924
Closed
1 task done

Zed main branch build windows crash #8825

JunkuiZhang opened this issue Mar 4, 2024 · 4 comments · Fixed by #8924
Labels
defect [core label] open source Open source community projects, contributions, etc panic / crash [core label] windows

Comments

@JunkuiZhang
Copy link
Contributor

Check for existing issues

  • Completed

Describe the bug / provide steps to reproduce it

Just clone main branch, run cargo run
It complains could not find conPTY, which is definetely there since I am using Windows11

Environment

Windows 11 SImplified Chinese version

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

No response

If applicable, attach your ~/Library/Logs/Zed/Zed.log file to this issue.

If you only need the most recent lines, you can run the zed: open log command palette action to see the last 1000.

[2024-03-04T21:31:40+08:00 ERROR fs] watch path does not exist: C:\Users\36477.config\zed\keymap.json
[2024-03-04T21:31:43+08:00 ERROR util] crates\zed\src/zed.rs:580: EOF while parsing a value at line 1 column 0
[2024-03-04T21:31:43+08:00 ERROR util] crates\zed\src/main.rs:718: 系统找不到指定的路径。 (os error 3)
[2024-03-04T21:31:43+08:00 ERROR fs] watch path does not exist: crates/zed/src/languages
[2024-03-04T21:31:43+08:00 ERROR fs] watch path does not exist: assets/icons/file_icons/file_types.json
[2024-03-04T21:31:44+08:00 ERROR util] crates\fs\src\repository.rs:101: Error { code: -9, klass: 4, message: "reference 'refs/heads/master' not found" }
[2024-03-04T21:31:46+08:00 ERROR fs] watch path does not exist: C:\Users\36477.config\zed\tasks.json
Thread "main" panicked with "Unable to spawn shell: 文件名、目录名或卷标语法不正确。 (os error 123)" at C:\Users\36477.cargo\registry\src\index.crates.io-6f17d22bba15001f\alacritty_terminal-0.22.0\src\tty\windows\conpty.rs:235:5
0: backtrace::backtrace::dbghelp::trace
at C:\Users\36477.cargo\registry\src\index.crates.io-6f17d22bba15001f\backtrace-0.3.69\src\backtrace\dbghelp.rs:98
1: backtrace::backtrace::trace_unsynchronizedbacktrace::capture::impl$1::create::closure_env$0
at C:\Users\36477.cargo\registry\src\index.crates.io-6f17d22bba15001f\backtrace-0.3.69\src\backtrace\mod.rs:66
2: backtrace::backtrace::tracebacktrace::capture::impl$1::create::closure_env$0
at C:\Users\36477.cargo\registry\src\index.crates.io-6f17d22bba15001f\backtrace-0.3.69\src\backtrace\mod.rs:53
3: backtrace::capture::Backtrace::create
at C:\Users\36477.cargo\registry\src\index.crates.io-6f17d22bba15001f\backtrace-0.3.69\src\capture.rs:176
4: backtrace::capture::Backtrace::new
at C:\Users\36477.cargo\registry\src\index.crates.io-6f17d22bba15001f\backtrace-0.3.69\src\capture.rs:140
5: Zed::init_panic_hook::closure$0
at C:\zjk\projects\zed\crates\zed\src\main.rs:622
6: alloc::boxed::impl$49::call
at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library\alloc\src\boxed.rs:2029
7: std::panicking::rust_panic_with_hook
at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library\std\src\panicking.rs:783
8: std::panicking::begin_panic_handler::closure$0
at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library\std\src\panicking.rs:657
9: std::sys_common::backtrace::__rust_end_short_backtracestd::panicking::begin_panic_handler::closure_env$0,never$
at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library\std\src\sys_common\backtrace.rs:171
10: std::panicking::begin_panic_handler
at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library\std\src\panicking.rs:645
11: core::panicking::panic_fmt
at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library\core\src\panicking.rs:72
12: alacritty_terminal::tty::windows::conpty::panic_shell_spawn
at C:\Users\36477.cargo\registry\src\index.crates.io-6f17d22bba15001f\alacritty_terminal-0.22.0\src\tty\windows\conpty.rs:235
13: alacritty_terminal::tty::windows::conpty::new
at C:\Users\36477.cargo\registry\src\index.crates.io-6f17d22bba15001f\alacritty_terminal-0.22.0\src\tty\windows\conpty.rs:220
14: alacritty_terminal::tty::windows::new
at C:\Users\36477.cargo\registry\src\index.crates.io-6f17d22bba15001f\alacritty_terminal-0.22.0\src\tty\windows\mod.rs:37
15: terminal::TerminalBuilder::new
at C:\zjk\projects\zed\crates\terminal\src\terminal.rs:385
16: project::Project::create_terminal
at C:\zjk\projects\zed\crates\project\src\terminals.rs:53
17: terminal_view::impl$7::deserialize::closure$0::async_block$0::closure$1
at C:\zjk\projects\zed\crates\terminal_view\src\terminal_view.rs:891
18: gpui::window::impl$14::update_model<project::Project,enum2$<core::result::Result<gpui::app::entity_map::Modelterminal::Terminal,anyhow::Error> >,terminal_view::impl$7::deserialize::closure$0::async_block$0::closure_env$1>
at C:\zjk\projects\zed\crates\gpui\src\window.rs:1692
19: gpui::app::async_context::impl$3::update_model::closure$0<project::Project,enum2$<core::result::Result<gpui::app::entity_map::Modelterminal::Terminal,anyhow::Error> >,terminal_view::impl$7::deserialize::closure$0::async_block$0::closure_env$1>
at C:\zjk\projects\zed\crates\gpui\src\app\async_context.rs:287
20: gpui::app::impl$5::update_window::closure$0<enum2$<core::result::Result<gpui::app::entity_map::Modelterminal::Terminal,anyhow::Error> >,gpui::app::async_context::impl$3::update_model::closure_env$0<project::Project,enum2$<core::result::Result<gpui::app:
at C:\zjk\projects\zed\crates\gpui\src\app.rs:1249
21: gpui::app::AppContext::update<enum2$<core::result::Result<enum2$<core::result::Result<gpui::app::entity_map::Modelterminal::Terminal,anyhow::Error> >,anyhow::Error> >,gpui::app::impl$5::update_window::closure_env$0<enum2$<core::result::Result<gpui::app:
at C:\zjk\projects\zed\crates\gpui\src\app.rs:360
22: gpui::app::impl$5::update_window<enum2$<core::result::Result<gpui::app::entity_map::Modelterminal::Terminal,anyhow::Error> >,gpui::app::async_context::impl$3::update_model::closure_env$0<project::Project,enum2$<core::result::Result<gpui::app::entity_map
at C:\zjk\projects\zed\crates\gpui\src\app.rs:1240
23: gpui::app::async_context::impl$0::update_window<enum2$<core::result::Result<gpui::app::entity_map::Modelterminal::Terminal,anyhow::Error> >,gpui::app::async_context::impl$3::update_model::closure_env$0<project::Project,enum2$<core::result::Result<gpui::
at C:\zjk\projects\zed\crates\gpui\src\app\async_context.rs:70
24: gpui::app::async_context::impl$3::update_window<enum2$<core::result::Result<gpui::app::entity_map::Modelterminal::Terminal,anyhow::Error> >,gpui::app::async_context::impl$3::update_model::closure_env$0<project::Project,enum2$<core::result::Result<gpui::
at C:\zjk\projects\zed\crates\gpui\src\app\async_context.rs:294
25: gpui::window::AnyWindowHandle::update<gpui::app::async_context::AsyncWindowContext,enum2$<core::result::Result<gpui::app::entity_map::Modelterminal::Terminal,anyhow::Error> >,gpui::app::async_context::impl$3::update_model::closure_env$0<project::Project
at C:\zjk\projects\zed\crates\gpui\src\window.rs:2633
26: gpui::app::async_context::impl$3::update_model<project::Project,enum2$<core::result::Result<gpui::app::entity_map::Modelterminal::Terminal,anyhow::Error> >,terminal_view::impl$7::deserialize::closure$0::async_block$0::closure_env$1>
at C:\zjk\projects\zed\crates\gpui\src\app\async_context.rs:286
27: gpui::app::entity_map::Model::update<project::Project,gpui::app::async_context::AsyncWindowContext,enum2$<core::result::Result<gpui::app::entity_map::Modelterminal::Terminal,anyhow::Error> >,terminal_view::impl$7::deserialize::closure$0::async_block$0::
at C:\zjk\projects\zed\crates\gpui\src\app\entity_map.rs:406
28: terminal_view::impl$7::deserialize::closure$0::async_block$0
at C:\zjk\projects\zed\crates\terminal_view\src\terminal_view.rs:890
29: core::future::future::impl$1::poll<alloc::boxed::Box<dyn$<core::future::future::Future<assoc$<Output,enum2$<core::result::Result<gpui::view::View<terminal_view::TerminalView>,anyhow::Error> > > > >,alloc::alloc::Global> >
at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce\library\core\src\future\future.rs:124
30: async_task::runnable::impl$6::spawn_local::impl$1::poll<core::pin::Pin<alloc::boxed::Box<dyn$<core::future::future::Future<assoc$<Output,enum2$<core::result::Result<gpui::view::View<terminal_view::TerminalView>,anyhow::Error> > > > >,alloc::alloc::Global>
at C:\Users\36477.cargo\registry\src\index.crates.io-6f17d22bba15001f\async-task-4.7.0\src\runnable.rs:455
31: async_task::raw::RawTask::run<async_task::runnable::impl$6::spawn_local::Checked<core::pin::Pin<alloc::boxed::Box<dyn$<core::future::future::Future<assoc$<Output,enum2$<core::result::Result<gpui::view::View<terminal_view::TerminalView>,anyhow::Error> > >
at C:\Users\36477.cargo\registry\src\index.crates.io-6f17d22bba15001f\async-task-4.7.0\src\raw.rs:557
32: async_task::runnable::Runnable::run<tuple$<> >
at C:\Users\36477.cargo\registry\src\index.crates.io-6f17d22bba15001f\async-task-4.7.0\src\runnable.rs:781
33: gpui::platform::windows::platform::impl$2::run
at C:\zjk\projects\zed\crates\gpui\src\platform\windows\platform.rs:119
34: gpui::app::App::runZed::main::closure_env$3
at C:\zjk\projects\zed\crates\gpui\src\app.rs:143
35: Zed::main
at C:\zjk\projects\zed\crates\zed\src\main.rs:120
36: core::ops::function::FnOnce::call_once<void ()(),tuple$<> >
at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce\library\core\src\ops\function.rs:250
37: std::sys_common::backtrace::__rust_begin_short_backtrace<void (
)(),tuple$<> >
at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce\library\std\src\sys_common\backtrace.rs:155
38: std::sys_common::backtrace::__rust_begin_short_backtrace<void (*)(),tuple$<> >
at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce\library\std\src\sys_common\backtrace.rs:155
39: std::rt::lang_start::closure$0<tuple$<> >
at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce\library\std\src\rt.rs:166
40: std::rt::lang_start_internal::closure$2
at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library\std\src\rt.rs:148
41: std::panicking::try::do_call
at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library\std\src\panicking.rs:552
42: std::panicking::try
at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library\std\src\panicking.rs:516
43: std::panic::catch_unwind
at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library\std\src\panic.rs:142
44: std::rt::lang_start_internal
at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library\std\src\rt.rs:148
45: std::rt::lang_start<tuple$<> >
at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce\library\std\src\rt.rs:165
46: main
47: invoke_main
at D:\a_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:78
48: __scrt_common_main_seh
at D:\a_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288
49: BaseThreadInitThunk
50: RtlUserThreadStart

error: process didn't exit successfully: .\Zed.exe (exit code: 0xffffffff)

@JunkuiZhang JunkuiZhang added admin read Pending admin review defect [core label] panic / crash [core label] triage Maintainer needs to classify the issue labels Mar 4, 2024
@Moshyfawn Moshyfawn added windows and removed triage Maintainer needs to classify the issue labels Mar 4, 2024
@JunkuiZhang
Copy link
Contributor Author

After debugging for a while, I discovered that on Windows, if Zed closes with a folder open, the next time Zed is opened, it will open that folder again. At the same time, the terminal also attempts to open, but for some reason, the folder address received by the terminal is empty. Consequently, when creating the terminal, the Windows API receives the instruction: "Help me open an empty folder," leading to an immediate error.

@JunkuiZhang
Copy link
Contributor Author

Some print functions to print the value of cwd
屏幕截图 2024-03-04 232250

It shows cwd is Some(""), which is a empty string.
屏幕截图 2024-03-04 233243

@JunkuiZhang
Copy link
Contributor Author

So, something is wrong inside that get_working_directory function.

Will be fixed by #8809

@JosephTLyons JosephTLyons added open source Open source community projects, contributions, etc and removed admin read Pending admin review labels Mar 4, 2024
@zaucy
Copy link
Contributor

zaucy commented Mar 6, 2024

ran into this issue a couple times. workaround is to delete zed db (%APPDATA%\Zed\db) when it comes up.

minor update to just check for the empty cwd seems to at least make this less of a blocker (#8924). I'm sure there's a different way to get an invalid cwd somehow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
defect [core label] open source Open source community projects, contributions, etc panic / crash [core label] windows
Projects
None yet
4 participants