himalaya icon indicating copy to clipboard operation
himalaya copied to clipboard

Panic with `message reply` sometimes

Open jesse-c opened this issue 1 year ago • 2 comments

I was able to reply to a message earlier. I tried another now, and got a panic. Nothing appears special about it vs the other email. Here's some debug info. If I can provide any more information, please let me know!

Version:

himalaya --version
himalaya v1.1.0 +smtp +sendmail +wizard +imap +pgp-commands +maildir
build: macos  aarch64
git: nix-flake-20250111144424, rev 5632fdac3b1ca386b37957c772f288c5fc953a3a

Debug logs:

himalaya --debug message reply 0000 "XXXX"
2025-04-15T14:28:42.140322Z  INFO himalaya::email::message::command::reply: executing reply message command
2025-04-15T14:28:42.140404Z DEBUG email::imap: building 1 IMAP clients
2025-04-15T14:28:42.233489Z DEBUG client::build: rustls::client::hs: No cached session for DnsName("imap.mail.me.com")
2025-04-15T14:28:42.233552Z DEBUG client::build: rustls::client::hs: Not resuming any session
2025-04-15T14:28:42.326093Z DEBUG client::build: rustls::client::hs: Using ciphersuite TLS13_AES_256_GCM_SHA384
2025-04-15T14:28:42.326131Z DEBUG client::build: rustls::client::tls13: Not resuming
2025-04-15T14:28:42.326256Z DEBUG client::build: rustls::client::tls13: TLS1.3 encrypted extensions: []
2025-04-15T14:28:42.326265Z DEBUG client::build: rustls::client::hs: ALPN protocol is None
2025-04-15T14:28:42.547701Z DEBUG client::build: email::imap: using password authentication
2025-04-15T14:28:42.547740Z  INFO client::build: process::command: run shell command cmd="echo \"yaff-vwvv-maza-yxbo\""
2025-04-15T14:28:42.547748Z DEBUG client::build: process::command: inherit stdin from parent
2025-04-15T14:28:42.547755Z DEBUG client::build: process::command: stdout piped
2025-04-15T14:28:42.547759Z DEBUG client::build: process::command: stderr piped
2025-04-15T14:28:42.558354Z DEBUG client::build: process::command: shell command gracefully exited code=0
2025-04-15T14:28:42.558374Z DEBUG client::build: email::imap: supported auth mechanisms mechanisms=[Other(AuthMechanismOther(Atom("ATOKEN"))), Plain, Other(AuthMechanismOther(Atom("ATOKEN2"))), XOAuth2]
2025-04-15T14:28:42.558388Z DEBUG client::build: email::imap: trying auth mechanism… mechanism=Other(AuthMechanismOther(Atom("ATOKEN")))
2025-04-15T14:28:42.558391Z DEBUG client::build: email::imap: trying auth mechanism… mechanism=Plain
2025-04-15T14:28:43.014376Z DEBUG client::build: email::imap: authentication succeeded! mechanism=Plain
2025-04-15T14:28:43.014560Z  INFO email::smtp: building new smtp context
2025-04-15T14:28:43.014627Z  INFO process::command: run shell command cmd="echo \"yaff-vwvv-maza-yxbo\""
2025-04-15T14:28:43.014635Z DEBUG process::command: inherit stdin from parent
2025-04-15T14:28:43.014864Z DEBUG process::command: stdout piped
2025-04-15T14:28:43.014870Z DEBUG process::command: stderr piped
2025-04-15T14:28:43.024297Z DEBUG process::command: shell command gracefully exited code=0
2025-04-15T14:28:43.700255Z DEBUG rustls::client::hs: No cached session for DnsName("smtp.mail.me.com")
2025-04-15T14:28:43.700487Z DEBUG rustls::client::hs: Not resuming any session
2025-04-15T14:28:43.778492Z DEBUG rustls::client::hs: Using ciphersuite TLS13_AES_256_GCM_SHA384
2025-04-15T14:28:43.778527Z DEBUG rustls::client::tls13: Not resuming
2025-04-15T14:28:43.779567Z DEBUG rustls::client::tls13: TLS1.3 encrypted extensions: []
2025-04-15T14:28:43.779584Z DEBUG rustls::client::hs: ALPN protocol is None
2025-04-15T14:28:44.427465Z  INFO email::email::message::get::imap: getting messages 160917 from folder INBOX
2025-04-15T14:28:44.427524Z DEBUG email::imap: client 1/1 is free, locking it
2025-04-15T14:28:44.427542Z DEBUG email::email::message::get::imap: utf7 encoded folder: INBOX
2025-04-15T14:28:44.626018Z  WARN select_mailbox{client=1}: imap_codec::response: Rectified missing `text` to "..."
2025-04-15T14:28:44.626083Z  WARN select_mailbox{client=1}: imap_codec::response: Rectified missing `text` to "..."
2025-04-15T14:28:44.626092Z  WARN select_mailbox{client=1}: imap_codec::response: Rectified missing `text` to "..."
2025-04-15T14:28:44.626119Z  WARN select_mailbox{client=1}: imap_codec::response: Rectified missing `text` to "..."
2025-04-15T14:28:45.043676Z DEBUG email::email::utils: local draft path: /var/folders/sn/jwxlp9dd6d315j7rmblgr37m0000gn/T/himalaya-draft.eml
> A draft was found, what would you like to do with it? Edit it
2025-04-15T14:28:48.328359Z DEBUG email::email::utils: local draft path: /var/folders/sn/jwxlp9dd6d315j7rmblgr37m0000gn/T/himalaya-draft.eml
2025-04-15T14:28:48.329478Z DEBUG email::email::utils: local draft path: /var/folders/sn/jwxlp9dd6d315j7rmblgr37m0000gn/T/himalaya-draft.eml
2025-04-15T14:28:48.329492Z DEBUG pimalaya_tui::himalaya::editor: create draft
2025-04-15T14:28:48.330213Z DEBUG pimalaya_tui::himalaya::editor: open editor
2025-04-15T14:28:48.330247Z  INFO process::command: run shell command cmd="nvim /var/folders/sn/jwxlp9dd6d315j7rmblgr37m0000gn/T/himalaya-draft.eml"
2025-04-15T14:28:48.330256Z DEBUG process::command: inherit stdin from parent
2025-04-15T14:28:48.330263Z DEBUG process::command: inherit stdout from parent
2025-04-15T14:28:48.330267Z DEBUG process::command: inherit stderr from parent
2025-04-15T14:28:50.085535Z DEBUG process::command: shell command gracefully exited code=0
2025-04-15T14:28:50.085549Z DEBUG pimalaya_tui::himalaya::editor: read draft
> What would you like to do with this message? Send it
Sending message…
2025-04-15T14:28:52.689827Z  INFO email::email::message::send::smtp: sending smtp message
2025-04-15T14:28:53.734406Z  INFO email::email::message::add::imap: adding imap message to folder Sent with flags seen
2025-04-15T14:28:53.734438Z DEBUG email::imap: client 1/1 is free, locking it
2025-04-15T14:28:53.734450Z DEBUG email::email::message::add::imap: utf7 encoded folder: Sent Messages
The application panicked (crashed).
Message:  called `Option::unwrap()` on a `None` value
Location: /private/tmp/nix-build-himalaya-static-aarch64-apple-darwin-1.0.0.drv-0/cargo-vendor-dir/imap-client-0.2.3/src/tasks/mod.rs:174

  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ SPANTRACE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

   0: email::imap::add_message with client=1
      at /private/tmp/nix-build-himalaya-static-aarch64-apple-darwin-1.0.0.drv-0/cargo-vendor-dir/email-lib-0.26.4/src/imap/mod.rs:720

