Description of problem:
I double clicked on a m3u playlist an pagha crashed.
Version-Release number of selected component:
libreport version: 2.0.18
:Thread no. 1 (8 frames)
: #0 _IO_ftell at ioftell.c:40
: #1 TagLib::FileStream::tell at /usr/src/debug/taglib-1.8/taglib/toolkit/tfilestream.cpp:371
: #2 TagLib::File::tell at /usr/src/debug/taglib-1.8/taglib/toolkit/tfile.cpp:447
: #3 TagLib::File::find at /usr/src/debug/taglib-1.8/taglib/toolkit/tfile.cpp:260
: #4 TagLib::Ogg::File::nextPage at /usr/src/debug/taglib-1.8/taglib/ogg/oggfile.cpp:232
: #5 TagLib::Ogg::File::packet at /usr/src/debug/taglib-1.8/taglib/ogg/oggfile.cpp:93
: #6 TagLib::Vorbis::File::read at /usr/src/debug/taglib-1.8/taglib/ogg/vorbis/vorbisfile.cpp:124
: #7 ??
Created attachment 673308 [details]
Created attachment 673309 [details]
Created attachment 673310 [details]
Created attachment 673311 [details]
Created attachment 673312 [details]
Created attachment 673313 [details]
Created attachment 673314 [details]
Created attachment 673315 [details]
Created attachment 673316 [details]
Created attachment 673317 [details]
Created attachment 673318 [details]
Created attachment 673319 [details]
Created attachment 673320 [details]
I've hit a crash in taglib in the same location, but via the clementine audio player. In my case it was attempting to read the tags for a file for which the current user did not have permission to access, but did have permission to access the directory in which it resided. This is readily reproducible.
#0 __GI__IO_ftell (fp=0x0) at ioftell.c:38
#1 0x00007f19270fb2fd in TagLib::File::find (this=0x7f18b00e71b0, pattern=..., fromOffset=0, before=...) at /usr/src/debug/taglib-1.8/taglib/toolkit/tfile.cpp:260
#2 0x00007f19270e5339 in TagLib::Ogg::File::nextPage (this=this@entry=0x7f18b00e71b0) at /usr/src/debug/taglib-1.8/taglib/ogg/oggfile.cpp:232
#3 0x00007f19270e5d60 in TagLib::Ogg::File::packet (this=0x7f18b00e71b0, i=1) at /usr/src/debug/taglib-1.8/taglib/ogg/oggfile.cpp:93
#4 0x00007f19270ebcf1 in TagLib::Vorbis::File::read (this=this@entry=0x7f18b00e71b0, readProperties=readProperties@entry=true,
propertiesStyle=propertiesStyle@entry=TagLib::AudioProperties::Average) at /usr/src/debug/taglib-1.8/taglib/ogg/vorbis/vorbisfile.cpp:124
#5 0x00007f19270ebf29 in TagLib::Vorbis::File::File (this=0x7f18b00e71b0, file=<optimized out>, readProperties=true, propertiesStyle=TagLib::AudioProperties::Average)
#6 0x00007f1927120964 in TagLib::FileRef::create (fileName=0x7f18b00e23f8 "/redacted_yes_read_permission/redacted_no_read_permission.ogg",
readAudioProperties=true, audioPropertiesStyle=TagLib::AudioProperties::Average) at /usr/src/debug/taglib-1.8/taglib/fileref.cpp:238
#7 0x00007f192712177f in TagLib::FileRef::FileRef (this=0x7f18b00cf090, fileName=<optimized out>, readAudioProperties=<optimized out>, audioPropertiesStyle=<optimized out>)
#8 0x0000000000571158 in TagLibFileRefFactory::GetFileRef (this=<optimized out>, filename=...) at /usr/src/debug/clementine-1.0.1/src/core/song.cpp:261
#9 0x000000000057ca23 in Song::InitFromFile (this=0x7f18d2ffab10, filename=..., directory_id=-1) at /usr/src/debug/clementine-1.0.1/src/core/song.cpp:477
#10 0x000000000074bdec in LibraryWatcher::ScanNewFile (this=this@entry=0x7f18b0001f20, file=..., path=..., matching_cue=...,
cues_processed=cues_processed@entry=0x7f18d2ffacd0) at /usr/src/debug/clementine-1.0.1/src/library/librarywatcher.cpp:491
Similar issue exists when non-accessible (e.g. non-existent) files are given to taglib for the following formats:
Compiling the demo from taglib-devel provides an easy to run reproduction (just give it a non-existent file with one of the above extensions to trigger the segfault):
Created attachment 695858 [details]
Quick fix patch that solves this immediate problem.
This quick fix solves the problem and makes consumers such as clementine happy.
However, a proper fix would involve adding tests and possibly a wider re-factor to generalise checking for files that cannot be opened, so that it doesn't have to be done per file type.
May be worth querying on taglib mailing list about the provided FileRef api, about guarantees/assumptions one can make about non-existent or non-readable files.
(hit return too quickly), otherwise Tim's suggested approach per patch in comment #16 seems reasonable.
Started a mailing list thread on the topic,
Looks like we may have a fix to try out,
taglib-1.8-3.20121215git.fc17 has been submitted as an update for Fedora 17.
taglib-1.8-3.20121215git.fc18 has been submitted as an update for Fedora 18.
* should fix your issue,
* was pushed to the Fedora 17 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing taglib-1.8-3.20121215git.fc17'
as soon as you are able to.
Please go to the following url:
then log in and leave karma (feedback).
(In reply to comment #17)
> May be worth querying on taglib mailing list about the provided FileRef api,
> about guarantees/assumptions one can make about non-existent or non-readable
It broke existing consumers with an update, so there was an implicit guarantee.
Anyway, the update in Comment 22 works for me.
Tested with Clementine, Pragha, and the taglib-devel demo. All of these no longer crash when supplied with a non-existent or inaccessible .ogg file. Full library scans in both Clementine and Pragha were successful.
The taglib-devel demo also doesn't crash for non-existent .spx, .ape and .oga.
taglib-1.8-3.20121215git.fc17 has been pushed to the Fedora 17 stable repository. If problems still persist, please make note of it in this bug report.
taglib-1.8-3.20121215git.fc18 has been pushed to the Fedora 18 stable repository. If problems still persist, please make note of it in this bug report.
pragha-188.8.131.52-1.fc20 has been submitted as an update for Fedora 20.
pragha-184.108.40.206-1.fc19 has been submitted as an update for Fedora 19.
pragha-220.127.116.11-1.fc18 has been submitted as an update for Fedora 18.
pragha-18.104.22.168-2.fc18 has been pushed to the Fedora 18 stable repository. If problems still persist, please make note of it in this bug report.
pragha-22.214.171.124-2.fc19 has been pushed to the Fedora 19 stable repository. If problems still persist, please make note of it in this bug report.
pragha-126.96.36.199-2.fc20 has been pushed to the Fedora 20 stable repository. If problems still persist, please make note of it in this bug report.