Skip to content
New issue

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

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

Already on GitHub? # to your account

Crash when clicking URL-encoded path to local file #381

Closed
n8henrie opened this issue Jan 10, 2025 · 2 comments · Fixed by #390
Closed

Crash when clicking URL-encoded path to local file #381

n8henrie opened this issue Jan 10, 2025 · 2 comments · Fixed by #390

Comments

@n8henrie
Copy link

I have a pdf file with parentheses in its filename.

Clicking links to this file crash inlyne, regardless of how I escape them.

For example, the below crash report was using URL encoding the spaces and parentheses (which works with several other markdown viewers). I've also tried escaping the parens with \( / \) and just leaving them plain. Various markdown renderers handle this differently.

Some renderers support delimiting the URL with <> (e.g. [here](<url>)) but this also crashes.

Markdown:

---
title: Chase Statements for Chase Visa (...1234) 2013-05-16.pdf
updated: 2013-05-22 08:42:30Z
created: 2013-05-22 08:42:30Z
tags:
  - Chase
  - Chase Statements for Chase Visa (...1234)
  - FileThis
---

[Chase Statements for Chase Visa (...1234) 2013-05-16.pdf](../_resources/Chase%20Statements%20for%20Chase%20Visa%20%28...1234%29%202013-05-16.pdf)

[Chase Statements for Chase Visa (...1234) 2013-05-16.pdf](../_resources/Chase Statements for Chase Visa (...1234) 2013-05-16.pdf)

[Chase Statements for Chase Visa (...1234) 2013-05-16.pdf](<../_resources/Chase Statements for Chase Visa (...1234) 2013-05-16.pdf>)

[Chase Statements for Chase Visa (...1234) 2013-05-16.pdf](<../_resources/Chase Statements for Chase Visa %28...1234%29 2013-05-16.pdf>)

<!--Chase Statements for Chase Visa (...1234) 2013-05-16.pdf-->

Crash log:

"name" = "inlyne"
"operating_system" = "Mac OS 15.2.0 [64-bit]"
"crate_version" = "0.4.3"
"explanation" = """
Panic occurred in file 'src/main.rs' at line 542
"""
"cause" = 'called `Result::unwrap()` on an `Err` value: Custom { kind: Other, error: "Launcher \"/usr/bin/open\" \"../_resources/Chase%20Statements%20for%20Chase%20Visa%20%28...1234%29%202013-05-16.pdf\" failed with ExitStatus(unix_wait_status(256))" }'
"method" = "Panic"
"backtrace" = """

   0: 0x1039ce2e8 - _rust_begin_unwind
   1: 0x103a43924 - core::panicking::panic_fmt::h43c21d3ca19f8fab
   2: 0x103a43ca0 - core::result::unwrap_failed::hda095bf691f21d50
   3: 0x102fb9d94 - inlyne::Inlyne::run::{{closure}}::h1085071d98550c63
   4: 0x1030217d8 - <winit::platform_impl::platform::app_state::EventLoopHandler<T> as winit::platform_impl::platform::app_state::EventHandler>::handle_nonuser_event::h42ee991903fb90eb
   5: 0x10364156c - winit::platform_impl::platform::app_state::Handler::handle_nonuser_event::hbce584b1f63f6f50
   6: 0x1036430d0 - winit::platform_impl::platform::app_state::AppState::cleared::hf286df0c17ac6634
   7: 0x103649698 - winit::platform_impl::platform::observer::control_flow_end_handler::hde5db437555ce778
   8: 0x187f8bbd8 - <unresolved>
   9: 0x187f8bac4 - <unresolved>
  10: 0x187f8b194 - <unresolved>
  11: 0x187f8a724 - <unresolved>
  12: 0x1934e2530 - <unresolved>
  13: 0x1934e8348 - <unresolved>
  14: 0x1934e8508 - <unresolved>
  15: 0x18baf5034 - <unresolved>
  16: 0x18c4592d4 - <unresolved>
  17: 0x18bae8060 - <unresolved>
  18: 0x102fb067c - winit::platform_impl::platform::event_loop::EventLoop<T>::run::h0ec8fa2906a1d615
  19: 0x102fbb3c4 - inlyne::main::hd3a52ee3e3e935f4
  20: 0x102faa3ec - std::sys::backtrace::__rust_begin_short_backtrace::hf955c313fd0e5089
  21: 0x102fda060 - std::rt::lang_start::{{closure}}::h315947712dfa3e6d
  22: 0x1039c9e64 - std::rt::lang_start_internal::h60914846c59a19a9
  23: 0x102fbb5f4 - _main"""
@CosmicHorrorDev
Copy link
Collaborator

Do you still experience this on the latest release (0.5.0)? The crash should at the very least be relaxed to a logged warning, but there was also a change that fixed opening relative file paths which may have fixed the issue entirely

@n8henrie
Copy link
Author

n8henrie commented Feb 7, 2025

Correct, no further crashes.

Now, all of the above test cases do nothing in the UI, and output in the logs:

$ inlyne test.md
2025-02-07T03:54:08.601195Z ERROR inlyne: Could not open link: Launcher "/usr/bin/open" "../_resources/Chase%20Statements%20for%20Chase%20Visa%20(...1695)%202013-05-16.pdf" failed with ExitStatus(unix_wait_status(256)) from Ok("/Users/n8henrie/Desktop/tmp/joplin/My Notes")

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants