Spotifyd / spotifyd

A spotify daemon
https://spotifyd.rs
GNU General Public License v3.0
9.81k stars 449 forks source link

coredump when listing available playlists #29

Closed dorneanu closed 8 years ago

dorneanu commented 8 years ago

Hi! First thank you for such a great tool. I'm experiencing some issue when using sc pl (list available playlists). I've started the daemon and issued sc pl and got:

Process 28017 (spotifyd) of user 1000 dumped core.
   Stack trace of thread 28017:
   #0  0x00007f894b3bc009 n/a (libspotify.so.12)
   #1  0x00007f894b3bc3ea sp_link_as_string (libspotify.so.12)
   #2  0x000000000040710c playlist_to_str (spotifyd)
   #3  0x0000000000406ad5 playlist_get_name (spotifyd)
   #4  0x000000000040658a command_pl (spotifyd)
   #5  0x0000000000404f33 commandq_execute_command (spotifyd)
   #6  0x0000000000404be1 commandq_execute_front (spotifyd)
   #7  0x00000000004081cf main (spotifyd)
   #8  0x00007f894a97a610 __libc_start_main (libc.so.6)
   #9  0x0000000000403079 _start (spotifyd)

   Stack trace of thread 28018:
   #0  0x00007f894ad0b07f pthread_cond_wait@@GLIBC_2.3.2 (libpthread.so.0)
   #1  0x0000000000405c5c audio_get (spotifyd)
   #2  0x000000000040381c alsa_audio_start (spotifyd)
   #3  0x00007f894ad054a4 start_thread (libpthread.so.0)
   #4  0x00007f894aa4313d __clone (libc.so.6)

   Stack trace of thread 28020:
   #0  0x00007f894aa3a18d poll (libc.so.6)
   #1  0x00007f894b397317 n/a (libspotify.so.12)
   #2  0x00007f894b39778d n/a (libspotify.so.12)
   #3  0x00007f894b2d108d n/a (libspotify.so.12)
   #4  0x00007f894ad054a4 start_thread (libpthread.so.0)
   #5  0x00007f894aa4313d __clone (libc.so.6)

   Stack trace of thread 28019:
   #0  0x00007f894ad0d2d7 do_futex_wait.constprop.1 (libpthread.so.0)
   #1  0x00007f894ad0d384 __new_sem_wait_slow.constprop.0 (libpthread.so.0)
   #2  0x00007f894b3171f8 n/a (libspotify.so.12)
   #3  0x00007f894b2d108d n/a (libspotify.so.12)
   #4  0x00007f894ad054a4 start_thread (libpthread.so.0)
   #5  0x00007f894aa4313d __clone (libc.so.6)

   Stack trace of thread 28022:
   #0  0x00007f894ad0e17d accept (libpthread.so.0)
   #1  0x0000000000405a4e sock_accept_connections_un (spotifyd)
   #2  0x00007f894ad054a4 start_thread (libpthread.so.0)
   #3  0x00007f894aa4313d __clone (libc.so.6)

   Stack trace of thread 28023:
   #0  0x00007f894ad0e17d accept (libpthread.so.0)
   #1  0x0000000000405abc sock_accept_connections_ip (spotifyd)
   #2  0x00007f894ad054a4 start_thread (libpthread.so.0)
   #3  0x00007f894aa4313d __clone (libc.so.6)

Apparently there is some problems with the name of same playlist:

Stack trace of thread 28017:
    #0  0x00007f894b3bc009 n/a (libspotify.so.12)
    #1  0x00007f894b3bc3ea sp_link_as_string (libspotify.so.12)
    #2  0x000000000040710c playlist_to_str (spotifyd)
    #3  0x0000000000406ad5 playlist_get_name (spotifyd)

Any ideas? Thanks in advance.

SimonTeixidor commented 8 years ago

Could you link the playlist? I'll see if I can reproduce the error. I wonder if the playlist has a really long name or something?

dorneanu commented 8 years ago

sc pl gives:

