Bug 310616 - Crash when trying to read an ogg file without reading rights on it
Summary: Crash when trying to read an ogg file without reading rights on it
Status: RESOLVED UPSTREAM
Alias: None
Product: amarok
Classification: Applications
Component: Playback (other bugs)
Version First Reported In: 2.6.0
Platform: Ubuntu Linux
: NOR crash
Target Milestone: 2.7
Assignee: Amarok Bugs
URL:
Keywords:
: 310691 (view as bug list)
Depends on:
Blocks:
 
Reported: 2012-11-24 18:15 UTC by Jérémie Roquet
Modified: 2012-11-26 08:10 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jérémie Roquet 2012-11-24 18:15:44 UTC
When trying to read an ogg file the user is not allowed to read, Amarok consistently crashes.

Reproducible: Always

Steps to Reproduce:
1. have an ogg file
2. chmod a-r the ogg file
3. try to read it using amarok
Actual Results:  
Amarok consistently crashes.

Worse: if the file is the last one that has been read, then Amarok will refuse to start afterwards.

Expected Results:  
Amarok does nothing, or gives a warning. When doing the same thing with a mp3 file, Amarok does nothing. I think it'd be even better if there was a warning, but at least it doesn't crash for mp3 files.

I'm using a fresh (6 days) install of the 64 bits version of Kubuntu 12.10, with the packaged Amarok 2.6.0. The ogg file I'm trying to read is http://www.openbsd.org/songs/song30.ogg but it shouldn't matter as I've no reading rights on it anyway.

Shell output:
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
QDBusConnection: session D-Bus connection created before QCoreApplication. Application may misbehave.
QDBusConnection: session D-Bus connection created before QCoreApplication. Application may misbehave.
TagLib: Could not open file /home/arkanosis/song30.mp3
TagLib: Could not open file /home/arkanosis/song30.mp3
QWidget::insertAction: Attempt to insert null action
Object::disconnect: Unexpected null parameter
Object::disconnect: Unexpected null parameter
kmimetype filetype guessing failed for /home/arkanosis/song30.ogg 
TagLib: Could not open file /home/arkanosis/song30.ogg
KCrash: Application 'amarok' crashing...
KCrash: Attempting to start /usr/lib/kde4/libexec/drkonqi from kdeinit
sock_file=/home/arkanosis/.kde/socket-Cyclamen/kdeinit4__0
unnamed app(2727): Communication problem with  "amarok" , it probably crashed. 
Error message was:  "org.freedesktop.DBus.Error.NoReply" : " "Message did not receive a reply (timeout by message bus)" " 
[Inferior 1 (process 2727) exited with code 0377]

