Bug 290623 - segfault when creating Ogg::Vorbis::File with a path that doesn't exist
Summary: segfault when creating Ogg::Vorbis::File with a path that doesn't exist
Status: RESOLVED WORKSFORME
Alias: None
Product: taglib
Classification: Unmaintained
Component: general (other bugs)
Version First Reported In: 1.8
Platform: Compiled Sources Linux
: NOR crash
Target Milestone: ---
Assignee: Scott Wheeler
URL:
Keywords:
: 312079 312233 319027 (view as bug list)
Depends on:
Blocks:
 
Reported: 2012-01-04 19:03 UTC by Michael Helmling
Modified: 2021-01-03 04:34 UTC (History)
5 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 Michael Helmling 2012-01-04 19:03:49 UTC
Version:           unspecified (using Devel) 
OS:                Linux

In the current git version of taglib, when you open a Ogg::Vorbis::File with a path that does not exist on disk, the program crashes with a segfault. This does not happen with the packaged version on my system (1.7-3).

Reproducible: Always

Steps to Reproduce:
Compile the following:
#include<taglib/vorbisfile.h>
int main()
{
    new TagLib::Ogg::Vorbis::File("test.ogg");
}


Actual Results:  
$ ./test
TagLib: Could not open file test.ogg
Segmentation fault
$

Expected Results:  
$ ./test
TagLib: Could not open file test.ogg
$
Comment 1 Christoph Feck 2012-01-05 18:04:27 UTC
I could not reproduce with today's git master and the proposed test case. If this is still reproducible for you, could you please run it in gdb and generate the backtrace?
Comment 2 Michael Helmling 2012-01-05 21:08:57 UTC
Compiling the test program with -g and running gdb on it yields:

(gdb) run
Starting program: /home/michael/code/test/test 
TagLib: Could not open file test.ogg

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff6f2de61 in ftell () from /lib/libc.so.6

I am not sure if/how I can compile taglib with debugging support, I've never used cmake nor gdb ... :)
Comment 3 Lukáš Lalinský 2012-01-05 21:33:43 UTC
cmake -DCMAKE_BUILD_TYPE=Debug .
make
Comment 4 Michael Helmling 2012-01-05 21:57:10 UTC
Here is the gdb session with backtrace:

$ gdb test
GNU gdb (GDB) 7.3.1
Copyright (C) 2011 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-unknown-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /home/michael/code/test/test...done.
(gdb) run
Starting program: /home/michael/code/test/test 
TagLib: Could not open file test.ogg

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff6f2de61 in ftell () from /lib/libc.so.6
(gdb) backtrace
#0  0x00007ffff6f2de61 in ftell () from /lib/libc.so.6
#1  0x00007ffff7b66207 in TagLib::FileStream::tell (this=0x6051d0) at /home/michael/taglib/taglib/toolkit/tfilestream.cpp:352
#2  0x00007ffff7b654c1 in TagLib::File::tell (this=0x6051a0) at /home/michael/taglib/taglib/toolkit/tfile.cpp:314
#3  0x00007ffff7b64cb6 in TagLib::File::find (this=0x6051a0, pattern=..., fromOffset=0, before=...) at /home/michael/taglib/taglib/toolkit/tfile.cpp:127
#4  0x00007ffff7b44c38 in TagLib::Ogg::File::nextPage (this=0x6051a0) at /home/michael/taglib/taglib/ogg/oggfile.cpp:232
#5  0x00007ffff7b440a5 in TagLib::Ogg::File::packet (this=0x6051a0, i=1) at /home/michael/taglib/taglib/ogg/oggfile.cpp:93
#6  0x00007ffff7b51391 in TagLib::Vorbis::File::read (this=0x6051a0, readProperties=true, propertiesStyle=TagLib::AudioProperties::Average)
    at /home/michael/taglib/taglib/ogg/vorbis/vorbisfile.cpp:112
#7  0x00007ffff7b510d4 in TagLib::Vorbis::File::File (this=0x6051a0, file=0x40094c "test.ogg", readProperties=true, propertiesStyle=TagLib::AudioProperties::Average)
    at /home/michael/taglib/taglib/ogg/vorbis/vorbisfile.cpp:68
#8  0x000000000040083f in main () at test.cpp:4

I am sorry that I am completely unfirm with gdb, please let me know how I can provide more useful information.
Comment 5 Myriam Schweingruber 2012-12-22 18:40:29 UTC
*** Bug 312079 has been marked as a duplicate of this bug. ***
Comment 6 Myriam Schweingruber 2012-12-26 19:26:19 UTC
*** Bug 312233 has been marked as a duplicate of this bug. ***
Comment 7 Myriam Schweingruber 2013-04-28 16:41:47 UTC
*** Bug 319027 has been marked as a duplicate of this bug. ***
Comment 8 Myriam Schweingruber 2013-04-28 16:42:13 UTC
Confirmed by duplicate.
Comment 9 Justin Zobel 2020-12-04 03:20:31 UTC
Thank you for the report, Michael.

As it has been a while since this was reported, can you please test and confirm if this issue is still occurring or if this bug report can be marked as resolved.

I have set the bug status to "needsinfo" pending your response, please change back to "reported" or "resolved/worksforme" when you respond, thank you.
Comment 10 Bug Janitor Service 2020-12-19 04:34:40 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 11 Bug Janitor Service 2021-01-03 04:34:10 UTC
This bug has been in NEEDSINFO status with no change for at least
30 days. The bug is now closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

Thank you for helping us make KDE software even better for everyone!