Traces:

2025-04-15T14:33:00.972657Z TRACE add_message{client=1}: imap_client::tasks: enqueue task command=Command { tag: Tag("0.4.QtdOzQfH"), body: Append { mailbox: Other(MailboxOther(String(Quoted(Quoted("Sent Messages"))))), flags: [Seen], date: None, message: Literal8(Literal8 { data: b"MIME-Version: 1.0\r\nFrom: \"XXXX\" <XXXX@XXXX>\r\nTo: \"XXXX\" <XXXX@XXXX>\r\nIn-Reply-To: <XXXX@XXXX>\r\nSubject: XXXX\r\nMessage-ID: <XXXX>\r\nDate: Tue, 15 Apr 2025 14:32:58 +0000\r\nContent-Type: text/plain; charset=\"utf-8\"\r\nContent-Transfer-Encoding: XXXX", mode: Sync }) } }
2025-04-15T14:33:00.973160Z TRACE add_message{client=1}: imap_client::stream: wrote 53/53 bytes
2025-04-15T14:33:01.050424Z TRACE add_message{client=1}: imap_client::stream: read 30/1024 bytes
The application panicked (crashed).
Message:  called `Option::unwrap()` on a `None` value
Location: /private/tmp/nix-build-himalaya-static-aarch64-apple-darwin-1.0.0.drv-0/cargo-vendor-dir/imap-client-0.2.3/src/tasks/mod.rs:174

  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ SPANTRACE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

   0: email::imap::add_message with client=1
      at /private/tmp/nix-build-himalaya-static-aarch64-apple-darwin-1.0.0.drv-0/cargo-vendor-dir/email-lib-0.26.4/src/imap/mod.rs:720

  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ BACKTRACE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
                                ⋮ 8 frames hidden ⋮
   9: core::panicking::panic::hee236ca94fc05047
      at <unknown source file>:<unknown line>
  10: core::option::unwrap_failed::h187ebe480b20e6be
      at <unknown source file>:<unknown line>
  11: imap_client::tasks::Scheduler::progress::h93c65263ebbb0e8d
      at <unknown source file>:<unknown line>
  12: <imap_client::tasks::resolver::ResolvingTask<T> as imap_next::State>::next::h09cefb99babb5ea4
      at <unknown source file>:<unknown line>
  13: imap_client::client::tokio::Client::appenduid_or_fallback::{{closure}}::h38c1151601a871a1
      at <unknown source file>:<unknown line>
  14: <tokio::time::timeout::Timeout<T> as core::future::future::Future>::poll::heab258ca98bd81d6
      at <unknown source file>:<unknown line>
  15: <tracing::instrument::Instrumented<T> as core::future::future::Future>::poll::h6a63791058cd3c11
      at <unknown source file>:<unknown line>
  16: <email::email::message::add::imap::AddImapMessage as email::email::message::add::AddMessage>::add_message_with_flags::{{closure}}::h92ab3d5dc4489fd0
      at <unknown source file>:<unknown line>
  17: <email::backend::Backend<C> as email::email::message::add::AddMessage>::add_message_with_flags::{{closure}}::hcc87e1ac71064a87
      at <unknown source file>:<unknown line>
  18: email::email::message::add::AddMessage::add_message_with_flag::{{closure}}::h2ff7b9d45960468d
      at <unknown source file>:<unknown line>
  19: email::email::message::send::SendMessageThenSaveCopy::send_message_then_save_copy::{{closure}}::h9dd9bed2354e3646
      at <unknown source file>:<unknown line>
  20: pimalaya_tui::himalaya::backend::Backend::send_message_then_save_copy::{{closure}}::hfaddc23f26fabcf4
      at <unknown source file>:<unknown line>
  21: pimalaya_tui::himalaya::editor::edit_tpl_with_editor::{{closure}}::h8be8495fb8e817ae
      at <unknown source file>:<unknown line>
  22: himalaya::email::message::command::MessageSubcommand::execute::{{closure}}::he27a4028ca29cc93
      at <unknown source file>:<unknown line>
  23: himalaya::cli::HimalayaCommand::execute::{{closure}}::h4fc5e945b8b073c0
      at <unknown source file>:<unknown line>
  24: tokio::runtime::park::CachedParkThread::block_on::hf2a5c379d3c63ff1
      at <unknown source file>:<unknown line>
  25: tokio::runtime::context::runtime::enter_runtime::h6ec0b8e871b12f4c
      at <unknown source file>:<unknown line>
  26: himalaya::main::hfc1ea765de404f5b
      at <unknown source file>:<unknown line>
  27: std::sys::backtrace::__rust_begin_short_backtrace::hc91fe96da3ba6a4d
      at <unknown source file>:<unknown line>
  28: std::rt::lang_start::{{closure}}::ha0347c895f2567d1
      at <unknown source file>:<unknown line>
  29: std::rt::lang_start_internal::h9e88109c8deb8787
      at <unknown source file>:<unknown line>
  30: _main<unknown>
      at <unknown source file>:<unknown line>

