spotify-player icon indicating copy to clipboard operation
spotify-player copied to clipboard

tui freezes when closing as a scratchpad

Open a1fishie opened this issue 2 years ago • 10 comments

I have the spotify_player app integrated as a scratchpad as i find them very useful, my only problem with it so far is that it freezes when i hide the scratchpad and reopen it again. Closing the scratchpad completely (with my kill keybind) makes it so that spotify_player won't launch again until i perform a reboot of my system image

Image above shows me trying to launch it through the terminal (kitty) Installed from cargo with lyric and image feature on Arch with kernel 5.19.8

a1fishie avatar Sep 14 '22 18:09 a1fishie

I have the spotify_player app integrated as a scratchpad as i find them very useful, my only problem with it so far is that it freezes when i hide the scratchpad and reopen it again

I'm not really familiar with the scratchpad concept. Would you mind to further elaborate?

Also, if possible, can you include the log and backtrace of the app when freezing as described in https://github.com/aome510/spotify-player#logging?

aome510 avatar Sep 15 '22 01:09 aome510

I have the spotify_player app integrated as a scratchpad as i find them very useful, my only problem with it so far is that it freezes when i hide the scratchpad and reopen it again

I'm not really familiar with the scratchpad concept. Would you mind to further elaborate?

Yeah so, a scratchpad is basically a toggleable window in a window manager ( I use xmonad) , you press a keybind - it opens/closes and it functions like any other program, currently I have spotify-player in one as I find it useful. https://hackage.haskell.org/package/xmonad-contrib-0.17.0/docs/XMonad-Util-NamedScratchpad.html < Link to more information

Also, if possible, can you include the log and backtrace of the app when freezing as described in https://github.com/aome510/spotify-player#logging?

https://pastebin.com/NnbfFFPa https://pastebin.com/cR0fhePH

a1fishie avatar Sep 15 '22 07:09 a1fishie

https://pastebin.com/NnbfFFPa https://pastebin.com/cR0fhePH

Thanks. However, I couldn't find anything wrong with the log. Can you record a screen of the freezing case?

I'm not familiar with xmonad, so not sure if the issue is related to spotify_player.

aome510 avatar Sep 15 '22 14:09 aome510

Excuse the white noise. I don't think its something to do with xmonad since both btop, and spotify-tui work just fine

https://user-images.githubusercontent.com/104651507/190434872-ddb76f4e-6a2b-42f0-84d0-15cc379bbb4d.mp4

a1fishie avatar Sep 15 '22 14:09 a1fishie

I don't think the above video works for me

aome510 avatar Sep 15 '22 16:09 aome510

https://user-images.githubusercontent.com/104651507/190622551-e8232842-f17d-4d51-b3ef-d9a0a565f1c9.mp4

Does this one work for you?

Edit: Excuse the white noise, no clue whats causing it

a1fishie avatar Sep 16 '22 10:09 a1fishie

I don't think it's the problem with Spotify-player. I use it as a scratchpad in LeftWM and Qtile and everything works fine.

elkrien avatar Sep 16 '22 12:09 elkrien

Thanks @elkrien for additional input.

@a1fishie the above video works for me. My best guest is that the reopening the scratchpad requires the app to re-communicate with kitty for image rendering. However, the communicate part is only done upon startup, so kitty won't be able to process the new request hence the freeze. I encountered a similar freeze before when first integrating image rendering.

So to confirm this behaviour, @a1fishie can you try to run the app without image feature and maybe, with image feature but in a terminal other than kitty?

aome510 avatar Sep 16 '22 12:09 aome510

Without image seemingly fixes the issue, thank you

a1fishie avatar Sep 16 '22 18:09 a1fishie

@a1fishie thanks for the confirmation. I think it's possible to fix the issue with image feature and kitty for scratchpad. Just leave this issue as open, so we can track that.

aome510 avatar Sep 16 '22 18:09 aome510

I've got the same issue (i guess), and running strace shows that it seems to hang on opening temp files:

...
openat(AT_FDCWD, "/tmp/.tmp.viuer.p", O_RDWR|O_CREAT|O_EXCL|O_CLOEXEC, 0600) = -1 EEXIST (File exists)
openat(AT_FDCWD, "/tmp/.tmp.viuer.R", O_RDWR|O_CREAT|O_EXCL|O_CLOEXEC, 0600) = -1 EEXIST (File exists)
openat(AT_FDCWD, "/tmp/.tmp.viuer.d", O_RDWR|O_CREAT|O_EXCL|O_CLOEXEC, 0600) = -1 EEXIST (File exists)
...

This goes on for a random sequence of numbers and letters. Maybe some cleanup didn't run? Removing all those files resolved the issue for me

Haven't got time to see what spotify-players logging reports, maybe I can check that later/the next time this issue appears

AntonHermann avatar Nov 25 '22 16:11 AntonHermann

hi @AntonHermann, thanks for reporting. Just want to clarify, did u also use scratchpad as described in the initial discussion in this issue or did u encounter a freeze in general, which may be a result of a potential deadlock?

aome510 avatar Nov 25 '22 22:11 aome510

No, for me it happened in a regular kitty window

AntonHermann avatar Nov 25 '22 23:11 AntonHermann

Got it, thanks for the clarification. I guess the cause can be a subtle concurrent bug. I can take a look when I'm less busy. In the meantime, hope that this doesn't happen too frequently. Any further details to help reproduce the bug is also appreciated.

aome510 avatar Nov 26 '22 04:11 aome510