<div dir="ltr"><div>I've had this issue for around a year and i've traced basically every line of my code and cannot find any issues.  I've looked through the taglib code and cannot find the exact cause either, but for some reason once in awhile I'll get a stack trace that comes down to destroying a String</div>
<div><br></div><div>This is on Android so the stack traces are not the greatest:</div><div><br></div><div>#02 pc 000f9eff /data/app-lib/com.jrtstudio.AnotherMusicPlayer-1/libgm_audioengine.so (operator delete(void*)+6)</div>
<div>#03 pc 000f9f07 /data/app-lib/com.jrtstudio.AnotherMusicPlayer-1/libgm_audioengine.so (operator delete[](void*)+2)</div><div>#04 pc 000d1eeb /data/app-lib/com.jrtstudio.AnotherMusicPlayer-1/libgm_audioengine.so (TagLib::String::~String()+38)</div>
<div>#05 pc 000e4fd9 /data/app-lib/com.jrtstudio.AnotherMusicPlayer-1/libgm_audioengine.so (TagLib::TagUnion::comment() const+48)</div><div>#06 pc 00098b90 /data/app-lib/com.jrtstudio.AnotherMusicPlayer-1/libgm_audioengine.so (Java_gonemad_gmmp_taglibjni_Tag_scan+752)</div>
<div><br></div><div><br></div><div>#02 pc 000fa6f0 /data/app-lib/com.jrtstudio.AnotherMusicPlayer-1/libgm_audioengine.so (std::__stl_throw_length_error(char const*)+8)</div><div>#03 pc 000d224b /data/app-lib/com.jrtstudio.AnotherMusicPlayer-1/libgm_audioengine.so (std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >::_M_compute_next_size(unsigned int)+50)</div>
<div>#04 pc 000d3287 /data/app-lib/com.jrtstudio.AnotherMusicPlayer-1/libgm_audioengine.so (std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >::_M_append(wchar_t const*, wchar_t const*)+102)</div>
<div>#05 pc 000d3365 /data/app-lib/com.jrtstudio.AnotherMusicPlayer-1/libgm_audioengine.so (TagLib::String::append(TagLib::String const&)+20)</div><div>#06 pc 000d33bf /data/app-lib/com.jrtstudio.AnotherMusicPlayer-1/libgm_audioengine.so (operator+(TagLib::String const&, TagLib::String const&)+14)</div>
<div>#07 pc 000c2ad9 /data/app-lib/com.jrtstudio.AnotherMusicPlayer-1/libgm_audioengine.so (TagLib::ID3v1::genre(int)+36)</div><div>#08 pc 000c3c77 /data/app-lib/com.jrtstudio.AnotherMusicPlayer-1/libgm_audioengine.so (TagLib::ID3v2::FrameFactory::updateGenre(TagLib::ID3v2::TextIdentificationFrame*) const+350)</div>
<div>#09 pc 000c3ecf /data/app-lib/com.jrtstudio.AnotherMusicPlayer-1/libgm_audioengine.so (TagLib::ID3v2::FrameFactory::createFrame(TagLib::ByteVector const&, TagLib::ID3v2::Header*) const+522)</div><div>#10 pc 000c5291 /data/app-lib/com.jrtstudio.AnotherMusicPlayer-1/libgm_audioengine.so (TagLib::ID3v2::Tag::parse(TagLib::ByteVector const&)+164)</div>
<div>#11 pc 000c544d /data/app-lib/com.jrtstudio.AnotherMusicPlayer-1/libgm_audioengine.so (TagLib::ID3v2::Tag::read()+120)</div><div>#12 pc 000c5503 /data/app-lib/com.jrtstudio.AnotherMusicPlayer-1/libgm_audioengine.so (TagLib::ID3v2::Tag::Tag(TagLib::File*, long, TagLib::ID3v2::FrameFactory const*)+102)</div>
<div>#13 pc 000c106f /data/app-lib/com.jrtstudio.AnotherMusicPlayer-1/libgm_audioengine.so (TagLib::MPEG::File::read(bool, TagLib::AudioProperties::ReadStyle)+50)</div><div>#14 pc 000c12bb /data/app-lib/com.jrtstudio.AnotherMusicPlayer-1/libgm_audioengine.so (TagLib::MPEG::File::File(char const*, bool, TagLib::AudioProperties::ReadStyle)+106)</div>
<div>#15 pc 000e5a75 /data/app-lib/com.jrtstudio.AnotherMusicPlayer-1/libgm_audioengine.so (TagLib::FileRef::create(char const*, bool, TagLib::AudioProperties::ReadStyle)+252)</div><div>#16 pc 000e60f1 /data/app-lib/com.jrtstudio.AnotherMusicPlayer-1/libgm_audioengine.so (TagLib::FileRef::FileRef(char const*, bool, TagLib::AudioProperties::ReadStyle)+20)</div>
<div>#17 pc 000988ec /data/app-lib/com.jrtstudio.AnotherMusicPlayer-1/libgm_audioengine.so (Java_gonemad_gmmp_taglibjni_Tag_scan+76)</div><div><br></div><div><br></div><div>#00  pc 0001183a  /system/lib/libc.so (dlfree+57)</div>
<div>10-11 09:41:53.647 I/DEBUG   (303):     #01  pc 0000cf73  /system/lib/libc.so (free+10)</div><div>10-11 09:41:53.647 I/DEBUG   (303):     #02  pc 000faccb  /data/app-lib/gonemad.gmmp-1/libgm_audioengine.so (operator delete(void*)+6)</div>
<div>10-11 09:41:53.647 I/DEBUG   (303):     #03  pc 000d2c6d  /data/app-lib/gonemad.gmmp-1/libgm_audioengine.so (TagLib::String::~String()+80)</div><div>10-11 09:41:53.647 I/DEBUG   (303):     #04  pc 000c3241  /data/app-lib/gonemad.gmmp-1/libgm_audioengine.so (TagLib::ID3v1::Tag::~Tag()+24)</div>
<div>10-11 09:41:53.647 I/DEBUG   (303):     #05  pc 000c327d  /data/app-lib/gonemad.gmmp-1/libgm_audioengine.so (TagLib::ID3v1::Tag::~Tag()+4)</div><div>10-11 09:41:53.647 I/DEBUG   (303):     #06  pc 000e587d  /data/app-lib/gonemad.gmmp-1/libgm_audioengine.so (TagLib::TagUnion::TagUnionPrivate::~TagUnionPrivate()+44)</div>
<div>10-11 09:41:53.647 I/DEBUG   (303):     #07  pc 000e58b7  /data/app-lib/gonemad.gmmp-1/libgm_audioengine.so (TagLib::TagUnion::~TagUnion()+22)</div><div>10-11 09:41:53.647 I/DEBUG   (303):     #08  pc 000c15f9  /data/app-lib/gonemad.gmmp-1/libgm_audioengine.so (TagLib::MPEG::File::~File()+36)</div>
<div>10-11 09:41:53.647 I/DEBUG   (303):     #09  pc 000c1615  /data/app-lib/gonemad.gmmp-1/libgm_audioengine.so (TagLib::MPEG::File::~File()+4)</div><div>10-11 09:41:53.647 I/DEBUG   (303):     #10  pc 000e61e3  /data/app-lib/gonemad.gmmp-1/libgm_audioengine.so (TagLib::FileRef::~FileRef()+42)</div>
<div>10-11 09:41:53.647 I/DEBUG   (303):     #11  pc 000e61f9  /data/app-lib/gonemad.gmmp-1/libgm_audioengine.so (TagLib::FileRef::~FileRef()+4)</div><div>10-11 09:41:53.647 I/DEBUG   (303):     #12  pc 00099ae4  /data/app-lib/gonemad.gmmp-1/libgm_audioengine.so (Java_gonemad_gmmp_taglibjni_Tag_scan+1396)</div>
<div><br></div><div>And I have many more similar but in different parts of taglib.  The only common thing I can trace is the use of String::null.  The second trace i posted happens in this chunk of code adding 2 static strings</div>
<div><br></div><div>String ID3v1::genre(int i)</div><div>{</div><div>  if(i >= 0 && i < genresSize)</div><div>    return genres[i] + String::null; // always make a copy</div><div>  return String::null;</div>
<div>}</div><div><br></div><div>Is there a possibility that String::null is somehow being deleted due to some race condition?  I am using taglib in multiple threads at the same time.  Any ideas?</div><div><br></div>-- <br>
-Kyle
</div>