Crash handler stack (no debug packages, sorry):
Thread 1 (Thread 0x7ffff7fb5780 (LWP 2730)):
[KCrash Handler]
#5  0x00007ffff488ca41 in ftell () from /lib/x86_64-linux-gnu/libc.so.6
#6  0x00007ffff0337b5d in TagLib::File::find(TagLib::ByteVector const&, long, TagLib::ByteVector const&) () from /usr/lib/x86_64-linux-gnu/libtag.so.1
#7  0x00007ffff0321ba9 in TagLib::Ogg::File::nextPage() () from /usr/lib/x86_64-linux-gnu/libtag.so.1
#8  0x00007ffff03225d0 in TagLib::Ogg::File::packet(unsigned int) () from /usr/lib/x86_64-linux-gnu/libtag.so.1
#9  0x00007ffff0328541 in TagLib::Vorbis::File::read(bool, TagLib::AudioProperties::ReadStyle) () from /usr/lib/x86_64-linux-gnu/libtag.so.1
#10 0x00007ffff0328779 in TagLib::Vorbis::File::File(char const*, bool, TagLib::AudioProperties::ReadStyle) () from /usr/lib/x86_64-linux-gnu/libtag.so.1
#11 0x00007ffff035ce04 in TagLib::FileRef::create(char const*, bool, TagLib::AudioProperties::ReadStyle) () from /usr/lib/x86_64-linux-gnu/libtag.so.1
#12 0x00007ffff035dc1f in TagLib::FileRef::FileRef(char const*, bool, TagLib::AudioProperties::ReadStyle) () from /usr/lib/x86_64-linux-gnu/libtag.so.1
#13 0x00007ffff6df0987 in ?? () from /usr/lib/libamaroklib.so.1
#14 0x00007ffff6df1bf8 in Meta::Tag::readTags(QString const&, bool) () from /usr/lib/libamaroklib.so.1
#15 0x00007ffff6e127bb in MetaFile::Track::Private::readMetaData() () from /usr/lib/libamaroklib.so.1
#16 0x00007ffff6e140ec in MetaFile::Track::Track(KUrl const&) () from /usr/lib/libamaroklib.so.1
#17 0x00007ffff6e83871 in CollectionManager::trackForUrl(KUrl const&) () from /usr/lib/libamaroklib.so.1
#18 0x00007ffff6fbb565 in ?? () from /usr/lib/libamaroklib.so.1
#19 0x00007ffff6c85922 in Playlist::Controller::insertOptioned(QList<KUrl>&, int) () from /usr/lib/libamaroklib.so.1
#20 0x00007ffff6fb6626 in App::handleCliArgs() () from /usr/lib/libamaroklib.so.1
#21 0x00007ffff6fb7428 in App::newInstance() () from /usr/lib/libamaroklib.so.1
#22 0x00007ffff79c2482 in ?? () from /usr/lib/libkdeui.so.5
#23 0x00007ffff79c2504 in ?? () from /usr/lib/libkdeui.so.5
#24 0x00007ffff79c263b in ?? () from /usr/lib/libkdeui.so.5
#25 0x00007ffff307bed3 in ?? () from /usr/lib/x86_64-linux-gnu/libQtDBus.so.4
#26 0x00007ffff307cf06 in ?? () from /usr/lib/x86_64-linux-gnu/libQtDBus.so.4
#27 0x00007ffff307d94f in ?? () from /usr/lib/x86_64-linux-gnu/libQtDBus.so.4
#28 0x00007ffff307da2b in ?? () from /usr/lib/x86_64-linux-gnu/libQtDBus.so.4
#29 0x00007ffff528243e in QObject::event(QEvent*) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#30 0x00007ffff5c50f94 in QApplication::event(QEvent*) () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#31 0x00007ffff6fb1222 in App::event(QEvent*) () from /usr/lib/libamaroklib.so.1
#32 0x00007ffff5c4ee9c in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#33 0x00007ffff5c5330a in QApplication::notify(QObject*, QEvent*) () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#34 0x00007ffff79bc1d6 in KApplication::notify(QObject*, QEvent*) () from /usr/lib/libkdeui.so.5
#35 0x00007ffff526d56e in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#36 0x00007ffff52713f1 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#37 0x00007ffff529ba63 in ?? () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#38 0x00007fffef362ab5 in g_main_context_dispatch () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#39 0x00007fffef362de8 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#40 0x00007fffef362ea4 in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#41 0x00007ffff529bbf6 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#42 0x00007ffff5cf3c1e in ?? () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#43 0x00007ffff526c2bf in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#44 0x00007ffff526c548 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#45 0x00007ffff5271708 in QCoreApplication::exec() () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#46 0x0000000000408e0a in ?? ()
#47 0x00007ffff483e76d in __libc_start_main () from /lib/x86_64-linux-gnu/libc.so.6
#48 0x000000000040b825 in _start ()
Comment 1 Myriam Schweingruber 2012-11-24 22:19:00 UTC
What is the use case for that? Having non-readable audio files is certainly not a very common scenario.
Comment 2 Myriam Schweingruber 2012-11-24 22:20:09 UTC
Also please install debugging symbols for Amarok and taglib, your backtrace is not useful. See also http://techbase.kde.org/Development/Tutorials/Debugging/How_to_create_useful_crash_reports
Comment 3 Jérémie Roquet 2012-11-24 23:06:07 UTC
Hi Myriam. It's certainly not a very common scenario, indeed, but the fact is, it has happened to me :)

I'll install debugging symbols and submit a new callstack later; I'm unable to download them right now because they are too big (or my Internet connexion is too slow, if you prefer).

Best regards.
Comment 4 Jérémie Roquet 2012-11-25 15:28:43 UTC
Updated backtrace with some debugging symbols. It looks like there are no packaged debugging symbols for tablib on Kubuntu, however, but it's easy to guess what happens within these 7 frames.

My guess is that actually, it's a TagLib issue, not an Amarok issue. More precisely, the constructor for TagLib::Vorbis::File should check if it isValid() at line 79¹ instead of only if it isOpen().

