strawberrymusicplayer / strawberry

:strawberry: Strawberry Music Player
https://www.strawberrymusicplayer.org/
GNU General Public License v3.0
2.7k stars 184 forks source link

Segmentation fault when playing tracks with non-latin characters in title #752

Closed njbalete closed 3 years ago

njbalete commented 3 years ago

As the title says, when I play certain tracks from the playlist, Strawberry crashes due to a segmentation fault.

The tracks that trigger a segfault are those with titles that use non-latin characters (in particular, CJK characters and Japanese kana). Tracks with non-Latin characters only in the Artist or Album fields but not in the Title are unaffected.

bt output:

#0  0x00005555557fc9a0 in ContextAlbumsModel::ItemFromSong(CollectionItem::Type, bool, CollectionItem*, Song const&, int) ()                                                                      
#1  0x00005555557fcd2a in ContextAlbumsModel::AddSongs(QList<Song> const&) ()
#2  0x00005555557fdbb0 in ContextView::SetSong() ()
#3  0x00005555557ffb2e in ContextView::SongChanged(Song const&) ()
#4  0x00007ffff65605c7 in  () at /lib/x86_64-linux-gnu/libQt5Core.so.5
#5  0x0000555555aca839 in PlaylistManagerInterface::CurrentSongChanged(Song) ()
#6  0x000055555588e8eb in QtPrivate::QSlotObject<void (PlaylistManagerInterface::*)(Song), QtPrivate::List<Song>, void>::impl(int, QtPrivate::QSlotObjectBase*, QObject*, void**, bool*) ()       
#7  0x00007ffff65605c7 in  () at /lib/x86_64-linux-gnu/libQt5Core.so.5
#8  0x000055555585ef18 in Playlist::InformOfCurrentSongChange(Playlist::AutoScroll, bool) ()
#9  0x000055555584f6ae in Playlist::set_current_row(int, Playlist::AutoScroll, bool, bool) ()
#10 0x00005555557a4dfa in Player::PlayAt(int, long long, QFlags<Engine::TrackChangeType>, Playlist::AutoScroll, bool, bool) ()                                                                    
#11 0x0000555555788c07 in MainWindow::PlaylistDoubleClick(QModelIndex const&) ()
#12 0x00007ffff65605c7 in  () at /lib/x86_64-linux-gnu/libQt5Core.so.5
#13 0x00007ffff7897e69 in QAbstractItemView::doubleClicked(QModelIndex const&) ()
    at /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#14 0x00007ffff791632b in QTreeView::mouseDoubleClickEvent(QMouseEvent*) ()
    at /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#15 0x00007ffff7663f71 in QWidget::event(QEvent*) () at /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#16 0x00007ffff7711b32 in QFrame::event(QEvent*) () at /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#17 0x00007ffff652852b in QCoreApplicationPrivate::sendThroughObjectEventFilters(QObject*, QEvent*) () at /lib/x86_64-linux-gnu/libQt5Core.so.5                                                   
#18 0x00007ffff7620772 in QApplicationPrivate::notify_helper(QObject*, QEvent*) ()
--Type <RET> for more, q to quit, c to continue without paging--c
    at /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#19 0x00007ffff7627e5b in QApplication::notify(QObject*, QEvent*) () at /lib/x86_64-linux-gnu/libQt5Widgets.so.5                                                                                  
#20 0x00007ffff65287ba in QCoreApplication::notifyInternal2(QObject*, QEvent*) () at /lib/x86_64-linux-gnu/libQt5Core.so.5                                                                        
#21 0x00007ffff7626e77 in QApplicationPrivate::sendMouseEvent(QWidget*, QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer<QWidget>&, bool, bool) () at /lib/x86_64-linux-gnu/libQt5Widgets.so.5                                                                                                
#22 0x00007ffff767d370 in  () at /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#23 0x00007ffff7680615 in  () at /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#24 0x00007ffff7620783 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /lib/x86_64-linux-gnu/libQt5Widgets.so.5                                                                    
#25 0x00007ffff65287ba in QCoreApplication::notifyInternal2(QObject*, QEvent*) () at /lib/x86_64-linux-gnu/libQt5Core.so.5                                                                        
#26 0x00007ffff6f2d764 in QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::MouseEvent*) () at /lib/x86_64-linux-gnu/libQt5Gui.so.5                                        
#27 0x00007ffff6f028cc in QWindowSystemInterface::sendWindowSystemEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /lib/x86_64-linux-gnu/libQt5Gui.so.5                                        
#28 0x00007fffeb296a6e in  () at /lib/x86_64-linux-gnu/libQt5XcbQpa.so.5
#29 0x00007ffff58a68eb in g_main_context_dispatch () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#30 0x00007ffff58f9d28 in  () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#31 0x00007ffff58a4023 in g_main_context_iteration () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#32 0x00007ffff6582204 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /lib/x86_64-linux-gnu/libQt5Core.so.5                                                  
#33 0x00007ffff652711b in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () at /lib/x86_64-linux-gnu/libQt5Core.so.5                                                                     
#34 0x00007ffff652f604 in QCoreApplication::exec() () at /lib/x86_64-linux-gnu/libQt5Core.so.5
#35 0x0000555555766a78 in main ()
jonaski commented 3 years ago

I think this is a general null pointer crash when you have the context albums enabled and there is more than one album for the artist, so it's showing the albums. It's caused by a recent commit.

jonaski commented 3 years ago

Try updating to the latest commit and see if the crash is gone now.

njbalete commented 3 years ago

Yep, it's not crashing any more. Thanks!