Bug 351166

Summary: When searching for tags on MusicBrainz, Amarok crashes for several specific files
Product: amarok Reporter: yorrd.adornis
Component: Metadata Editing and ReadingAssignee: Amarok Developers <amarok-bugs-dist>
Status: RESOLVED DUPLICATE    
Severity: crash CC: 123kash, dhd1, kde.626483
Priority: NOR    
Version: 2.8.0   
Target Milestone: 2.9   
Platform: Archlinux Packages   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: log output
New crash information added by DrKonqi
New crash information added by DrKonqi

Description yorrd.adornis 2015-08-10 18:42:54 UTC
So I'm trying to automatically update my tags and searching for them on MusicBrainz with the dialog in the context menu of songs in the playlist. It properly detects the songs before the bad one and then - once it reaches the one song - crashes with no further notice.

In the console (--debug --nofork), I found this line at the end (the rest seemed pretty O.K.):

pa_write() failed while trying to wake up the mainloop: Bad file descriptor

Bad file descriptor makes me guess it's because my mp3 is broken. 

1) this should still be a bug because Amarok should not crash
2) what in my mp3 is the issue here?

Reproducible: Always

Steps to Reproduce:
1. autocomplete tags
2. fails for one song

Actual Results:  
crash 

Expected Results:  
proper tags being found and presented

none
Comment 1 Myriam Schweingruber 2015-08-10 20:46:19 UTC
We need a backtrace for this crash, please compile amarok with debugging enabled and provide a backtrace directly in the comments.
the line you indicate a the possible crash point is rather unlikely, as pulseaudio is not involved in tag editing.
Are you sure the crash happens on this one file or is it just the crash happens at the end of the procedure? Is the track part of an album? If yes, how is it different compared to the other tracks of the album?
Comment 2 yorrd.adornis 2015-08-10 22:59:15 UTC
Created attachment 93978 [details]
log output
Comment 3 yorrd.adornis 2015-08-10 23:23:27 UTC
I hope the log helps. It's from Amarok with --debug and the debug option enabled while debugging.

Yes you're right, this line does not appear every time.

It always happens on one file, it never happens for other files. It does NOT happen at the end of the procedure but rather probably while it processes that one song. It just crashes in the middle of it. It is not part of an Album, it is a single album, so I can't tell you how it compares to the rest. 

If you have ideas what to look for, I could try to figure out what it is. But with no starting point, there's no way for me to figure out where the difference is.
Comment 4 yorrd.adornis 2015-08-11 00:28:24 UTC
backtrace:

#0  0x00007ffff51c9961 in QReadWriteLock::lockForRead() () from /usr/lib/libQtCore.so.4
#1  0x00007ffff7767a41 in ?? () from /usr/lib/libamaroklib.so.1
#2  0x00007ffff79793f5 in ?? () from /usr/lib/libamaroklib.so.1
#3  0x00007ffff797d675 in ?? () from /usr/lib/libamaroklib.so.1
#4  0x00007ffff5e0ac6b in QSortFilterProxyModel::flags(QModelIndex const&) const () from /usr/lib/libQtGui.so.4
#5  0x00007ffff5dc4fcb in QTreeView::drawRow(QPainter*, QStyleOptionViewItem const&, QModelIndex const&) const () from /usr/lib/libQtGui.so.4
#6  0x00007ffff5dc867b in QTreeView::drawTree(QPainter*, QRegion const&) const () from /usr/lib/libQtGui.so.4
#7  0x00007ffff5dcc316 in QTreeView::paintEvent(QPaintEvent*) () from /usr/lib/libQtGui.so.4
#8  0x00007ffff58a2c20 in QWidget::event(QEvent*) () from /usr/lib/libQtGui.so.4
#9  0x00007ffff5c68dfe in QFrame::event(QEvent*) () from /usr/lib/libQtGui.so.4
#10 0x00007ffff5d8e6a3 in QAbstractItemView::viewportEvent(QEvent*) () from /usr/lib/libQtGui.so.4
#11 0x00007ffff5dd009c in QTreeView::viewportEvent(QEvent*) () from /usr/lib/libQtGui.so.4
#12 0x00007ffff52de6c6 in QCoreApplicationPrivate::sendThroughObjectEventFilters(QObject*, QEvent*) () from /usr/lib/libQtCore.so.4
#13 0x00007ffff584c37c in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib/libQtGui.so.4
#14 0x00007ffff58531f6 in QApplication::notify(QObject*, QEvent*) () from /usr/lib/libQtGui.so.4
#15 0x00007ffff6acd85a in KApplication::notify(QObject*, QEvent*) () from /usr/lib/libkdeui.so.5
#16 0x00007ffff52de55d in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /usr/lib/libQtCore.so.4
#17 0x00007ffff589d277 in QWidgetPrivate::drawWidget(QPaintDevice*, QRegion const&, QPoint const&, int, QPainter*, QWidgetBackingStore*) ()
   from /usr/lib/libQtGui.so.4
