clementine-player / Clementine

:tangerine: Clementine Music Player
https://www.clementine-player.org/
GNU General Public License v3.0
3.72k stars 671 forks source link

clementine crashes after a few minutes play in shuffle mode. #6309

Open phands opened 5 years ago

phands commented 5 years ago

Before posting

Please follow the steps below and check the boxes with [x] once you did the step.

System information

Zotac ZBox E1750, Quad Core i7, 16G RAM, 2x 1Tb SSD

Expected behaviour / actual behaviour

Exoected: Clementine plays shuffled tracks continuously. Actual: Clementine crashes after a few songs in shuffle mode. Time before crash varies, but is usually around a half-hour. The crash is repeated across logins and reboots.

Steps to reproduce the problem (only for bugs)

Invoke Clementine, run playlist of whole library in shuffle mode.

I did gdb clementine, and the traceback is attached.
clem-crash.txt

jbroadus commented 5 years ago

In the output from GDB, did clementine run for ~30 minutes before crashing? I'm just wondering if the QFSFileEngine::open messages are related.

I see an unhandled error condition in GstEnginePipeline that could cause something like this, but I would expect to see a different gstreamer error. I'll submit a patch for it just in case.

phands commented 5 years ago

Hi Jim,

Clementine often runs for only a few minutes before the crash, and sometimes for up to a half hour. Of late, it's crashing quickly, often at the end of the first track I play. It does seem that the crash only occurs when playing a song, or at the end, when going to the next track, but I haven't got good evidence for that. Let me know if you want me to try anything.

Paul

jbroadus commented 5 years ago

Hi Paul. Could you try running clementine with the gstreamer debug message level increased? This assumes that gstreamer in Ubuntu is built with debug enabled.

GST_DEBUG=4 clementine

phands commented 5 years ago

Hi Jim,

I've restarted with GST debug at 4 as requested. I'm getting tens of thousands of lines like....

0:02:29.966252913 19213 0x563183723400 INFO GST_STATES gstbin.c:2087:gst_bin_get_state_func: getting state 0:02:30.005929407 19213 0x563183723400 INFO GST_STATES gstbin.c:2087:gst_bin_get_state_func: getting state 0:02:30.045389059 19213 0x563183723400 INFO GST_STATES gstbin.c:2087:gst_bin_get_state_func: getting state 0:02:30.085827810 19213 0x563183723400 INFO GST_STATES gstbin.c:2087:gst_bin_get_state_func: getting state 0:02:30.126167133 19213 0x563183723400 INFO GST_STATES gstbin.c:2087:gst_bin_get_state_func: getting state 0:02:30.165925903 19213 0x563183723400 INFO GST_STATES gstbin.c:2087:gst_bin_get_state_func: getting state 0:02:30.205600685 19213 0x563183723400 INFO GST_STATES gstbin.c:2087:gst_bin_get_state_func: getting state 0:02:30.245299178 19213 0x563183723400 INFO GST_STATES gstbin.c:2087:gst_bin_get_state_func: getting state 0:02:30.285895478 19213 0x563183723400 INFO GST_STATES gstbin.c:2087:gst_bin_get_state_func: getting state 0:02:30.325692349 19213 0x563183723400 INFO GST_STATES gstbin.c:2087:gst_bin_get_state_func: getting state 0:02:30.366242279 19213 0x563183723400 INFO GST_STATES gstbin.c:2087:gst_bin_get_state_func: getting state 0:02:30.409650356 19213 0x563183723400 INFO GST_STATES gstbin.c:2087:gst_bin_get_state_func: getting state 0:02:30.445291636 19213 0x563183723400 INFO GST_STATES gstbin.c:2087:gst_bin_get_state_func: getting state 0:02:30.486034747 19213 0x563183723400 INFO GST_STATES gstbin.c:2087:gst_bin_get_state_func: getting state 0:02:30.526271283 19213 0x563183723400 INFO GST_STATES gstbin.c:2087:gst_bin_get_state_func: getting state 0:02:30.565989286 19213 0x563183723400 INFO GST_STATES gstbin.c:2087:gst_bin_get_state_func: getting state 0:02:30.605938075 19213 0x563183723400 INFO GST_STATES gstbin.c:2087:gst_bin_get_state_func: getting state 0:02:30.645405750 19213 0x563183723400 INFO GST_STATES gstbin.c:2087:gst_bin_get_state_func: getting state 0:02:30.685791705 19213 0x563183723400 INFO GST_STATES gstbin.c:2087:gst_bin_get_state_func: getting state 0:02:30.726278080 19213 0x563183723400 INFO GST_STATES gstbin.c:2087:gst_bin_get_state_func: getting state

