Spagett1 / pineflash

A tool to flash ironos to the pinecil soldering iron and possibly other pine64 devices in the future
Other
213 stars 12 forks source link

Windows 10 x64 App closes shortly after launch #52

Open CyferShepard opened 1 year ago

CyferShepard commented 1 year ago

As the title suggests

Pineflash opens for a few seconds and then closes after exactly 2 seconds

Using v0.5.1

Spagett1 commented 1 year ago

Gday, I'll try and investigate but I haven't been able to reproduce the issue. Windows is quite annoying to get logs from unfortunately so if anyone on another os encounters this issue please chuck them here.

Quinten0508 commented 1 year ago

+1

Able to reproduce this on Windows 11 22H2 Build 22621.1928. It seems to auto-fetch the latest version of ironOS but then promply closes. Running the executable through the command prompts yields no output, I guess it runs the actual program on a new thread.

Here's a video showing the issue. I opened PineFlash twice, both times with the same result: https://www.youtube.com/watch?v=dybJzfBV6Rw

Quinten0508 commented 1 year ago

Interestingly enough, running PineFlash on windows sandbox (a virtual machine, similar to HyperV/Virtualbox/VMware) does seem to work just fine and the issue is not reproducible on my end with this setup.

Quinten0508 commented 1 year ago

Just built PineFlash manually with cargo, issue no longer occurs immediately on my host machine. I used your build steps. The compile finished w/o errors. However, as soon as I attempt to flash the latest build, it closes. Video: https://youtu.be/Ze04wKdDJ_Q

Spagett1 commented 1 year ago

Thanks for spending this time diagnosing, I don't have a windows machine personally and my testing is done via VM's or wine and havnt been able to replicate it so it's interesting it runs in windows sandbox.

Can you produce a crash when running it with cargo run in the main directory? That should give a crash report which is what I really need to solve this issue. If that doesn't produce a crash message you may need to remove the line #![windows_subsystem = "windows"] from the top of the src/main.rs file.

Thanks for the help

Quinten0508 commented 1 year ago