#18 0x00007ffff589dc8f in QWidgetPrivate::paintSiblingsRecursive(QPaintDevice*, QList<QObject*> const&, int, QRegion const&, QPoint const&, int, QPainter*, QWidgetBackingStore*) () from /usr/lib/libQtGui.so.4
#19 0x00007ffff589db93 in QWidgetPrivate::paintSiblingsRecursive(QPaintDevice*, QList<QObject*> const&, int, QRegion const&, QPoint const&, int, QPainter*, QWidgetBackingStore*) () from /usr/lib/libQtGui.so.4
#20 0x00007ffff589ce06 in QWidgetPrivate::drawWidget(QPaintDevice*, QRegion const&, QPoint const&, int, QPainter*, QWidgetBackingStore*) ()
   from /usr/lib/libQtGui.so.4
#21 0x00007ffff589dc8f in QWidgetPrivate::paintSiblingsRecursive(QPaintDevice*, QList<QObject*> const&, int, QRegion const&, QPoint const&, int, QPainter*, QWidgetBackingStore*) () from /usr/lib/libQtGui.so.4
#22 0x00007ffff589db93 in QWidgetPrivate::paintSiblingsRecursive(QPaintDevice*, QList<QObject*> const&, int, QRegion const&, QPoint const&, int, QPainter*, QWidgetBackingStore*) () from /usr/lib/libQtGui.so.4
#23 0x00007ffff589db93 in QWidgetPrivate::paintSiblingsRecursive(QPaintDevice*, QList<QObject*> const&, int, QRegion const&, QPoint const&, int, QPainter*, QWidgetBackingStore*) () from /usr/lib/libQtGui.so.4
#24 0x00007ffff589ce06 in QWidgetPrivate::drawWidget(QPaintDevice*, QRegion const&, QPoint const&, int, QPainter*, QWidgetBackingStore*) ()
   from /usr/lib/libQtGui.so.4
#25 0x00007ffff589dc8f in QWidgetPrivate::paintSiblingsRecursive(QPaintDevice*, QList<QObject*> const&, int, QRegion const&, QPoint const&, int, QPainter*, QWidgetBackingStore*) () from /usr/lib/libQtGui.so.4
#26 0x00007ffff589ce06 in QWidgetPrivate::drawWidget(QPaintDevice*, QRegion const&, QPoint const&, int, QPainter*, QWidgetBackingStore*) ()
   from /usr/lib/libQtGui.so.4
