TagLib 1.5 segfaults on one file

Vidar Wahlberg canidae at exent.net
Sat Jan 10 00:13:43 CET 2009


Hello there.

I've hit a quite peculiar segfault which I can't seem to figure out.
Output from Valgrind follows, let me know if you need something else
(for example the mp3 file that cause this error).


==30426== Memcheck, a memory error detector.
==30426== Copyright (C) 2002-2007, and GNU GPL'd, by Julian Seward et al.
==30426== Using LibVEX rev 1854, a library for dynamic binary translation.
==30426== Copyright (C) 2004-2007, and GNU GPL'd, by OpenWorks LLP.
==30426== Using valgrind-3.3.1-Debian, a dynamic binary instrumentation framework.
==30426== Copyright (C) 2000-2007, and GNU GPL'd, by Julian Seward et al.
==30426== For more details, rerun with: -v
==30426== 
==30426== Invalid read of size 4
==30426==    at 0x40BC8C0: TagLib::String::to8Bit(bool) const (tstring.cpp:208)
==30426==    by 0x40BCD98: TagLib::String::data(TagLib::String::Type) const (tstring.cpp:371)
==30426==    by 0x40B8D73: TagLib::APE::Item::render() const (apeitem.cpp:211)
==30426==    by 0x40B40CF: TagLib::APE::Tag::render() const (apetag.cpp:240)
==30426==    by 0x407D567: TagLib::MPEG::File::save(int, bool) (mpegfile.cpp:215)
==30426==    by 0x407D871: TagLib::MPEG::File::save(int) (mpegfile.cpp:138)
==30426==    by 0x407D89C: TagLib::MPEG::File::save() (mpegfile.cpp:133)
==30426==    by 0x804958D: main (tagwriter.cpp:136)
==30426==  Address 0x43adaec is 4 bytes after a block of size 16 alloc'd
==30426==    at 0x402573E: operator new(unsigned) (vg_replace_malloc.c:224)
==30426==    by 0x40BEFEA: TagLib::List<TagLib::String>::List() (tlist.tcc:92)
==30426==    by 0x40BE5F8: TagLib::StringList::StringList() (tstringlist.cpp:58)
==30426==    by 0x40B9986: TagLib::APE::Item::ItemPrivate::ItemPrivate() (apeitem.cpp:37)
==30426==    by 0x40B9717: TagLib::APE::Item::Item() (apeitem.cpp:48)
==30426==    by 0x40B3E4B: TagLib::APE::Tag::parse(TagLib::ByteVector const&) (apetag.cpp:259)
==30426==    by 0x40B44D3: TagLib::APE::Tag::read() (apetag.cpp:227)
==30426==    by 0x40B58E9: TagLib::APE::Tag::Tag(TagLib::File*, long) (apetag.cpp:74)
==30426==    by 0x407CD26: TagLib::MPEG::File::read(bool, TagLib::AudioProperties::ReadStyle) (mpegfile.cpp:426)
==30426==    by 0x407DCF9: TagLib::MPEG::File::File(char const*, bool, TagLib::AudioProperties::ReadStyle) (mpegfile.cpp:103)
==30426==    by 0x4079726: TagLib::FileRef::create(char const*, bool, TagLib::AudioProperties::ReadStyle) (fileref.cpp:187)
==30426==    by 0x407A3CD: TagLib::FileRef::FileRef(char const*, bool, TagLib::AudioProperties::ReadStyle) (fileref.cpp:67)
==30426== 
==30426== Invalid read of size 4
==30426==    at 0x41C2C57: std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >::size() const (in /usr/lib/libstdc++.so.6.0.10)
==30426==    by 0x40BCD98: TagLib::String::data(TagLib::String::Type) const (tstring.cpp:371)
==30426==    by 0x40B8D73: TagLib::APE::Item::render() const (apeitem.cpp:211)
==30426==    by 0x40B40CF: TagLib::APE::Tag::render() const (apetag.cpp:240)
==30426==    by 0x407D567: TagLib::MPEG::File::save(int, bool) (mpegfile.cpp:215)
==30426==    by 0x407D871: TagLib::MPEG::File::save(int) (mpegfile.cpp:138)
==30426==    by 0x407D89C: TagLib::MPEG::File::save() (mpegfile.cpp:133)
==30426==    by 0x804958D: main (tagwriter.cpp:136)
==30426==  Address 0x4 is not stack'd, malloc'd or (recently) free'd
==30426== 
==30426== Process terminating with default action of signal 11 (SIGSEGV)
==30426==  Access not within mapped region at address 0x4
==30426==    at 0x41C2C57: std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >::size() const (in /usr/lib/libstdc++.so.6.0.10)
==30426==    by 0x40BCD98: TagLib::String::data(TagLib::String::Type) const (tstring.cpp:371)
==30426==    by 0x40B8D73: TagLib::APE::Item::render() const (apeitem.cpp:211)
==30426==    by 0x40B40CF: TagLib::APE::Tag::render() const (apetag.cpp:240)
==30426==    by 0x407D567: TagLib::MPEG::File::save(int, bool) (mpegfile.cpp:215)
==30426==    by 0x407D871: TagLib::MPEG::File::save(int) (mpegfile.cpp:138)
==30426==    by 0x407D89C: TagLib::MPEG::File::save() (mpegfile.cpp:133)
==30426==    by 0x804958D: main (tagwriter.cpp:136)
==30426== 
==30426== ERROR SUMMARY: 2 errors from 2 contexts (suppressed: 22 from 1)
==30426== malloc/free: in use at exit: 26,363 bytes in 579 blocks.
==30426== malloc/free: 1,811 allocs, 1,232 frees, 87,121 bytes allocated.
==30426== For counts of detected errors, rerun with: -v
==30426== searching for pointers to 579 not-freed blocks.
==30426== checked 142,888 bytes.
==30426== 
==30426== LEAK SUMMARY:
==30426==    definitely lost: 0 bytes in 0 blocks.
==30426==      possibly lost: 18,213 bytes in 177 blocks.
==30426==    still reachable: 8,150 bytes in 402 blocks.
==30426==         suppressed: 0 bytes in 0 blocks.
==30426== Rerun with --leak-check=full to see details of leaked memory.
zsh: segmentation fault  ./tagwriter -T 06


-- 
Regards,
Vidar Wahlberg


More information about the taglib-devel mailing list