jesse-c avatar Apr 15 '25 14:04 jesse-c

This is really surprising, I never encountered this particular panic. I see exactly where it panics, but I don't get why. I propose you the following: I am still refactoring libs one by one, from low level till up, and the IMAP is on the way. Let's wait for the refactor and see how it improves this particular issue.

soywod avatar Apr 16 '25 11:04 soywod

Sounds reasonable to me! Thanks for your work on maintaining and improving all of the libraries.

On 16 Apr 2025, at 12:21, Clément DOUIN @.***> wrote:

soywod left a comment (pimalaya/himalaya#573) This is really surprising, I never encountered this particular panic. I see exactly where it panics, but I don't get why. I propose you the following: I am still refactoring libs one by one, from low level till up, and the IMAP is on the way. Let's wait for the refactor and see how it improves this particular issue.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.

https://github.com/pimalaya/himalaya/issues/573#issuecomment-2809267291 https://github.com/notifications/unsubscribe-auth/AAKXF3ATVO57H42O27RYVOT2ZY4KTAVCNFSM6AAAAAB3F2C4QGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDQMBZGI3DOMRZGE

soywod left a comment (pimalaya/himalaya#573) https://github.com/pimalaya/himalaya/issues/573#issuecomment-2809267291 This is really surprising, I never encountered this particular panic. I see exactly where it panics, but I don't get why. I propose you the following: I am still refactoring libs one by one, from low level till up, and the IMAP is on the way. Let's wait for the refactor and see how it improves this particular issue.

— Reply to this email directly, view it on GitHub https://github.com/pimalaya/himalaya/issues/573#issuecomment-2809267291, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAKXF3ATVO57H42O27RYVOT2ZY4KTAVCNFSM6AAAAAB3F2C4QGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDQMBZGI3DOMRZGE. You are receiving this because you authored the thread.

jesse-c avatar Apr 16 '25 23:04 jesse-c