#27 0x00007ffff5a6d8f2 in ?? () from /usr/lib/libQtGui.so.4
#28 0x00007ffff588ff90 in QWidgetPrivate::syncBackingStore() () from /usr/lib/libQtGui.so.4
#29 0x00007ffff58a2d08 in QWidget::event(QEvent*) () from /usr/lib/libQtGui.so.4
#30 0x00007ffff584c39c in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib/libQtGui.so.4
#31 0x00007ffff58531f6 in QApplication::notify(QObject*, QEvent*) () from /usr/lib/libQtGui.so.4
#32 0x00007ffff6acd85a in KApplication::notify(QObject*, QEvent*) () from /usr/lib/libkdeui.so.5
#33 0x00007ffff52de55d in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /usr/lib/libQtCore.so.4
#34 0x00007ffff52e19e6 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () from /usr/lib/libQtCore.so.4
#35 0x00007ffff530e703 in ?? () from /usr/lib/libQtCore.so.4
#36 0x00007fffecda89fd in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
#37 0x00007fffecda8ce0 in ?? () from /usr/lib/libglib-2.0.so.0
#38 0x00007fffecda8d8c in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#39 0x00007ffff530e854 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#40 0x00007ffff58f53b6 in ?? () from /usr/lib/libQtGui.so.4
#41 0x00007ffff52dcdd1 in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#42 0x00007ffff52dd145 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#43 0x00007ffff52e2af9 in QCoreApplication::exec() () from /usr/lib/libQtCore.so.4
#44 0x0000000000407306 in ?? ()
#45 0x00007ffff4a3e790 in __libc_start_main () from /usr/lib/libc.so.6
#46 0x0000000000407409 in _start ()
Comment 5 yorrd.adornis 2015-08-11 01:38:21 UTC
hopefully more useful:

#0  0x00007ffff5161961 in QReadWriteLock::lockForRead() () from /usr/lib/libQtCore.so.4
#1  0x00007ffff770c341 in QReadLocker::relock (this=0x7fffffffcaf0) at /usr/include/qt4/QtCore/qreadwritelock.h:111
#2  0x00007ffff7929e55 in MusicBrainzTagsItem::childCount (this=0x0)
    at /tmp/makepkg/amarok-git/src/amarok-git/src/musicbrainz/MusicBrainzTagsItem.cpp:216
#3  0x00007ffff792e115 in MusicBrainzTagsModel::flags (this=0x3791140, index=...)
    at /tmp/makepkg/amarok-git/src/amarok-git/src/musicbrainz/MusicBrainzTagsModel.cpp:210
#4  0x00007ffff5da2c6b in QSortFilterProxyModel::flags(QModelIndex const&) const () from /usr/lib/libQtGui.so.4
#5  0x00007ffff5d5cfcb in QTreeView::drawRow(QPainter*, QStyleOptionViewItem const&, QModelIndex const&) const () from /usr/lib/libQtGui.so.4
#6  0x00007ffff5d6067b in QTreeView::drawTree(QPainter*, QRegion const&) const () from /usr/lib/libQtGui.so.4
#7  0x00007ffff5d64316 in QTreeView::paintEvent(QPaintEvent*) () from /usr/lib/libQtGui.so.4
#8  0x00007ffff583ac20 in QWidget::event(QEvent*) () from /usr/lib/libQtGui.so.4
#9  0x00007ffff5c00dfe in QFrame::event(QEvent*) () from /usr/lib/libQtGui.so.4
#10 0x00007ffff5d266a3 in QAbstractItemView::viewportEvent(QEvent*) () from /usr/lib/libQtGui.so.4
#11 0x00007ffff5d6809c in QTreeView::viewportEvent(QEvent*) () from /usr/lib/libQtGui.so.4
#12 0x00007ffff52766c6 in QCoreApplicationPrivate::sendThroughObjectEventFilters(QObject*, QEvent*) () from /usr/lib/libQtCore.so.4
#13 0x00007ffff57e437c in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib/libQtGui.so.4
#14 0x00007ffff57eb1f6 in QApplication::notify(QObject*, QEvent*) () from /usr/lib/libQtGui.so.4
#15 0x00007ffff6a6585a in KApplication::notify(QObject*, QEvent*) () from /usr/lib/libkdeui.so.5
#16 0x00007ffff527655d in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /usr/lib/libQtCore.so.4
#17 0x00007ffff5835277 in QWidgetPrivate::drawWidget(QPaintDevice*, QRegion const&, QPoint const&, int, QPainter*, QWidgetBackingStore*) ()
   from /usr/lib/libQtGui.so.4