It's playing a song normally even as these are emitted. It also just transitioned to a new song without crashing. Any log file from this is liable to be huge.

I may do a shell stdout and stderr redirect to file, and attach that to the ticket.

P

On Sun, Mar 24, 2019 at 1:02 PM Jim Broadus notifications@github.com wrote:

Hi Paul. Could you try running clementine with the gstreamer debug message level increased? This assumes that gstreamer in Ubuntu is built with debug enabled.

GST_DEBUG=4 clementine

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/clementine-player/Clementine/issues/6309#issuecomment-475978364, or mute the thread https://github.com/notifications/unsubscribe-auth/AEQutH_sG1aYMtfVJbAjSxIjrpU_twKqks5vZ6-YgaJpZM4b5-0x .

jbroadus commented 5 years ago

Hey Paul. That GST_STATES message that's filling the log only displays when the clementine window is open. If you close it so it's just running in the docked mode, then it should be much quieter.

phands commented 5 years ago

Ah....just got a crash at 27minutes 21 seconds. The log file by then is 275M, but I can just cut the last section from a few seconds before - the above messages?

P

On Sun, Mar 24, 2019 at 4:07 PM Jim Broadus notifications@github.com wrote:

Hey Paul. That GST_STATES message that's filling the log only displays when the clementine window is open. If you close it so it's just running in the docked mode, then it should be much quieter.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/clementine-player/Clementine/issues/6309#issuecomment-475994883, or mute the thread https://github.com/notifications/unsubscribe-auth/AEQutFQdEfhfUxk62p7ayUokGkKqJKtMks5vZ9scgaJpZM4b5-0x .

phands commented 5 years ago

Ok - Attached is a cut-down version of the full file - only 223kb.

I obtained it using...... GST_DEBUG=4 clementine &> clementine_stdout_and_stderr_outfile

so the file is both stderr and stdout. If you need separate files for stdout and stderr, I can change the redirects.

The crash occurred at 27minutes and 21 seconds. I included the last part of 27minutes 20 seconds, which is the GST_STATES messages as before, followed by the crash itself.

clementine_stdout_and_stderr_outfile-27-20-21.txt

jbroadus commented 5 years ago

Hmm. It fails to open "/home/phands/Music/iTunes/the Stone Roses/The Stone Roses/04 Waterfall.mp3" (good choice, by the way) several times for the crash. Seems like reproing that might be a key. Anything interesting about the security context, etc. of the file or directory?

phands commented 5 years ago

Hi Jim,

Can you check that pathname? There is no subdirectory of iTunes called 'the Stone Roses' - there is no music in the iTunes directory whatsoever, just some metadata....

phands@Zotac:~/Music/iTunes$ ls -al total 300 drwxrwxrwx 4 phands phands 4096 Feb 5 19:34 . drwxrwxr-x 170 phands phands 4096 Feb 5 19:31 .. drwxrwxrwx 7 phands phands 4096 Feb 5 19:31 'Album Artwork' -rwxrwxrwx 1 phands phands 16384 Feb 5 19:31 'iTunes Library Extras.itdb' -rwxrwxrwx 1 phands phands 32768 Feb 5 19:31 'iTunes Library Genius.itdb' -rwxrwxrwx 1 phands phands 234140 Feb 5 19:34 'iTunes Library.itl' drwxrwxrwx 3 phands phands 4096 Feb 5 19:31 'iTunes Media' -rwxrwxrwx 1 phands phands 8 Feb 5 19:31 sentinel