You were bang on! Removing the first line and adding RUST_BACKTRACE=1 as an env variable (on rust's request) made it spit out a few things:

PS C:\Users\quinten\gitfiles\PineFlash> $env:RUST_BACKTRACE=1; cargo run
    Finished dev [unoptimized + debuginfo] target(s) in 0.22s
     Running `target\debug\pineflash.exe`
thread 'main' panicked at 'Could not flash soldering iron: Os { code: 3, kind: NotFound, message: "The system cannot find the path specified." }', src\submodules\flash.rs:179:18
stack backtrace:
   0: std::panicking::begin_panic_handler
             at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library\std\src\panicking.rs:578
   1: core::panicking::panic_fmt
             at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library\core\src\panicking.rs:67
   2: core::result::unwrap_failed
             at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library\core\src\result.rs:1687
   3: enum2$<core::result::Result<std::process::Output,std::io::error::Error> >::expect<std::process::Output,std::io::error::Error>
             at /rustc/90c541806f23a127002de5b4038be731ba1458ca\library\core\src\result.rs:1046
   4: pineflash::Flasher::flash
             at .\src\submodules\flash.rs:169
   5: pineflash::impl$3::update
             at .\src\main.rs:486
   6: eframe::native::epi_integration::impl$0::update::closure$0
             at C:\Users\quinten\.cargo\registry\src\index.crates.io-6f17d22bba15001f\eframe-0.21.3\src\native\epi_integration.rs:454
   7: egui::context::Context::run<eframe::native::epi_integration::impl$0::update::closure_env$0>
             at C:\Users\quinten\.cargo\registry\src\index.crates.io-6f17d22bba15001f\egui-0.21.0\src\context.rs:286
   8: eframe::native::epi_integration::EpiIntegration::update
             at C:\Users\quinten\.cargo\registry\src\index.crates.io-6f17d22bba15001f\eframe-0.21.3\src\native\epi_integration.rs:452
   9: eframe::native::run::glow_integration::impl$2::paint
             at C:\Users\quinten\.cargo\registry\src\index.crates.io-6f17d22bba15001f\eframe-0.21.3\src\native\run.rs:790
  10: eframe::native::run::run_and_return::closure$0<eframe::native::run::glow_integration::GlowWinitApp>
             at C:\Users\quinten\.cargo\registry\src\index.crates.io-6f17d22bba15001f\eframe-0.21.3\src\native\run.rs:140
  11: winit::platform_impl::platform::event_loop::impl$3::run_return::closure$0<enum2$<eframe::native::run::UserEvent>,eframe::native::run::run_and_return::closure_env$0<eframe::native::run::glow_integration::GlowWinitApp> >
             at C:\Users\quinten\.cargo\registry\src\index.crates.io-6f17d22bba15001f\winit-0.28.3\src\platform_impl\windows\event_loop.rs:260
  12: alloc::boxed::impl$46::call_mut<tuple$<enum2$<winit::event::Event<enum2$<eframe::native::run::UserEvent> > >,ref_mut$<enum2$<winit::event_loop::ControlFlow> > >,dyn$<core::ops::function::FnMut<tuple$<enum2$<winit::event::Event<enum2$<eframe::native::run::
             at /rustc/90c541806f23a127002de5b4038be731ba1458ca\library\alloc\src\boxed.rs:1980
  13: winit::platform_impl::platform::event_loop::runner::impl$3::call_event_handler::closure$0<enum2$<eframe::native::run::UserEvent> >
             at C:\Users\quinten\.cargo\registry\src\index.crates.io-6f17d22bba15001f\winit-0.28.3\src\platform_impl\windows\event_loop\runner.rs:250
  14: core::panic::unwind_safe::impl$23::call_once<tuple$<>,winit::platform_impl::platform::event_loop::runner::impl$3::call_event_handler::closure_env$0<enum2$<eframe::native::run::UserEvent> > >
             at /rustc/90c541806f23a127002de5b4038be731ba1458ca\library\core\src\panic\unwind_safe.rs:271
  15: std::panicking::try::do_call<core::panic::unwind_safe::AssertUnwindSafe<winit::platform_impl::platform::event_loop::runner::impl$3::call_event_handler::closure_env$0<enum2$<eframe::native::run::UserEvent> > >,tuple$<> >
             at /rustc/90c541806f23a127002de5b4038be731ba1458ca\library\std\src\panicking.rs:485
  16: std::sync::mpmc::utils::impl$1::deref<std::sync::mpmc::list::Position<enum2$<eframe::native::run::UserEvent> > >
  17: std::panicking::try<tuple$<>,core::panic::unwind_safe::AssertUnwindSafe<winit::platform_impl::platform::event_loop::runner::impl$3::call_event_handler::closure_env$0<enum2$<eframe::native::run::UserEvent> > > >
             at /rustc/90c541806f23a127002de5b4038be731ba1458ca\library\std\src\panicking.rs:449
  18: std::panic::catch_unwind<core::panic::unwind_safe::AssertUnwindSafe<winit::platform_impl::platform::event_loop::runner::impl$3::call_event_handler::closure_env$0<enum2$<eframe::native::run::UserEvent> > >,tuple$<> >
             at /rustc/90c541806f23a127002de5b4038be731ba1458ca\library\std\src\panic.rs:140
  19: winit::platform_impl::platform::event_loop::runner::EventLoopRunner<enum2$<eframe::native::run::UserEvent> >::catch_unwind<enum2$<eframe::native::run::UserEvent>,tuple$<>,winit::platform_impl::platform::event_loop::runner::impl$3::call_event_handler::clos
             at C:\Users\quinten\.cargo\registry\src\index.crates.io-6f17d22bba15001f\winit-0.28.3\src\platform_impl\windows\event_loop\runner.rs:157
  20: winit::platform_impl::platform::event_loop::runner::EventLoopRunner<enum2$<eframe::native::run::UserEvent> >::call_event_handler<enum2$<eframe::native::run::UserEvent> >
             at C:\Users\quinten\.cargo\registry\src\index.crates.io-6f17d22bba15001f\winit-0.28.3\src\platform_impl\windows\event_loop\runner.rs:242
  21: winit::platform_impl::platform::event_loop::runner::EventLoopRunner<enum2$<eframe::native::run::UserEvent> >::call_redraw_events_cleared<enum2$<eframe::native::run::UserEvent> >
             at C:\Users\quinten\.cargo\registry\src\index.crates.io-6f17d22bba15001f\winit-0.28.3\src\platform_impl\windows\event_loop\runner.rs:409
  22: winit::platform_impl::platform::event_loop::runner::EventLoopRunner<enum2$<eframe::native::run::UserEvent> >::move_state_to<enum2$<eframe::native::run::UserEvent> >
             at C:\Users\quinten\.cargo\registry\src\index.crates.io-6f17d22bba15001f\winit-0.28.3\src\platform_impl\windows\event_loop\runner.rs:358
  23: winit::platform_impl::platform::event_loop::runner::EventLoopRunner<enum2$<eframe::native::run::UserEvent> >::redraw_events_cleared<enum2$<eframe::native::run::UserEvent> >
             at C:\Users\quinten\.cargo\registry\src\index.crates.io-6f17d22bba15001f\winit-0.28.3\src\platform_impl\windows\event_loop\runner.rs:234
  24: winit::platform_impl::platform::event_loop::public_window_callback_inner::closure$0<enum2$<eframe::native::run::UserEvent> >
             at C:\Users\quinten\.cargo\registry\src\index.crates.io-6f17d22bba15001f\winit-0.28.3\src\platform_impl\windows\event_loop.rs:1127
  25: core::ops::function::FnOnce::call_once<winit::platform_impl::platform::event_loop::public_window_callback_inner::closure_env$0<enum2$<eframe::native::run::UserEvent> >,tuple$<> >
             at /rustc/90c541806f23a127002de5b4038be731ba1458ca\library\core\src\ops\function.rs:250
  26: core::panic::unwind_safe::impl$23::call_once<isize,winit::platform_impl::platform::event_loop::public_window_callback_inner::closure_env$0<enum2$<eframe::native::run::UserEvent> > >
             at /rustc/90c541806f23a127002de5b4038be731ba1458ca\library\core\src\panic\unwind_safe.rs:271
  27: std::panicking::try::do_call<core::panic::unwind_safe::AssertUnwindSafe<winit::platform_impl::platform::event_loop::public_window_callback_inner::closure_env$0<enum2$<eframe::native::run::UserEvent> > >,isize>
             at /rustc/90c541806f23a127002de5b4038be731ba1458ca\library\std\src\panicking.rs:485
  28: std::sync::mpmc::utils::impl$1::deref<std::sync::mpmc::list::Position<enum2$<eframe::native::run::UserEvent> > >
  29: std::panicking::try<isize,core::panic::unwind_safe::AssertUnwindSafe<winit::platform_impl::platform::event_loop::public_window_callback_inner::closure_env$0<enum2$<eframe::native::run::UserEvent> > > >
             at /rustc/90c541806f23a127002de5b4038be731ba1458ca\library\std\src\panicking.rs:449
  30: std::panic::catch_unwind<core::panic::unwind_safe::AssertUnwindSafe<winit::platform_impl::platform::event_loop::public_window_callback_inner::closure_env$0<enum2$<eframe::native::run::UserEvent> > >,isize>
             at /rustc/90c541806f23a127002de5b4038be731ba1458ca\library\std\src\panic.rs:140
  31: winit::platform_impl::platform::event_loop::runner::EventLoopRunner<enum2$<eframe::native::run::UserEvent> >::catch_unwind<enum2$<eframe::native::run::UserEvent>,isize,winit::platform_impl::platform::event_loop::public_window_callback_inner::closure_env$0
             at C:\Users\quinten\.cargo\registry\src\index.crates.io-6f17d22bba15001f\winit-0.28.3\src\platform_impl\windows\event_loop\runner.rs:157
  32: winit::platform_impl::platform::event_loop::public_window_callback_inner<enum2$<eframe::native::run::UserEvent> >
             at C:\Users\quinten\.cargo\registry\src\index.crates.io-6f17d22bba15001f\winit-0.28.3\src\platform_impl\windows\event_loop.rs:2320
  33: winit::platform_impl::platform::event_loop::public_window_callback<enum2$<eframe::native::run::UserEvent> >
             at C:\Users\quinten\.cargo\registry\src\index.crates.io-6f17d22bba15001f\winit-0.28.3\src\platform_impl\windows\event_loop.rs:994
  34: DispatchMessageW
  35: CallWindowProcW
  36: wglSwapBuffers
  37: DispatchMessageW
  38: CallWindowProcW
  39: windows::Windows::Win32::UI::WindowsAndMessaging::CallWindowProcW<windows::Windows::Win32::Foundation::HWND,windows::Windows::Win32::Foundation::WPARAM,windows::Windows::Win32::Foundation::LPARAM>
             at C:\Users\quinten\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-0.42.0\src\Windows\Win32\UI\WindowsAndMessaging\mod.rs:220
  40: accesskit_windows::subclass::wnd_proc
             at C:\Users\quinten\.cargo\registry\src\index.crates.io-6f17d22bba15001f\accesskit_windows-0.12.0\src\subclass.rs:41
  41: DispatchMessageW
  42: DispatchMessageW
  43: GetClassLongW
  44: KiUserCallbackDispatcher
  45: NtUserDispatchMessage
  46: DispatchMessageW
  47: winit::platform_impl::platform::event_loop::EventLoop<enum2$<eframe::native::run::UserEvent> >::run_return<enum2$<eframe::native::run::UserEvent>,eframe::native::run::run_and_return::closure_env$0<eframe::native::run::glow_integration::GlowWinitApp> >
             at C:\Users\quinten\.cargo\registry\src\index.crates.io-6f17d22bba15001f\winit-0.28.3\src\platform_impl\windows\event_loop.rs:282
  48: winit::platform::run_return::impl$0::run_return<enum2$<eframe::native::run::UserEvent>,eframe::native::run::run_and_return::closure_env$0<eframe::native::run::glow_integration::GlowWinitApp> >
             at C:\Users\quinten\.cargo\registry\src\index.crates.io-6f17d22bba15001f\winit-0.28.3\src\platform\run_return.rs:51
  49: eframe::native::run::run_and_return<eframe::native::run::glow_integration::GlowWinitApp>
             at C:\Users\quinten\.cargo\registry\src\index.crates.io-6f17d22bba15001f\eframe-0.21.3\src\native\run.rs:124
  50: eframe::native::run::glow_integration::run_glow::closure$0
             at C:\Users\quinten\.cargo\registry\src\index.crates.io-6f17d22bba15001f\eframe-0.21.3\src\native\run.rs:994
  51: eframe::native::run::with_event_loop::closure$0<enum2$<core::result::Result<tuple$<>,enum2$<eframe::Error> > >,eframe::native::run::glow_integration::run_glow::closure_env$0>
             at C:\Users\quinten\.cargo\registry\src\index.crates.io-6f17d22bba15001f\eframe-0.21.3\src\native\run.rs:108
  52: std::thread::local::LocalKey<core::cell::RefCell<enum2$<core::option::Option<winit::event_loop::EventLoop<enum2$<eframe::native::run::UserEvent> > > > > >::try_with<core::cell::RefCell<enum2$<core::option::Option<winit::event_loop::EventLoop<enum2$<eframe
             at /rustc/90c541806f23a127002de5b4038be731ba1458ca\library\std\src\thread\local.rs:252
  53: std::thread::local::LocalKey<core::cell::RefCell<enum2$<core::option::Option<winit::event_loop::EventLoop<enum2$<eframe::native::run::UserEvent> > > > > >::with<core::cell::RefCell<enum2$<core::option::Option<winit::event_loop::EventLoop<enum2$<eframe::na
             at /rustc/90c541806f23a127002de5b4038be731ba1458ca\library\std\src\thread\local.rs:228
  54: eframe::native::run::with_event_loop<enum2$<core::result::Result<tuple$<>,enum2$<eframe::Error> > >,eframe::native::run::glow_integration::run_glow::closure_env$0>
             at C:\Users\quinten\.cargo\registry\src\index.crates.io-6f17d22bba15001f\eframe-0.21.3\src\native\run.rs:101
  55: eframe::native::run::glow_integration::run_glow
             at C:\Users\quinten\.cargo\registry\src\index.crates.io-6f17d22bba15001f\eframe-0.21.3\src\native\run.rs:991
  56: eframe::run_native
             at C:\Users\quinten\.cargo\registry\src\index.crates.io-6f17d22bba15001f\eframe-0.21.3\src\lib.rs:201
  57: pineflash::main
             at .\src\main.rs:507
  58: core::ops::function::FnOnce::call_once<void (*)(),tuple$<> >
             at /rustc/90c541806f23a127002de5b4038be731ba1458ca\library\core\src\ops\function.rs:250
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
error: process didn't exit successfully: `target\debug\pineflash.exe` (exit code: 101)

The error seems to be pretty clear: The system cannot find the path specified." }', src\submodules\flash.rs:179:18.

Here it is again with a tad more detail when setting RUST_BACKTRACE to full:

 $env:RUST_BACKTRACE='full'; cargo run
    Finished dev [unoptimized + debuginfo] target(s) in 0.22s
     Running `target\debug\pineflash.exe`
thread 'main' panicked at 'Could not flash soldering iron: Os { code: 3, kind: NotFound, message: "The system cannot find the path specified." }', src\submodules\flash.rs:179:18
stack backtrace:
   0:     0x7ff608f8d252 - std::backtrace_rs::backtrace::dbghelp::trace
                               at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library\std\src\..\..\backtrace\src\backtrace\dbghelp.rs:98
   1:     0x7ff608f8d252 - std::backtrace_rs::backtrace::trace_unsynchronized
                               at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library\std\src\..\..\backtrace\src\backtrace\mod.rs:66
   2:     0x7ff608f8d252 - std::sys_common::backtrace::_print_fmt
                               at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library\std\src\sys_common\backtrace.rs:65
   3:     0x7ff608f8d252 - std::sys_common::backtrace::_print::impl$0::fmt
                               at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library\std\src\sys_common\backtrace.rs:44
   4:     0x7ff608fb07fb - core::fmt::write
                               at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library\core\src\fmt\mod.rs:1254
   5:     0x7ff608f87c2a - std::io::Write::write_fmt<std::sys::windows::stdio::Stderr>
                               at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library\std\src\io\mod.rs:1698
   6:     0x7ff608f8cf9b - std::sys_common::backtrace::_print
                               at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library\std\src\sys_common\backtrace.rs:47
   7:     0x7ff608f8cf9b - std::sys_common::backtrace::print
                               at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library\std\src\sys_common\backtrace.rs:34
   8:     0x7ff608f8fb6a - std::panicking::default_hook::closure$1
                               at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library\std\src\panicking.rs:269
   9:     0x7ff608f8f7d0 - std::panicking::default_hook
                               at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library\std\src\panicking.rs:288
  10:     0x7ff608f90246 - std::panicking::rust_panic_with_hook
                               at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library\std\src\panicking.rs:691
  11:     0x7ff608f9013e - std::panicking::begin_panic_handler::closure$0
                               at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library\std\src\panicking.rs:582
  12:     0x7ff608f8def9 - std::sys_common::backtrace::__rust_end_short_backtrace<std::panicking::begin_panic_handler::closure_env$0,never$>
                               at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library\std\src\sys_common\backtrace.rs:150
  13:     0x7ff608f8fe50 - std::panicking::begin_panic_handler
                               at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library\std\src\panicking.rs:578
  14:     0x7ff609071615 - core::panicking::panic_fmt
                               at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library\core\src\panicking.rs:67
  15:     0x7ff609071c36 - core::result::unwrap_failed
                               at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library\core\src\result.rs:1687
  16:     0x7ff608754053 - enum2$<core::result::Result<std::process::Output,std::io::error::Error> >::expect<std::process::Output,std::io::error::Error>
                               at /rustc/90c541806f23a127002de5b4038be731ba1458ca\library\core\src\result.rs:1046
  17:     0x7ff60873f02c - pineflash::Flasher::flash
                               at C:\Users\quinten\gitfiles\PineFlash\src\submodules\flash.rs:169
  18:     0x7ff608744446 - pineflash::impl$3::update
                               at C:\Users\quinten\gitfiles\PineFlash\src\main.rs:486
  19:     0x7ff608ba7c33 - eframe::native::epi_integration::impl$0::update::closure$0
                               at C:\Users\quinten\.cargo\registry\src\index.crates.io-6f17d22bba15001f\eframe-0.21.3\src\native\epi_integration.rs:454
  20:     0x7ff608bbde59 - egui::context::Context::run<eframe::native::epi_integration::impl$0::update::closure_env$0>
                               at C:\Users\quinten\.cargo\registry\src\index.crates.io-6f17d22bba15001f\egui-0.21.0\src\context.rs:286
  21:     0x7ff608ba7569 - eframe::native::epi_integration::EpiIntegration::update
                               at C:\Users\quinten\.cargo\registry\src\index.crates.io-6f17d22bba15001f\eframe-0.21.3\src\native\epi_integration.rs:452
  22:     0x7ff608bce6e7 - eframe::native::run::glow_integration::impl$2::paint
                               at C:\Users\quinten\.cargo\registry\src\index.crates.io-6f17d22bba15001f\eframe-0.21.3\src\native\run.rs:790
  23:     0x7ff608bc34ba - eframe::native::run::run_and_return::closure$0<eframe::native::run::glow_integration::GlowWinitApp>
                               at C:\Users\quinten\.cargo\registry\src\index.crates.io-6f17d22bba15001f\eframe-0.21.3\src\native\run.rs:140
  24:     0x7ff608ba96a7 - winit::platform_impl::platform::event_loop::impl$3::run_return::closure$0<enum2$<eframe::native::run::UserEvent>,eframe::native::run::run_and_return::closure_env$0<eframe::native::run::glow_integration::GlowWinitApp> >
                               at C:\Users\quinten\.cargo\registry\src\index.crates.io-6f17d22bba15001f\winit-0.28.3\src\platform_impl\windows\event_loop.rs:260
  25:     0x7ff608ba12b5 - alloc::boxed::impl$46::call_mut<tuple$<enum2$<winit::event::Event<enum2$<eframe::native::run::UserEvent> > >,ref_mut$<enum2$<winit::event_loop::ControlFlow> > >,dyn$<core::ops::function::FnMut<tuple$<enum2$<winit::event::Event<enum2$<eframe::native::run::
                               at /rustc/90c541806f23a127002de5b4038be731ba1458ca\library\alloc\src\boxed.rs:1980
  26:     0x7ff608bbad6d - winit::platform_impl::platform::event_loop::runner::impl$3::call_event_handler::closure$0<enum2$<eframe::native::run::UserEvent> >
                               at C:\Users\quinten\.cargo\registry\src\index.crates.io-6f17d22bba15001f\winit-0.28.3\src\platform_impl\windows\event_loop\runner.rs:250
  27:     0x7ff608ba2cd4 - core::panic::unwind_safe::impl$23::call_once<tuple$<>,winit::platform_impl::platform::event_loop::runner::impl$3::call_event_handler::closure_env$0<enum2$<eframe::native::run::UserEvent> > >
                               at /rustc/90c541806f23a127002de5b4038be731ba1458ca\library\core\src\panic\unwind_safe.rs:271
  28:     0x7ff608bb78ac - std::panicking::try::do_call<core::panic::unwind_safe::AssertUnwindSafe<winit::platform_impl::platform::event_loop::runner::impl$3::call_event_handler::closure_env$0<enum2$<eframe::native::run::UserEvent> > >,tuple$<> >
                               at /rustc/90c541806f23a127002de5b4038be731ba1458ca\library\std\src\panicking.rs:485
  29:     0x7ff608bbb4f3 - std::sync::mpmc::utils::impl$1::deref<std::sync::mpmc::list::Position<enum2$<eframe::native::run::UserEvent> > >
  30:     0x7ff608bb75fa - std::panicking::try<tuple$<>,core::panic::unwind_safe::AssertUnwindSafe<winit::platform_impl::platform::event_loop::runner::impl$3::call_event_handler::closure_env$0<enum2$<eframe::native::run::UserEvent> > > >
                               at /rustc/90c541806f23a127002de5b4038be731ba1458ca\library\std\src\panicking.rs:449
  31:     0x7ff608b8c939 - std::panic::catch_unwind<core::panic::unwind_safe::AssertUnwindSafe<winit::platform_impl::platform::event_loop::runner::impl$3::call_event_handler::closure_env$0<enum2$<eframe::native::run::UserEvent> > >,tuple$<> >
                               at /rustc/90c541806f23a127002de5b4038be731ba1458ca\library\std\src\panic.rs:140
  32:     0x7ff608bb962c - winit::platform_impl::platform::event_loop::runner::EventLoopRunner<enum2$<eframe::native::run::UserEvent> >::catch_unwind<enum2$<eframe::native::run::UserEvent>,tuple$<>,winit::platform_impl::platform::event_loop::runner::impl$3::call_event_handler::clos
                               at C:\Users\quinten\.cargo\registry\src\index.crates.io-6f17d22bba15001f\winit-0.28.3\src\platform_impl\windows\event_loop\runner.rs:157
  33:     0x7ff608bbaafb - winit::platform_impl::platform::event_loop::runner::EventLoopRunner<enum2$<eframe::native::run::UserEvent> >::call_event_handler<enum2$<eframe::native::run::UserEvent> >
                               at C:\Users\quinten\.cargo\registry\src\index.crates.io-6f17d22bba15001f\winit-0.28.3\src\platform_impl\windows\event_loop\runner.rs:242
  34:     0x7ff608bbb116 - winit::platform_impl::platform::event_loop::runner::EventLoopRunner<enum2$<eframe::native::run::UserEvent> >::call_redraw_events_cleared<enum2$<eframe::native::run::UserEvent> >
                               at C:\Users\quinten\.cargo\registry\src\index.crates.io-6f17d22bba15001f\winit-0.28.3\src\platform_impl\windows\event_loop\runner.rs:409
  35:     0x7ff608bb9dad - winit::platform_impl::platform::event_loop::runner::EventLoopRunner<enum2$<eframe::native::run::UserEvent> >::move_state_to<enum2$<eframe::native::run::UserEvent> >
                               at C:\Users\quinten\.cargo\registry\src\index.crates.io-6f17d22bba15001f\winit-0.28.3\src\platform_impl\windows\event_loop\runner.rs:358
  36:     0x7ff608bbaf27 - winit::platform_impl::platform::event_loop::runner::EventLoopRunner<enum2$<eframe::native::run::UserEvent> >::redraw_events_cleared<enum2$<eframe::native::run::UserEvent> >
                               at C:\Users\quinten\.cargo\registry\src\index.crates.io-6f17d22bba15001f\winit-0.28.3\src\platform_impl\windows\event_loop\runner.rs:234
  37:     0x7ff608bb4a24 - winit::platform_impl::platform::event_loop::thread_event_target_callback::closure$0<enum2$<eframe::native::run::UserEvent> >
                               at C:\Users\quinten\.cargo\registry\src\index.crates.io-6f17d22bba15001f\winit-0.28.3\src\platform_impl\windows\event_loop.rs:2371
  38:     0x7ff608b93457 - core::ops::function::FnOnce::call_once<winit::platform_impl::platform::event_loop::thread_event_target_callback::closure_env$0<enum2$<eframe::native::run::UserEvent> >,tuple$<> >
                               at /rustc/90c541806f23a127002de5b4038be731ba1458ca\library\core\src\ops\function.rs:250
  39:     0x7ff608ba2da1 - core::panic::unwind_safe::impl$23::call_once<isize,winit::platform_impl::platform::event_loop::thread_event_target_callback::closure_env$0<enum2$<eframe::native::run::UserEvent> > >
                               at /rustc/90c541806f23a127002de5b4038be731ba1458ca\library\core\src\panic\unwind_safe.rs:271
  40:     0x7ff608bb77f8 - std::panicking::try::do_call<core::panic::unwind_safe::AssertUnwindSafe<winit::platform_impl::platform::event_loop::thread_event_target_callback::closure_env$0<enum2$<eframe::native::run::UserEvent> > >,isize>
                               at /rustc/90c541806f23a127002de5b4038be731ba1458ca\library\std\src\panicking.rs:485
  41:     0x7ff608bbb4f3 - std::sync::mpmc::utils::impl$1::deref<std::sync::mpmc::list::Position<enum2$<eframe::native::run::UserEvent> > >
  42:     0x7ff608bb774b - std::panicking::try<isize,core::panic::unwind_safe::AssertUnwindSafe<winit::platform_impl::platform::event_loop::thread_event_target_callback::closure_env$0<enum2$<eframe::native::run::UserEvent> > > >
                               at /rustc/90c541806f23a127002de5b4038be731ba1458ca\library\std\src\panicking.rs:449
  43:     0x7ff608b8c8f1 - std::panic::catch_unwind<core::panic::unwind_safe::AssertUnwindSafe<winit::platform_impl::platform::event_loop::thread_event_target_callback::closure_env$0<enum2$<eframe::native::run::UserEvent> > >,isize>
                               at /rustc/90c541806f23a127002de5b4038be731ba1458ca\library\std\src\panic.rs:140
  44:     0x7ff608bb9235 - winit::platform_impl::platform::event_loop::runner::EventLoopRunner<enum2$<eframe::native::run::UserEvent> >::catch_unwind<enum2$<eframe::native::run::UserEvent>,isize,winit::platform_impl::platform::event_loop::thread_event_target_callback::closure_env$0
                               at C:\Users\quinten\.cargo\registry\src\index.crates.io-6f17d22bba15001f\winit-0.28.3\src\platform_impl\windows\event_loop\runner.rs:157
  45:     0x7ff608bb390c - winit::platform_impl::platform::event_loop::thread_event_target_callback<enum2$<eframe::native::run::UserEvent> >
                               at C:\Users\quinten\.cargo\registry\src\index.crates.io-6f17d22bba15001f\winit-0.28.3\src\platform_impl\windows\event_loop.rs:2547
  46:     0x7ffd84a48211 - DispatchMessageW
  47:     0x7ffd84a47ecc - DispatchMessageW
  48:     0x7ffd84a52ffd - GetClassLongW
  49:     0x7ffd85352d94 - KiUserCallbackDispatcher
  50:     0x7ffd82f41ad4 - NtUserDispatchMessage
  51:     0x7ffd84a47db4 - DispatchMessageW
  52:     0x7ff608ba9319 - winit::platform_impl::platform::event_loop::EventLoop<enum2$<eframe::native::run::UserEvent> >::run_return<enum2$<eframe::native::run::UserEvent>,eframe::native::run::run_and_return::closure_env$0<eframe::native::run::glow_integration::GlowWinitApp> >
                               at C:\Users\quinten\.cargo\registry\src\index.crates.io-6f17d22bba15001f\winit-0.28.3\src\platform_impl\windows\event_loop.rs:282
  53:     0x7ff608b91f7e - winit::platform::run_return::impl$0::run_return<enum2$<eframe::native::run::UserEvent>,eframe::native::run::run_and_return::closure_env$0<eframe::native::run::glow_integration::GlowWinitApp> >
                               at C:\Users\quinten\.cargo\registry\src\index.crates.io-6f17d22bba15001f\winit-0.28.3\src\platform\run_return.rs:51
  54:     0x7ff608bc2931 - eframe::native::run::run_and_return<eframe::native::run::glow_integration::GlowWinitApp>
                               at C:\Users\quinten\.cargo\registry\src\index.crates.io-6f17d22bba15001f\eframe-0.21.3\src\native\run.rs:124
  55:     0x7ff608bcfacf - eframe::native::run::glow_integration::run_glow::closure$0
                               at C:\Users\quinten\.cargo\registry\src\index.crates.io-6f17d22bba15001f\eframe-0.21.3\src\native\run.rs:994
  56:     0x7ff608bc2394 - eframe::native::run::with_event_loop::closure$0<enum2$<core::result::Result<tuple$<>,enum2$<eframe::Error> > >,eframe::native::run::glow_integration::run_glow::closure_env$0>
                               at C:\Users\quinten\.cargo\registry\src\index.crates.io-6f17d22bba15001f\eframe-0.21.3\src\native\run.rs:108
  57:     0x7ff608bb6195 - std::thread::local::LocalKey<core::cell::RefCell<enum2$<core::option::Option<winit::event_loop::EventLoop<enum2$<eframe::native::run::UserEvent> > > > > >::try_with<core::cell::RefCell<enum2$<core::option::Option<winit::event_loop::EventLoop<enum2$<eframe
                               at /rustc/90c541806f23a127002de5b4038be731ba1458ca\library\std\src\thread\local.rs:252
  58:     0x7ff608bb5c63 - std::thread::local::LocalKey<core::cell::RefCell<enum2$<core::option::Option<winit::event_loop::EventLoop<enum2$<eframe::native::run::UserEvent> > > > > >::with<core::cell::RefCell<enum2$<core::option::Option<winit::event_loop::EventLoop<enum2$<eframe::na
                               at /rustc/90c541806f23a127002de5b4038be731ba1458ca\library\std\src\thread\local.rs:228
  59:     0x7ff608bc21c8 - eframe::native::run::with_event_loop<enum2$<core::result::Result<tuple$<>,enum2$<eframe::Error> > >,eframe::native::run::glow_integration::run_glow::closure_env$0>
                               at C:\Users\quinten\.cargo\registry\src\index.crates.io-6f17d22bba15001f\eframe-0.21.3\src\native\run.rs:101
  60:     0x7ff608bcf829 - eframe::native::run::glow_integration::run_glow
                               at C:\Users\quinten\.cargo\registry\src\index.crates.io-6f17d22bba15001f\eframe-0.21.3\src\native\run.rs:991
  61:     0x7ff608b9164b - eframe::run_native
                               at C:\Users\quinten\.cargo\registry\src\index.crates.io-6f17d22bba15001f\eframe-0.21.3\src\lib.rs:201
  62:     0x7ff608744f47 - pineflash::main
                               at C:\Users\quinten\gitfiles\PineFlash\src\main.rs:507
  63:     0x7ff608762fcb - core::ops::function::FnOnce::call_once<void (*)(),tuple$<> >
                               at /rustc/90c541806f23a127002de5b4038be731ba1458ca\library\core\src\ops\function.rs:250
  64:     0x7ff608721aae - std::sys_common::backtrace::__rust_begin_short_backtrace<void (*)(),tuple$<> >
                               at /rustc/90c541806f23a127002de5b4038be731ba1458ca\library\std\src\sys_common\backtrace.rs:134
  65:     0x7ff608721aae - std::sys_common::backtrace::__rust_begin_short_backtrace<void (*)(),tuple$<> >
                               at /rustc/90c541806f23a127002de5b4038be731ba1458ca\library\std\src\sys_common\backtrace.rs:134
  66:     0x7ff6087674e1 - std::rt::lang_start::closure$0<tuple$<> >
                               at /rustc/90c541806f23a127002de5b4038be731ba1458ca\library\std\src\rt.rs:166
  67:     0x7ff608f8246e - core::ops::function::impls::impl$2::call_once
                               at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library\core\src\ops\function.rs:287
  68:     0x7ff608f8246e - std::panicking::try::do_call
                               at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library\std\src\panicking.rs:485
  69:     0x7ff608f8246e - std::panicking::try
                               at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library\std\src\panicking.rs:449
  70:     0x7ff608f8246e - std::panic::catch_unwind
                               at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library\std\src\panic.rs:140
  71:     0x7ff608f8246e - std::rt::lang_start_internal::closure$2
                               at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library\std\src\rt.rs:148
  72:     0x7ff608f8246e - std::panicking::try::do_call
                               at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library\std\src\panicking.rs:485
  73:     0x7ff608f8246e - std::panicking::try
                               at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library\std\src\panicking.rs:449
  74:     0x7ff608f8246e - std::panic::catch_unwind
                               at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library\std\src\panic.rs:140
  75:     0x7ff608f8246e - std::rt::lang_start_internal
                               at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library\std\src\rt.rs:148
  76:     0x7ff6087674ba - std::rt::lang_start<tuple$<> >
                               at /rustc/90c541806f23a127002de5b4038be731ba1458ca\library\std\src\rt.rs:165
  77:     0x7ff608745169 - main
  78:     0x7ff60906f060 - invoke_main
                               at D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:78
  79:     0x7ff60906f060 - __scrt_common_main_seh
                               at D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288
  80:     0x7ffd842626ad - BaseThreadInitThunk
  81:     0x7ffd8530aa68 - RtlUserThreadStart
error: process didn't exit successfully: `target\debug\pineflash.exe` (exit code: 101)
Quinten0508 commented 1 year ago

Quick question: where does PineFlash download the .bin firmware file(s) to? I cannot find any .bin files within the \target\release directory, even with PineFlash open and supposedly having downloaded them.

Spagett1 commented 1 year ago

Yes! Good to see some information I can work with, thanks a ton!

As for where it downloads stuff to it will be your systems temp folder. I use the std::env::temp_dir() function in rust which will go to your users temp folder.

I'd recommend just looking it up on the internet but if you still can't find it adding this to the update function println!("{:?}", std::env::temp_dir().to_str()) should work. I'm not at my computer rn so you may need to add a .unwrap() before the to_str(), the compiler should tell you.

Spagett1 commented 1 year ago

Honestly I should put the users std::env::temp_dir() in pineflashes log tab, probably be useful for debugging. I'll do that sometime.

Quinten0508 commented 1 year ago

Found the problem (at least, the one that solves the crashing whilst flashing). When compiling the program, there's no tools subdirectory with the blisp executable. Having used blisp manually as I couldn't get PineFlash to work, I just installed blisp into my program files (like /usr/bin on Linux) and added it to PATH. However, PineFlash never looks for a blisp in PATH, so it simply couldn't find it. Adding the tools subdirectory fixes the crashing. Doesn't quite flash yet, but I've had the same issue using blisp w/o PineFlash, so that's an unrelated issue I'm assuming.

Pineflash v0.5.1
PineFlash: Versions successfully fetched.
Pineflash: Pinecilv2 detected
PineFlash: Serial port is COM4 
PineFlash: Download of Language Info Complete.
PineFlash: Downloading Firmware Pinecilv2 v2.20.
PineFlash: Download Complete.
PineFlash: File extracted successfully
PineFlash: Attempting to flash Pinecilv2 with the firmware C:\Users\quinten\AppData\Local\Temp\v2.20-Pinecilv2\Pinecilv2_EN.bin
Blisp: Sending a handshake...
Received no response from chip.
Failed to handshake with device.

This still doesn't solve the original problem where PineFlash will crash upon launching though. Your pineflash.exe is around 50kb, while mine is 38kb. They're definitely not identical builds, even though they're being compiled for the same platform.

Spagett1 commented 1 year ago

Ah, yeah I forgot to mention the tools thing, the pineflash installer has blisp and dfu-util bundled with it.

As for the differences in built size if you are compiling from the master branch it's likely cause I've made quite a few changes to dependancies such as the file manager (it's now in-app not using the platform one) and some small changes. I'm wondering if the original issue has been solved by one of these updates to dependancies or if the offending crate was removed.

Spagett1 commented 1 year ago

As for the blisp error do you need to specify a serial port when flashing manually from the cli?

Spagett1 commented 1 year ago

On Linux and mac I manually specify this port however as windows doesn't work with the "everything is a file" mentality I ignored it as the person who tested the windows build at the time had no issues with it.

Quinten0508 commented 1 year ago

As for the blisp error do you need to specify a serial port when flashing manually from the cli?

I've tried specifying serial port COM4, same as what Pinecil detects, but gives the same error. Works fine on my mac though and seems to be blisp-related, nothing to do with PineFlash (seems like the same issue as #44?)

edit: and here I thought I was being smart by not mentioning the issue but linking to it to avoid necroposting, whatever.

Quinten0508 commented 1 year ago

If this does end up being PineFlash related, it's best to open a new issue. This one's on PineFlash crashing shortly after launch on Windows.

Spagett1 commented 1 year ago

Yeah this seems to be a blisp issue.

It seems likely that the issue with it closing shortly after opening on windows has been fixed though after some of the recent changes in the source code.

Janik-Haag commented 1 year ago

I'm getting a simmiilar error on linux (linux/nixos/wayland/sway) where it starts fine for the first time and crashes if i start it again after that.

With Rustbacktrace:

thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', src/main.rs:280:60
stack backtrace:
   0: rust_begin_unwind
   1: core::panicking::panic_fmt
   2: core::panicking::panic
   3: <pineflash::Flasher as eframe::epi::App>::update
   4: eframe::native::epi_integration::EpiIntegration::update
   5: <eframe::native::run::glow_integration::GlowWinitApp as eframe::native::run::WinitApp>::paint
   6: eframe::native::run::run_and_return::{{closure}}
   7: winit::platform_impl::platform::wayland::event_loop::EventLoop<T>::run_return
   8: eframe::native::run::run_and_return
   9: std::thread::local::LocalKey<T>::with
  10: eframe::native::run::glow_integration::run_glow
  11: eframe::run_native
  12: pineflash::main
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
warning: queue 0x55dd5def32d0 destroyed while proxies still attached:
  wl_buffer@20 still attached
  wl_shm_pool@33 still attached
  xdg_wm_base@23 still attached
  wl_output@14 still attached
  wl_seat@13 still attached
  xdg_activation_v1@12 still attached
  wp_viewporter@11 still attached
  zwp_text_input_manager_v3@10 still attached
  zwp_pointer_constraints_v1@9 still attached
  zwp_relative_pointer_manager_v1@8 still attached
  zxdg_decoration_manager_v1@7 still attached
  wl_subcompositor@6 still attached
  wl_compositor@5 still attached
  wl_shm@4 still attached
  wl_registry@2 still attached
Spagett1 commented 1 year ago

Hi @Janik-Haag, I've moved your issue to #57 as it seems to be a separate problem to me.