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

Panic launching wezterm-gui.exe on Windows #1245

Closed
rawhat opened this issue Oct 22, 2021 · 6 comments
Closed

Panic launching wezterm-gui.exe on Windows #1245

rawhat opened this issue Oct 22, 2021 · 6 comments
Labels
bug Something isn't working fixed-in-nightly This is (or is assumed to be) fixed in the nightly builds. Windows Issue applies to Microsoft Windows

Comments

@rawhat
Copy link

rawhat commented Oct 22, 2021

What Operating System(s) are you seeing this problem on?

Windows

WezTerm version

20211021-185611-04768fd1

Did you try the latest nightly build to see if the issue is better (or worse!) than your current version?

Yes, and I updated the version box above to show the version of the nightly that I tried

Describe the bug

Launching wezterm.exe successfully opens a command prompt, which then opens the WezTerm window. Launching from the wezterm-gui.exe executable produces the following panic:

image

However, running

PS C:\Users\Alex> wezterm-gui.exe

does launch it successfully.

To Reproduce

No response

Configuration

I don't know if any of my config is relevant to the issue. But I can provide it if needed.

Expected Behavior

No response

Logs

No response

Anything else?

No response

@rawhat rawhat added the bug Something isn't working label Oct 22, 2021
@krt-z
Copy link

krt-z commented Oct 23, 2021

Just confirming, exactly the same for me. Fine from command line, handle assertion panic from shortcut / start menu.

@wez wez added the Windows Issue applies to Microsoft Windows label Oct 24, 2021
@wez
Copy link
Owner

wez commented Oct 24, 2021

I can confirm