#18 0x00007ffff5a05898 in ?? () from /usr/lib/libQtGui.so.4
#19 0x00007ffff5827f90 in QWidgetPrivate::syncBackingStore() () from /usr/lib/libQtGui.so.4
#20 0x00007ffff583ad08 in QWidget::event(QEvent*) () from /usr/lib/libQtGui.so.4
#21 0x00007ffff57e439c in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib/libQtGui.so.4
#22 0x00007ffff57eb1f6 in QApplication::notify(QObject*, QEvent*) () from /usr/lib/libQtGui.so.4
#23 0x00007ffff6a6585a in KApplication::notify(QObject*, QEvent*) () from /usr/lib/libkdeui.so.5
#24 0x00007ffff527655d in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /usr/lib/libQtCore.so.4
#25 0x00007ffff52799e6 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () from /usr/lib/libQtCore.so.4
#26 0x00007ffff52a6703 in ?? () from /usr/lib/libQtCore.so.4
---Type <return> to continue, or q <return> to quit---
#27 0x00007fffecd3a9fd in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
#28 0x00007fffecd3ace0 in ?? () from /usr/lib/libglib-2.0.so.0
#29 0x00007fffecd3ad8c in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#30 0x00007ffff52a6854 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#31 0x00007ffff588d3b6 in ?? () from /usr/lib/libQtGui.so.4
#32 0x00007ffff5274dd1 in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#33 0x00007ffff5275145 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#34 0x00007ffff527aaf9 in QCoreApplication::exec() () from /usr/lib/libQtCore.so.4
#35 0x00000000004073b6 in main (argc=<optimized out>, argv=0x7fffffffe3d8) at /tmp/makepkg/amarok-git/src/amarok-git/src/main.cpp:329
Comment 6 Myriam Schweingruber 2015-08-11 06:30:21 UTC
Thanks a lot, this backtrace is perfect. Looks like a known bug, though

*** This bug has been marked as a duplicate of bug 328359 ***
Comment 7 Dave 2015-08-18 18:41:06 UTC
Created attachment 94099 [details]
New crash information added by DrKonqi

amarok (2.8.0) on KDE Platform 4.14.2 using Qt 4.8.6

- What I was doing when the application crashed: I clicked on get tags from MusicBrainz. I managed to update maybe 2 or 3 then Amarok crashed

-- Backtrace (Reduced):
#6  QReadWriteLock::lockForRead (this=this@entry=0x38) at thread/qreadwritelock.cpp:149
#7  0x00007f28e1ab9f80 in relock (this=<synthetic pointer>) at /usr/include/qt4/QtCore/qreadwritelock.h:111
#8  QReadLocker (areadWriteLock=0x38, this=<synthetic pointer>) at /usr/include/qt4/QtCore/qreadwritelock.h:130
#9  MusicBrainzTagsItem::childCount (this=0x0) at ../../src/musicbrainz/MusicBrainzTagsItem.cpp:216
#10 0x00007f28e1abfc64 in MusicBrainzTagsModel::flags (this=0x2ba5150, index=...) at ../../src/musicbrainz/MusicBrainzTagsModel.cpp:210
Comment 8 Mathieu Carpentier 2016-03-10 18:32:40 UTC
Created attachment 97823 [details]
New crash information added by DrKonqi

amarok (2.8.0) on KDE Platform 4.14.17 using Qt 4.8.7

Editing track details and doing a musicbrainz search for tags. The application crashes before retrieving information for all selected tracks (< 10). The number of selected songs does not matter. trying one track at a time or on a selection will cause the crash.

-- Backtrace (Reduced):
#6  0x00007f7b62ad7ba1 in QReadWriteLock::lockForRead() () at /lib64/libQtCore.so.4
#7  0x00007f7b6535f1f0 in MusicBrainzTagsItem::childCount() const () at /lib64/libamaroklib.so.1
#8  0x00007f7b65366f3c in MusicBrainzTagsModel::flags(QModelIndex const&) const () at /lib64/libamaroklib.so.1
#9  0x00007f7b63c0f4ab in QSortFilterProxyModel::flags(QModelIndex const&) const () at /lib64/libQtGui.so.4
#10 0x00007f7b63bc97cb in QTreeView::drawRow(QPainter*, QStyleOptionViewItem const&, QModelIndex const&) const () at /lib64/libQtGui.so.4