Also, that track is found at....

ls -l '/home/phands/Music/Stone Roses/The Stone Roses/04 Waterfall.mp3' -rwxrwxrwx 1 phands phands 3469199 Oct 31 2015 '/home/phands/Music/Stone Roses/The Stone Roses/04 Waterfall.mp3'

Note that the parent directory under Music is called "Stone Roses", not "the Stone Roses". Has Clementine somehow mis-indexed the library? Trying to open a non-existent file would certainly fail, but probably shouldn't segfault the program :-)

And, yes - good choice!! I love the Stone Roses.

Regards,

P

On Mon, Mar 25, 2019 at 12:18 AM Jim Broadus notifications@github.com wrote:

Hmm. It fails to open "/home/phands/Music/iTunes/the Stone Roses/The Stone Roses/04 Waterfall.mp3" (good choice, by the way) several times for the crash. Seems like reproing that might be a key. Anything interesting about the security context, etc. of the file or directory?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/clementine-player/Clementine/issues/6309#issuecomment-476049583, or mute the thread https://github.com/notifications/unsubscribe-auth/AEQutHI1NcIhq8QTT0xKsPv4JpsSuE9pks5vaE33gaJpZM4b5-0x .

jbroadus commented 5 years ago

Okay, that's interesting. I created a playlist, moved the files to a different directly, then played the shuffled playlist. Seems that the library rescans but the playlist has stale data. When I try to play the list, I get a log of gstreamer errors similar, but not identical, to yours. After running through the playlist a few times, I get a glib error about "Too many open files"

I'm still confused about the iTunes path issue, but I think the same think we've discovered a resource leak that's causing the crash.

A couple more questions regarding iTunes - Is there a native app now, or are you running iTunes under wine? Are there music files under the subdirectories that you listed? I wonder if iTunes reorganized their directory structure at some point.

Thanks, Jim

phands commented 5 years ago

Hi again,

Good to know we've found something....

There is no native iTunes, and WINE is still unable to make any version of iTunes work, and Crossover is equally unable to support it. The iTunes directory is there because I was storing the Music on a shared NAS drive, which allowed iTunes to use it over the network for both Mac and windows

  1. I just copied the entire directory to my Linux box, as KDE Neon is not too reliable on network file sharing. There are no actual music files in the iTunes directory at all.

Let me know if I can do anything else to help.

P

On Mon, Mar 25, 2019 at 5:54 PM Jim Broadus notifications@github.com wrote:

Okay, that's interesting. I created a playlist, moved the files to a different directly, then played the shuffled playlist. Seems that the library rescans but the playlist has stale data. When I try to play the list, I get a log of gstreamer errors similar, but not identical, to yours. After running through the playlist a few times, I get a glib error about "Too many open files"

I'm still confused about the iTunes path issue, but I think the same think we've discovered a resource leak that's causing the crash.

A couple more questions regarding iTunes - Is there a native app now, or are you running iTunes under wine? Are there music files under the subdirectories that you listed? I wonder if iTunes reorganized their directory structure at some point.

Thanks, Jim

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/clementine-player/Clementine/issues/6309#issuecomment-476392509, or mute the thread https://github.com/notifications/unsubscribe-auth/AEQutF86zS9dJC8mEztOSse6NqrYpCcoks5vaUWOgaJpZM4b5-0x .

jbroadus commented 5 years ago

I submitted a pull request to address the fd leak: https://github.com/clementine-player/Clementine/pull/6314

JulianVolodia commented 4 years ago

Dear @phands

since PR made by @jbroadus is merged into master (long time) I wonder if you could check if it helps and close this issue ticket.

Kind regards. :-)