thread 'main' panicked at 'assertion failed: !handle.is_null()', /rustc/09c42c45858d5f3aedfa670698275303a3d19afa\library\std\src\os\.\windows\io\handle.rs:183:9
stack backtrace:
   0:     0x7ff6ec71d9ee - std::backtrace_rs::backtrace::dbghelp::trace
                               at /rustc/09c42c45858d5f3aedfa670698275303a3d19afa\/library\std\src\..\..\backtrace\src\backtrace\dbghelp.rs:98
   1:     0x7ff6ec71d9ee - std::backtrace_rs::backtrace::trace_unsynchronized
                               at /rustc/09c42c45858d5f3aedfa670698275303a3d19afa\/library\std\src\..\..\backtrace\src\backtrace\mod.rs:66
   2:     0x7ff6ec71d9ee - std::sys_common::backtrace::_print_fmt
                               at /rustc/09c42c45858d5f3aedfa670698275303a3d19afa\/library\std\src\sys_common\backtrace.rs:67
   3:     0x7ff6ec71d9ee - std::sys_common::backtrace::_print::impl$0::fmt
                               at /rustc/09c42c45858d5f3aedfa670698275303a3d19afa\/library\std\src\sys_common\backtrace.rs:46
   4:     0x7ff6ec73ce0a - core::fmt::write
                               at /rustc/09c42c45858d5f3aedfa670698275303a3d19afa\/library\core\src\fmt\mod.rs:1150
   5:     0x7ff6ec714d78 - std::io::Write::write_fmt<std::sys::windows::stdio::Stderr>
                               at /rustc/09c42c45858d5f3aedfa670698275303a3d19afa\/library\std\src\io\mod.rs:1667
   6:     0x7ff6ec720756 - std::sys_common::backtrace::_print
                               at /rustc/09c42c45858d5f3aedfa670698275303a3d19afa\/library\std\src\sys_common\backtrace.rs:49
   7:     0x7ff6ec720756 - std::sys_common::backtrace::print
                               at /rustc/09c42c45858d5f3aedfa670698275303a3d19afa\/library\std\src\sys_common\backtrace.rs:36
   8:     0x7ff6ec720756 - std::panicking::default_hook::closure$1
                               at /rustc/09c42c45858d5f3aedfa670698275303a3d19afa\/library\std\src\panicking.rs:210
   9:     0x7ff6ec720244 - std::panicking::default_hook
                               at /rustc/09c42c45858d5f3aedfa670698275303a3d19afa\/library\std\src\panicking.rs:227
  10:     0x7ff6ebb73218 - alloc::boxed::impl$46::call
                               at /rustc/09c42c45858d5f3aedfa670698275303a3d19afa\library\alloc\src\boxed.rs:1650
  11:     0x7ff6ebb73218 - wezterm_gui::notify_on_panic::closure$0
                               at C:\Users\wez\wez-personal\wezterm\wezterm-gui\src\main.rs:401
  12:     0x7ff6ec720ef9 - std::panicking::rust_panic_with_hook
                               at /rustc/09c42c45858d5f3aedfa670698275303a3d19afa\/library\std\src\panicking.rs:628
  13:     0x7ff6ec72096f - std::panicking::begin_panic_handler::closure$0
                               at /rustc/09c42c45858d5f3aedfa670698275303a3d19afa\/library\std\src\panicking.rs:519
  14:     0x7ff6ec71e337 - std::sys_common::backtrace::__rust_end_short_backtrace<std::panicking::begin_panic_handler::closure$0,never$>
                               at /rustc/09c42c45858d5f3aedfa670698275303a3d19afa\/library\std\src\sys_common\backtrace.rs:141
  15:     0x7ff6ec7208f9 - std::panicking::begin_panic_handler
                               at /rustc/09c42c45858d5f3aedfa670698275303a3d19afa\/library\std\src\panicking.rs:517
  16:     0x7ff6ecb437a0 - core::panicking::panic_fmt
                               at /rustc/09c42c45858d5f3aedfa670698275303a3d19afa\/library\core\src\panicking.rs:101
  17:     0x7ff6ecb436ec - core::panicking::panic
                               at /rustc/09c42c45858d5f3aedfa670698275303a3d19afa\/library\core\src\panicking.rs:50
  18:     0x7ff6ec3f459c - winapi_util::console::Console::create_for_stream
                               at C:\Users\wez\.cargo\registry\src\github.com-1ecc6299db9ec823\winapi-util-0.1.5\src\console.rs:212
  19:     0x7ff6ec3f469f - winapi_util::console::Console::stderr
                               at C:\Users\wez\.cargo\registry\src\github.com-1ecc6299db9ec823\winapi-util-0.1.5\src\console.rs:225
  20:     0x7ff6ebc591d9 - termcolor::BufferWriter::create
                               at C:\Users\wez\.cargo\registry\src\github.com-1ecc6299db9ec823\termcolor-1.1.2\src\lib.rs:895
  21:     0x7ff6ebc596e2 - termcolor::BufferWriter::stderr
                               at C:\Users\wez\.cargo\registry\src\github.com-1ecc6299db9ec823\termcolor-1.1.2\src\lib.rs:940
  22:     0x7ff6ebc56506 - env_logger::fmt::writer::termcolor::imp::BufferWriter::stderr
                               at C:\Users\wez\.cargo\registry\src\github.com-1ecc6299db9ec823\env_logger-0.7.1\src\fmt\writer\termcolor\extern_impl.rs:84
  23:     0x7ff6ebc56506 - env_logger::fmt::writer::Builder::build
                               at C:\Users\wez\.cargo\registry\src\github.com-1ecc6299db9ec823\env_logger-0.7.1\src\fmt\writer\mod.rs:135
  24:     0x7ff6ebc51050 - env_logger::Builder::build
                               at C:\Users\wez\.cargo\registry\src\github.com-1ecc6299db9ec823\env_logger-0.7.1\src\lib.rs:716
  25:     0x7ff6ebc4c551 - env_bootstrap::ringlog::setup_logger
                               at C:\Users\wez\wez-personal\wezterm\env-bootstrap\src\ringlog.rs:170
  26:     0x7ff6ebb73738 - wezterm_gui::run
                               at C:\Users\wez\wez-personal\wezterm\wezterm-gui\src\main.rs:601
  27:     0x7ff6ebb7341f - wezterm_gui::main
                               at C:\Users\wez\wez-personal\wezterm\wezterm-gui\src\main.rs:420
  28:     0x7ff6ebb44516 - core::ops::function::FnOnce::call_once
                               at /rustc/09c42c45858d5f3aedfa670698275303a3d19afa\library\core\src\ops\function.rs:227
  29:     0x7ff6ebb44516 - std::sys_common::backtrace::__rust_begin_short_backtrace<void (*)(),tuple$<> >
                               at /rustc/09c42c45858d5f3aedfa670698275303a3d19afa\library\std\src\sys_common\backtrace.rs:125
  30:     0x7ff6ebb5b21c - std::rt::lang_start::closure$0
                               at /rustc/09c42c45858d5f3aedfa670698275303a3d19afa\library\std\src\rt.rs:63
  31:     0x7ff6ebb5b21c - core::ops::function::FnOnce::call_once
                               at /rustc/09c42c45858d5f3aedfa670698275303a3d19afa\library\core\src\ops\function.rs:227
  32:     0x7ff6ebb5b21c - core::ops::function::FnOnce::call_once<std::rt::lang_start::closure$0,tuple$<> >
                               at /rustc/09c42c45858d5f3aedfa670698275303a3d19afa\library\std\src\rt.rs:63
  33:     0x7ff6ec721336 - core::ops::function::impls::impl$2::call_once
                               at /rustc/09c42c45858d5f3aedfa670698275303a3d19afa\library\core\src\ops\function.rs:259
  34:     0x7ff6ec721336 - std::panicking::try::do_call
                               at /rustc/09c42c45858d5f3aedfa670698275303a3d19afa\/library\std\src\panicking.rs:403
  35:     0x7ff6ec721336 - std::panicking::try
                               at /rustc/09c42c45858d5f3aedfa670698275303a3d19afa\/library\std\src\panicking.rs:367
  36:     0x7ff6ec721336 - std::panic::catch_unwind
                               at /rustc/09c42c45858d5f3aedfa670698275303a3d19afa\/library\std\src\panic.rs:129
  37:     0x7ff6ec721336 - std::rt::lang_start_internal::closure$2
                               at /rustc/09c42c45858d5f3aedfa670698275303a3d19afa\/library\std\src\rt.rs:45
  38:     0x7ff6ec721336 - std::panicking::try::do_call
                               at /rustc/09c42c45858d5f3aedfa670698275303a3d19afa\/library\std\src\panicking.rs:403
  39:     0x7ff6ec721336 - std::panicking::try
                               at /rustc/09c42c45858d5f3aedfa670698275303a3d19afa\/library\std\src\panicking.rs:367
  40:     0x7ff6ec721336 - std::panic::catch_unwind
                               at /rustc/09c42c45858d5f3aedfa670698275303a3d19afa\/library\std\src\panic.rs:129
  41:     0x7ff6ec721336 - std::rt::lang_start_internal
                               at /rustc/09c42c45858d5f3aedfa670698275303a3d19afa\/library\std\src\rt.rs:45
  42:     0x7ff6ebb7c127 - main
  43:     0x7ff6ecac9650 - invoke_main
                               at D:\agent\_work\9\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:78
  44:     0x7ff6ecac9650 - __scrt_common_main_seh
                               at D:\agent\_work\9\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288
  45:     0x7ffda7fb7034 - BaseThreadInitThunk
  46:     0x7ffda9542651 - RtlUserThreadStart

Tracing this through the deps: rust-cli/env_logger#214 leads to this Rust issue:
rust-lang/rust#88576

@rawhat
Copy link
Author

rawhat commented Oct 24, 2021

Awesome, thank you. Will follow that issue... hopefully a backport!

wez added a commit that referenced this issue Oct 24, 2021
Skip initializing pretty logger when running in the windows subsystem.

refs: #1245
refs: rust-lang/rust#88576
@wez
Copy link
Owner

wez commented Oct 24, 2021

I just pushed a commit that seems to resolve this for me; it'll take ~30 minutes to build out and show up in the nightly downloads.

@wez wez added the fixed-in-nightly This is (or is assumed to be) fixed in the nightly builds. label Oct 24, 2021
@rawhat
Copy link
Author

rawhat commented Oct 24, 2021

Amazing. Works great! Thanks for taking care of this so quickly.

@rawhat rawhat closed this as completed Oct 24, 2021
@github-actions
Copy link
Contributor

github-actions bot commented Feb 4, 2023

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 4, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working fixed-in-nightly This is (or is assumed to be) fixed in the nightly builds. Windows Issue applies to Microsoft Windows
Projects
None yet
Development

No branches or pull requests

3 participants