yazi: Closing a file opened in micro after a long time crashes main thread.

What system are you running Yazi on?

Linux Wayland

What terminal are you running Yazi in?

foot version: 1.16.2 +pgo +ime +graphemes -assertions

Yazi version

yazi 0.1.5 (63f81f6 2024-01-03)

Did you try the latest main branch to see if the problem has already been fixed?

Tried, but the problem is still present

Describe the bug

Closing a file opened in micro after a long time leads to:

The application panicked (crashed).
  index out of bounds: the len is 19459 but the index is 19673
in /home/max/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ratatui-0.25.0/src/buffer.rs, line 229
thread: main

This happened consistently on 2 files that I opened at roughly the same time. I think this time the culprit is, that I left the files open for quite a long time, at least half an hour, as editing and closing files quickly does not lead to this crash.

This is similar to #456, but as it seems time-based it might be a buffer overflow type issue, as buffer.rs is mentioned.

Expected Behavior

No crash, por favor.

To Reproduce

See above.

Configuration

No response

Anything else?

No response

About this issue

  • Original URL
  • State: closed
  • Created 6 months ago
  • Comments: 23 (10 by maintainers)

Commits related to this issue

Most upvoted comments

Never mind, I just enjoy solving problems and relishing the process 😉

I pushed new code to that PR. Please try it out to see if it works.

This is the terminal output. In hindsight, your PR was not necessary. It was my fault for not correctly understanding my systems package management tools, which lead to the debug binary never being added to my systems packages, which is why I never got any verbose output. So that was never your fault. Sorry for wasting time and effort.

Wow this is a perfect log, let me try to fix it!