thimc / vifmimg

Image previews for Vifm (vi file manager) using Überzug
GNU General Public License v3.0
242 stars 26 forks source link

vifm consistently crashing after closing background process error popup #36

Closed mark2185 closed 2 years ago

mark2185 commented 2 years ago

I can consistently make it crash by doing the following:

1. Open vifm using vifmrun, as per instructions
2. :view
3. Position cursor over a video file
4. Open the video using l (or right arrow key) (builtin mapping)
5. Close the video
6. Close the background process error popup either via <CR> or Esc or <C-C>
7. Crash

Minimal vifmrc:

fileviewer <video/*>
    \ vifmimg video %px %py %pw %ph %c
    \ %pc
    \ vifmimg clear

filetype <video/*> mpv %c &

I don't see if there are any logs, and I'm not certain how to run it all under gdb.

mark2185 commented 2 years ago

I managed to get something out:

vifm: background.c:224: bg_check: Assertion `bg_jobs == NULL && "Job list shouldn't be used by anyone."' failed.
/usr/bin/vifmrun: line 21: 1778844 Aborted         (core dumped) vifm "$@" 3>&-
zoj613 commented 2 years ago

Mine randomly crashes too when I try preview images using the e or w keys in vifm.

PRESFIL commented 2 years ago

You might want to try the fresh commits (6 hours ago).

Or create an issue at vifm/vifm. It doesn't seem like this is a vifmimg problem.

zoj613 commented 2 years ago

You might want to try the fresh commits (6 hours ago).

Or create an issue at vifm/vifm. It doesn't seem like this is a vifmimg problem.

You might want to try the fresh commits (6 hours ago).

Or create an issue at vifm/vifm. It doesn't seem like this is a vifmimg problem.

I just downloaded the latest commit on master, I will report back to see if anything changes. I doubt that this is a vifm/vifm problem because it only ever occurs when I try to preview images using vifmimg

PRESFIL commented 2 years ago

Judging by error message, vifm is crashing. Even if it is because of vifmimg, it is not vifm ready for such a case.

Besides, it is an assert, specifically to catch such cases.

zoj613 commented 2 years ago

Judging by error message, vifm is crashing. Even if it is because of vifmimg, it is not vifm ready for such a case.

Besides, it is an assert, specifically to catch such cases.

To be clear, im not OP. I have no error message when vifm crashes on image preview. It just freezes forever until I have to kill and restart the app.

PRESFIL commented 2 years ago

Sorry my fault, I was looking at the post @mark2185's message.

Then you may have a different reason. I sometimes also have something similar to yours. vifmimg clear hangs and vifm waits for it to complete. But this usually happens when the ueberzug is dead. There is nobody to subtract the message from FIFO_UEBERZUG.

zoj613 commented 2 years ago

Sorry my fault, I was looking at the post @mark2185's message.

Then you may have a different reason. I sometimes also have something similar to yours. vifmimg clear hangs and vifm waits for it to complete. But this usually happens when the ueberzug is dead. There is nobody to subtract the message from FIFO_UEBERZUG.

Oh okay, im glad im not the only one experiencing such an issue. any ideas for a workaround?

PRESFIL commented 2 years ago

Nope. A named pipe is better than a regular pipe because it is possible to recreate a channel if it is cut off. But I don’t have the ability to catch this case, it is very rare.

Probably enough wait or trap to wait for ueberzug to succeed.

mark2185 commented 2 years ago

You might want to try the fresh commits (6 hours ago).

Or create an issue at vifm/vifm. It doesn't seem like this is a vifmimg problem.

It seems to be gone, I'll close this and reopen if need be.

Thanks!