There's already an open ticket for this ² on the upstream bugtracker, which resulted in that isOpen() to be added (so, the current version probably don't even have this test). I'm asking there if isValid() wouldn't be better.

Best regards.

Thread 1 (Thread 0x7ffa03d49780 (LWP 2261)):
[KCrash Handler]
#6  _IO_ftell (fp=0x0) at ioftell.c:40
#7  0x00007ff9fc0cab5d in TagLib::File::find(TagLib::ByteVector const&, long, TagLib::ByteVector const&) () from /usr/lib/x86_64-linux-gnu/libtag.so.1
#8  0x00007ff9fc0b4ba9 in TagLib::Ogg::File::nextPage() () from /usr/lib/x86_64-linux-gnu/libtag.so.1
#9  0x00007ff9fc0b55d0 in TagLib::Ogg::File::packet(unsigned int) () from /usr/lib/x86_64-linux-gnu/libtag.so.1
#10 0x00007ff9fc0bb541 in TagLib::Vorbis::File::read(bool, TagLib::AudioProperties::ReadStyle) () from /usr/lib/x86_64-linux-gnu/libtag.so.1
#11 0x00007ff9fc0bb779 in TagLib::Vorbis::File::File(char const*, bool, TagLib::AudioProperties::ReadStyle) () from /usr/lib/x86_64-linux-gnu/libtag.so.1
#12 0x00007ff9fc0efe04 in TagLib::FileRef::create(char const*, bool, TagLib::AudioProperties::ReadStyle) () from /usr/lib/x86_64-linux-gnu/libtag.so.1
#13 0x00007ff9fc0f0c1f in TagLib::FileRef::FileRef(char const*, bool, TagLib::AudioProperties::ReadStyle) () from /usr/lib/x86_64-linux-gnu/libtag.so.1
#14 0x00007ffa02b83987 in Meta::Tag::getFileRef (path=...) at ../../shared/MetaTagLib.cpp:111
#15 0x00007ffa02b84bf8 in Meta::Tag::readTags (path=...) at ../../shared/MetaTagLib.cpp:220
#16 0x00007ffa02ba57bb in MetaFile::Track::Private::readMetaData (this=0x30d79a0) at ../../src/core-impl/meta/file/File_p.h:153
#17 0x00007ffa02ba70ec in MetaFile::Track::Track (this=0x18c7320, url=...) at ../../src/core-impl/meta/file/File.cpp:191
#18 0x00007ffa02c16871 in CollectionManager::trackForUrl (this=<optimized out>, url=...) at ../../src/core-impl/collections/support/CollectionManager.cpp:469
#19 0x00007ffa02d4e565 in DirectoryLoader::init (this=0x2aaecf0, urls=...) at ../../src/DirectoryLoader.cpp:98
#20 0x00007ffa02a18922 in Playlist::Controller::insertOptioned (this=0x1f0d7b0, urls=..., options=33) at ../../src/playlist/PlaylistController.cpp:245
#21 0x00007ffa02d49626 in App::handleCliArgs () at ../../src/App.cpp:311
#22 0x00007ffa02d4a428 in App::newInstance (this=0x7ffff7693300) at ../../src/App.cpp:737
#23 0x00007ffa03755482 in KUniqueApplicationAdaptor::newInstance (this=0x1a5f180, asn_id=..., args=...) at ../../kdeui/kernel/kuniqueapplication.cpp:442
#24 0x00007ffa03755504 in qt_static_metacall (_a=0x7ffff7690300, _id=<optimized out>, _o=<optimized out>, _c=<optimized out>) at ./kuniqueapplication_p.moc:58
#25 KUniqueApplicationAdaptor::qt_static_metacall (_o=<optimized out>, _c=<optimized out>, _id=<optimized out>, _a=0x7ffff7690300) at ./kuniqueapplication_p.moc:52
#26 0x00007ffa0375563b in KUniqueApplicationAdaptor::qt_metacall (this=0x1a5f180, _c=QMetaObject::InvokeMetaMethod, _id=<optimized out>, _a=0x7ffff7690300) at ./kuniqueapplication_p.moc:102
#27 0x00007ff9fee0eed3 in QDBusConnectionPrivate::deliverCall (this=this@entry=0x18c6320, object=object@entry=0x1a5f180, msg=..., metaTypes=..., slotIdx=4) at qdbusintegrator.cpp:947
#28 0x00007ff9fee0ff06 in QDBusConnectionPrivate::activateCall (this=this@entry=0x18c6320, object=0x1a5f180, flags=flags@entry=337, msg=...) at qdbusintegrator.cpp:850
#29 0x00007ff9fee1094f in QDBusConnectionPrivate::activateObject (this=0x18c6320, node=..., msg=..., pathStartPos=<optimized out>) at qdbusintegrator.cpp:1423
#30 0x00007ff9fee10a2b in QDBusActivateObjectEvent::placeMetaCall (this=0x2ab8df0) at qdbusintegrator.cpp:1537
#31 0x00007ffa0101543e in QObject::event (this=0x7ffff7693300, e=<optimized out>) at kernel/qobject.cpp:1195
#32 0x00007ffa019e3f94 in QApplication::event (this=0x7ffff7693300, e=0x2ab8df0) at kernel/qapplication.cpp:2544
#33 0x00007ffa02d44222 in App::event (this=<optimized out>, event=<optimized out>) at ../../src/App.cpp:720
#34 0x00007ffa019e1e9c in QApplicationPrivate::notify_helper (this=this@entry=0x18f3ab0, receiver=receiver@entry=0x7ffff7693300, e=e@entry=0x2ab8df0) at kernel/qapplication.cpp:4562
#35 0x00007ffa019e630a in QApplication::notify (this=0x7ffff7693300, receiver=0x7ffff7693300, e=0x2ab8df0) at kernel/qapplication.cpp:4423
#36 0x00007ffa0374f1d6 in KApplication::notify (this=0x7ffff7693300, receiver=0x7ffff7693300, event=0x2ab8df0) at ../../kdeui/kernel/kapplication.cpp:311
#37 0x00007ffa0100056e in QCoreApplication::notifyInternal (this=0x7ffff7693300, receiver=receiver@entry=0x7ffff7693300, event=event@entry=0x2ab8df0) at kernel/qcoreapplication.cpp:915
#38 0x00007ffa010043f1 in sendEvent (event=0x2ab8df0, receiver=0x7ffff7693300) at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:231
#39 QCoreApplicationPrivate::sendPostedEvents (receiver=0x0, event_type=0, data=0x177d1f0) at kernel/qcoreapplication.cpp:1539
#40 0x00007ffa0102ea63 in sendPostedEvents () at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:236
#41 postEventSourceDispatch (s=0x18f3640) at kernel/qeventdispatcher_glib.cpp:279
#42 0x00007ff9fb0f5ab5 in g_main_context_dispatch () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#43 0x00007ff9fb0f5de8 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#44 0x00007ff9fb0f5ea4 in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#45 0x00007ffa0102ebf6 in QEventDispatcherGlib::processEvents (this=0x177ead0, flags=...) at kernel/qeventdispatcher_glib.cpp:424
#46 0x00007ffa01a86c1e in QGuiEventDispatcherGlib::processEvents (this=<optimized out>, flags=...) at kernel/qguieventdispatcher_glib.cpp:204
#47 0x00007ffa00fff2bf in QEventLoop::processEvents (this=this@entry=0x7ffff7690fc0, flags=...) at kernel/qeventloop.cpp:149
#48 0x00007ffa00fff548 in QEventLoop::exec (this=0x7ffff7690fc0, flags=...) at kernel/qeventloop.cpp:204
#49 0x00007ffa01004708 in QCoreApplication::exec () at kernel/qcoreapplication.cpp:1187
#50 0x0000000000408e0a in main (argc=2, argv=0x7ffff7693468) at ../../src/main.cpp:306

¹ https://github.com/taglib/taglib/blob/master/taglib/ogg/vorbis/vorbisfile.cpp#L70
² https://github.com/taglib/taglib/issues/78
Comment 5 Jérémie Roquet 2012-11-25 15:44:42 UTC
OK, after reading the source and the discussion on the pull request¹ , it looks like isOpen() is correct, so I guess the bug is already fixed upstream but not in the version of gstreamer that is packaged for Ubuntu.

I'm closing this bug as it's almost certainly not a KDE issue.

Best regards.

¹ https://github.com/taglib/taglib/pull/79
Comment 6 Myriam Schweingruber 2012-11-26 08:10:52 UTC
*** Bug 310691 has been marked as a duplicate of this bug. ***