<div dir="ltr">After some more testing I will say that recompiling taglib with <span style="font-family:arial,sans-serif;font-size:13px">TAGLIB_ATOMIC_GCC set seems to fix the issue.  I am glad it was a simple fix.  Thanks</span><div>
<span style="font-family:arial,sans-serif;font-size:13px"><br></span></div><div><span style="font-family:arial,sans-serif;font-size:13px">-Kyle</span></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sat, Oct 12, 2013 at 8:13 PM, Tsuda Kageyu <span dir="ltr"><<a href="mailto:tsuda.kageyu@gmail.com" target="_blank">tsuda.kageyu@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">After reading your report interestingly, I had a brief look at the code.<br>
Though I couldn't locate the problem, I found some functions which are<br>
possibly vulnerable for concurrent calls and made a pull request to fix<br>
it:<br>
<a href="https://github.com/taglib/taglib/pull/300" target="_blank">https://github.com/taglib/taglib/pull/300</a><br>
<br>
Hope it can help you.<br>
<br>
Kageyu.<br>
<div><div class="h5"><br>
>I've had this issue for around a year and i've traced basically every line<br>
>of my code and cannot find any issues.  I've looked through the taglib code<br>
>and cannot find the exact cause either, but for some reason once in awhile<br>
>I'll get a stack trace that comes down to destroying a String<br>
><br>
>This is on Android so the stack traces are not the greatest:<br>
><br>
>#02 pc 000f9eff<br>
>/data/app-lib/com.jrtstudio.AnotherMusicPlayer-1/libgm_audioengine.so<br>
>(operator delete(void*)+6)<br>
>#03 pc 000f9f07<br>
>/data/app-lib/com.jrtstudio.AnotherMusicPlayer-1/libgm_audioengine.so<br>
>(operator delete[](void*)+2)<br>
>#04 pc 000d1eeb<br>
>/data/app-lib/com.jrtstudio.AnotherMusicPlayer-1/libgm_audioengine.so<br>
>(TagLib::String::~String()+38)<br>
>#05 pc 000e4fd9<br>
>/data/app-lib/com.jrtstudio.AnotherMusicPlayer-1/libgm_audioengine.so<br>
>(TagLib::TagUnion::comment() const+48)<br>
>#06 pc 00098b90<br>
>/data/app-lib/com.jrtstudio.AnotherMusicPlayer-1/libgm_audioengine.so<br>
>(Java_gonemad_gmmp_taglibjni_Tag_scan+752)<br>
><br>
><br>
>#02 pc 000fa6f0<br>
>/data/app-lib/com.jrtstudio.AnotherMusicPlayer-1/libgm_audioengine.so<br>
>(std::__stl_throw_length_error(char const*)+8)<br>
>#03 pc 000d224b<br>
>/data/app-lib/com.jrtstudio.AnotherMusicPlayer-1/libgm_audioengine.so<br>
>(std::basic_string<wchar_t, std::char_traits<wchar_t>,<br>
>std::allocator<wchar_t> >::_M_compute_next_size(unsigned int)+50)<br>
>#04 pc 000d3287<br>
>/data/app-lib/com.jrtstudio.AnotherMusicPlayer-1/libgm_audioengine.so<br>
>(std::basic_string<wchar_t, std::char_traits<wchar_t>,<br>
>std::allocator<wchar_t> >::_M_append(wchar_t const*, wchar_t const*)+102)<br>
>#05 pc 000d3365<br>
>/data/app-lib/com.jrtstudio.AnotherMusicPlayer-1/libgm_audioengine.so<br>
>(TagLib::String::append(TagLib::String const&)+20)<br>
>#06 pc 000d33bf<br>
>/data/app-lib/com.jrtstudio.AnotherMusicPlayer-1/libgm_audioengine.so<br>
>(operator+(TagLib::String const&, TagLib::String const&)+14)<br>
>#07 pc 000c2ad9<br>
>/data/app-lib/com.jrtstudio.AnotherMusicPlayer-1/libgm_audioengine.so<br>
>(TagLib::ID3v1::genre(int)+36)<br>
>#08 pc 000c3c77<br>
>/data/app-lib/com.jrtstudio.AnotherMusicPlayer-1/libgm_audioengine.so<br>
>(TagLib::ID3v2::FrameFactory::updateGenre(TagLib::ID3v2::<br>
>TextIdentificationFrame*)<br>
>const+350)<br>
>#09 pc 000c3ecf<br>
>/data/app-lib/com.jrtstudio.AnotherMusicPlayer-1/libgm_audioengine.so<br>
>(TagLib::ID3v2::FrameFactory::createFrame(TagLib::ByteVector const&,<br>
>TagLib::ID3v2::Header*) const+522)<br>
>#10 pc 000c5291<br>
>/data/app-lib/com.jrtstudio.AnotherMusicPlayer-1/libgm_audioengine.so<br>
>(TagLib::ID3v2::Tag::parse(TagLib::ByteVector const&)+164)<br>
>#11 pc 000c544d<br>
>/data/app-lib/com.jrtstudio.AnotherMusicPlayer-1/libgm_audioengine.so<br>
>(TagLib::ID3v2::Tag::read()+120)<br>
>#12 pc 000c5503<br>
>/data/app-lib/com.jrtstudio.AnotherMusicPlayer-1/libgm_audioengine.so<br>
>(TagLib::ID3v2::Tag::Tag(TagLib::File*, long, TagLib::ID3v2::FrameFactory<br>
>const*)+102)<br>
>#13 pc 000c106f<br>
>/data/app-lib/com.jrtstudio.AnotherMusicPlayer-1/libgm_audioengine.so<br>
>(TagLib::MPEG::File::read(bool, TagLib::AudioProperties::ReadStyle)+50)<br>
>#14 pc 000c12bb<br>
>/data/app-lib/com.jrtstudio.AnotherMusicPlayer-1/libgm_audioengine.so<br>
>(TagLib::MPEG::File::File(char const*, bool,<br>
>TagLib::AudioProperties::ReadStyle)+106)<br>
>#15 pc 000e5a75<br>
>/data/app-lib/com.jrtstudio.AnotherMusicPlayer-1/libgm_audioengine.so<br>
>(TagLib::FileRef::create(char const*, bool,<br>
>TagLib::AudioProperties::ReadStyle)+252)<br>
>#16 pc 000e60f1<br>
>/data/app-lib/com.jrtstudio.AnotherMusicPlayer-1/libgm_audioengine.so<br>
>(TagLib::FileRef::FileRef(char const*, bool,<br>
>TagLib::AudioProperties::ReadStyle)+20)<br>
>#17 pc 000988ec<br>
>/data/app-lib/com.jrtstudio.AnotherMusicPlayer-1/libgm_audioengine.so<br>
>(Java_gonemad_gmmp_taglibjni_Tag_scan+76)<br>
><br>
><br>
>#00  pc 0001183a  /system/lib/libc.so (dlfree+57)<br>
>10-11 09:41:53.647 I/DEBUG   (303):     #01  pc 0000cf73<br>
> /system/lib/libc.so (free+10)<br>
>10-11 09:41:53.647 I/DEBUG   (303):     #02  pc 000faccb<br>
> /data/app-lib/gonemad.gmmp-1/libgm_audioengine.so (operator<br>
>delete(void*)+6)<br>
>10-11 09:41:53.647 I/DEBUG   (303):     #03  pc 000d2c6d<br>
> /data/app-lib/gonemad.gmmp-1/libgm_audioengine.so<br>
>(TagLib::String::~String()+80)<br>
>10-11 09:41:53.647 I/DEBUG   (303):     #04  pc 000c3241<br>
> /data/app-lib/gonemad.gmmp-1/libgm_audioengine.so<br>
>(TagLib::ID3v1::Tag::~Tag()+24)<br>
>10-11 09:41:53.647 I/DEBUG   (303):     #05  pc 000c327d<br>
> /data/app-lib/gonemad.gmmp-1/libgm_audioengine.so<br>
>(TagLib::ID3v1::Tag::~Tag()+4)<br>
>10-11 09:41:53.647 I/DEBUG   (303):     #06  pc 000e587d<br>
> /data/app-lib/gonemad.gmmp-1/libgm_audioengine.so<br>
>(TagLib::TagUnion::TagUnionPrivate::~TagUnionPrivate()+44)<br>
>10-11 09:41:53.647 I/DEBUG   (303):     #07  pc 000e58b7<br>
> /data/app-lib/gonemad.gmmp-1/libgm_audioengine.so<br>
>(TagLib::TagUnion::~TagUnion()+22)<br>
>10-11 09:41:53.647 I/DEBUG   (303):     #08  pc 000c15f9<br>
> /data/app-lib/gonemad.gmmp-1/libgm_audioengine.so<br>
>(TagLib::MPEG::File::~File()+36)<br>
>10-11 09:41:53.647 I/DEBUG   (303):     #09  pc 000c1615<br>
> /data/app-lib/gonemad.gmmp-1/libgm_audioengine.so<br>
>(TagLib::MPEG::File::~File()+4)<br>
>10-11 09:41:53.647 I/DEBUG   (303):     #10  pc 000e61e3<br>
> /data/app-lib/gonemad.gmmp-1/libgm_audioengine.so<br>
>(TagLib::FileRef::~FileRef()+42)<br>
>10-11 09:41:53.647 I/DEBUG   (303):     #11  pc 000e61f9<br>
> /data/app-lib/gonemad.gmmp-1/libgm_audioengine.so<br>
>(TagLib::FileRef::~FileRef()+4)<br>
>10-11 09:41:53.647 I/DEBUG   (303):     #12  pc 00099ae4<br>
> /data/app-lib/gonemad.gmmp-1/libgm_audioengine.so<br>
>(Java_gonemad_gmmp_taglibjni_Tag_scan+1396)<br>
><br>
>And I have many more similar but in different parts of taglib.  The only<br>
>common thing I can trace is the use of String::null.  The second trace i<br>
>posted happens in this chunk of code adding 2 static strings<br>
><br>
>String ID3v1::genre(int i)<br>
>{<br>
>  if(i >= 0 && i < genresSize)<br>
>    return genres[i] + String::null; // always make a copy<br>
>  return String::null;<br>
>}<br>
><br>
>Is there a possibility that String::null is somehow being deleted due to<br>
>some race condition?  I am using taglib in multiple threads at the same<br>
>time.  Any ideas?<br>
><br>
>--<br>
>-Kyle<br>
><br>
</div></div>>-------------------------------text/plain-------------------------------<br>
<div class="HOEnZb"><div class="h5">>_______________________________________________<br>
>taglib-devel mailing list<br>
><a href="mailto:taglib-devel@kde.org">taglib-devel@kde.org</a><br>
><a href="https://mail.kde.org/mailman/listinfo/taglib-devel" target="_blank">https://mail.kde.org/mailman/listinfo/taglib-devel</a><br>
_______________________________________________<br>
taglib-devel mailing list<br>
<a href="mailto:taglib-devel@kde.org">taglib-devel@kde.org</a><br>
<a href="https://mail.kde.org/mailman/listinfo/taglib-devel" target="_blank">https://mail.kde.org/mailman/listinfo/taglib-devel</a><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br>-Kyle
</div>