0 | 2015 - 7th Halloween | spotify:user:1147875594:playlist:4iNPpqXDagFFRFOVWbT3RI | PLAYLIST
1 | 2015 Halloween | spotify:user:1147875594:playlist:2pWHAk170QEaGNzOvBlaIw | PLAYLIST
2 | Starred | spotify:user:1147875594:playlist:5ozYDSNIBi5sLitCWZeqtp | PLAYLIST
3 | Lollapalooza Berlin 2015 | spotify:user:lollapaloozafestival:playlist:0ItLvZmKCfHd8YiqzEfbUS | PLAYLIST
4 | Sommerhits 2015 | spotify:user:spotify_germany:playlist:6TOnH0hbIqWqv5kFLadxir | PLAYLIST
5 | Discover Weekly | spotify:user:spotifydiscover:playlist:3y2xxd9f09vWk8Dasp9pTe | PLAYLIST
6 | 90s Techno | spotify:user:thr4x:playlist:6TtbbB7c1IoFaAg2zA2kip | PLAYLIST
7 | Victors Party | spotify:user:1147875594:playlist:4MHkXOs1wfUMdc3cwEfKcO | PLAYLIST
8 | Salsaton | spotify:user:1117937798:playlist:1h3qRMLNyAMEc8yN3iP9Mk | PLAYLIST
9 | Salsa LA | spotify:user:essa1:playlist:3RvJ3PKclQOJD2Xx2a0Sv3 | PLAYLIST
10 | Sam Smith – In The Lonely Hour (Deluxe Edition) | spotify:user:1147875594:playlist:1fGXxLCkjg1SmX2e0VnlUK | PLAYLIST
11 | Trip Hop / Chill / Instrumental Hip-hop / Ambient / Beats | spotify:user:desiballer798:playlist:5HzTvPxvGL1V0LYJpULEZA | PLAYLIST
12 | Trance Life | spotify:user:spotify:playlist:20OmnJiCBUgP23z5g1xlqx | PLAYLIST
13 | Piano Ballads | spotify:user:spotify:playlist:7urGFUTDExzJDxSX3Jd6OO | PLAYLIST
14 | Hip Hop & R&B Remixes | spotify:user:12127089228:playlist:018la5i6aXKR9OIr0YtTPh | PLAYLIST
15 | Party | spotify:user:sarah_isabell:playlist:1TcdG0jcJj3CJ7ww3WYXtQ | PLAYLIST
16 | Electro Jazz & Swing | spotify:user:chris.pappo:playlist:1Wx9I2fNdPMch92AwdenLB | PLAYLIST
17 | Mash-Ups | spotify:user:spotify:playlist:099Sv0ZNow3fneOd1kJ7uR | PLAYLIST
18 | Trap | spotify:user:1123128593:playlist:2MgBM50uGiV0UUrlUnOiTR | PLAYLIST
19 | Deutschland, Deine Rapper | spotify:user:spotify_germany:playlist:2IRfaveBNCSkqNJ2Waf0Lx | PLAYLIST
20 | Old School Party | spotify:user:michellekadir:playlist:34max3McbbzvwaVdv3RaBp | PLAYLIST
21 | E's Hip Hop Party Mix | spotify:user:erikmcl:playlist:1jSEaJumIK6pVIDGR9G7k6 | PLAYLIST
22 | Summer Party | spotify:user:spotify:playlist:103Zi2NG06F9qimASDrszv | PLAYLIST
23 | Macklemore & Ryan Lewis – The Heist | spotify:user:1147875594:playlist:46NCPIxqarZdO2SxUI3jO0 | PLAYLIST
24 | Are & Be | spotify:user:spotify:playlist:06CemleTteSalaVGVMbgFy | PLAYLIST
25 | chillstep | spotify:user:122228558:playlist:3608ZmAGDQg6GaohTWtPcK | PLAYLIST
26 | Sensuality (deep & soulful house) | spotify:user:1131151543:playlist:7iVWRiZqi3dkLAYwceDOaB | PLAYLIST
27 | Various Artists — SubSoul, Vol. 2: Deep House, Garage & Bass Music | spotify:user:1147875594:playlist:18EODFl4FK8QLW02MBfpmn | PLAYLIST
28 | Top 100 tracks currently on Spotify | spotify:user:spotify:playlist:4hOKQuZbraPDIfaGbM3lKI | PLAYLIST

So it crashed/stoped af the 28th playlist. Looking at my Spotify client I've found that after that I have 2 folders:

Spotify Screenshot

Maybe that's the problem?

SimonTeixidor commented 8 years ago

That is probably the problem, yes!

I pushed a quick fix, it should simply skip the folders. A proper fix would obviously be to handle folders somehow but I don't really have time to investigate that right now. See if this works for you!

dorneanu commented 8 years ago

Oh, that was quick! I've tested it and sc pl will pseudo-skip the folders. I think it rather show the playlists inside the folders with some empty ones:

74 | Gemischt | spotify:user:1147875594:playlist:13QZC8d7mhCyxL8UaNRKaI | PLAYLIST
75 | 
76 | 
77 | 2015 Best of Summer | spotify:user:1147875594:playlist:5SDO4ccJ74HdGz5W1rcFbR | PLAYLIST
78 | 
79 | 
80 | 
81 | 
82 | 
83 | 
84 | Soul 'n' The City | spotify:user:spotify_netherlands:playlist:2cmtcp7GIIhma4sWqLiQnG | PLAYLIST
85 | 

Well this is ok for me. Thanks for the support!

SimonTeixidor commented 8 years ago

I pushed another commit so that the empty lines should be skipped as well. As it seems to work for you, I'll close this for now. Thanks for reporting the bug!

dorneanu commented 8 years ago

Well.. With the last commit, only 28 playlist are being shown (all playlists before the folders). I guess I'll rather prefer all playlists to be shown (including the empty ones)....

SimonTeixidor commented 8 years ago

Ahh! New commit, I hope it's fixed now :)

dorneanu commented 8 years ago

Nope :) One should debug that properly. I think I'll revert to your head-2 commit :D that worked for me..

SimonTeixidor commented 8 years ago

Well... I reverted back to the point where it worked for you. I'll investigate it properly one day :)

dorneanu commented 8 years ago

Cool. I could also have a look at the code and provide you some PR. I think this project is very interesting and promising.