Interesting, thank you Festus.<div><br></div><div>I will try and get GCC back up and running on my Mac, then. I was very disappointed when I learned that "gcc" was now just an alias for clang...</div><div>And thank you<span></span> for the other tips.</div><div><br></div><div>Best</div><div>Ibrahim</div><div><br>On Monday, 22 June 2015, Festus Hagen <<a href="mailto:festushagenlists@yahoo.com">festushagenlists@yahoo.com</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Somehow this got off the list, this re-introduces it back onto the list.<br>
<br>
<br>
Ibrahim Sha'ath,The code works using GCC c++11 on Windows, FreeBSD and OS X. (That is GNU's not Apples ...).<br>
However I don't believe the following provides the result expected.<br>
if(mp4File != NULL){<br>
I suspect the following would.<br>
<br>
if(mp4File->isValid()){<br>
<br>
If TagLib::FileRef and TagLib::File are not actually used other then to create mp4File, The following<br>
<br>
TagLib::FileRef *fr = new TagLib::FileRef("/Users/ibrahimshaath/Downloads/test.m4a");<br>
TagLib::File *f = fr->file();<br>
TagLib::MP4::File *mp4File = dynamic_cast<TagLib::MP4::File*>(f);<br>
can be reduced to<br>
<br>
TagLib::MP4::File *mp4File = new TagLib::MP4::File("/Users/ibrahimshaath/Downloads/test.m4a");<br>
<br>
At this point in time I am still unable to get Clang to build on this OS X10.5.8 box, I'm not an Apple person, It was free, it's a dual 2.3Mhz PPC G5, I wanted a Big Endian test box, it fit the bill, I think!<br>
<br>
Anything more I can do to help, feel free to ask!<br>
<br>
-Enjoy<br>
: )_~<br>
<br>
________________________________<br>
From: Ibrahim Sha'ath <<a href="javascript:;" onclick="_e(event, 'cvml', 'ibrahimshaath@gmail.com')">ibrahimshaath@gmail.com</a>><br>
To: Festus Hagen <<a href="javascript:;" onclick="_e(event, 'cvml', 'festushagenlists@yahoo.com')">festushagenlists@yahoo.com</a>><br>
Sent: Sunday, June 21, 2015 4:43 AM<br>
Subject: Re: TagLib 1.9.1 crash using C++11<br>
<br>
<br>
<br>
Hey Festus,<br>
<br>
I rewrote this into a sample app so you can see everything that's going on. This crashes the same way:<br>
<br>
int main() {<br>
TagLib::FileRef *fr = newTagLib::FileRef("/Users/ibrahimshaath/Downloads/test.m4a");<br>
TagLib::File *f = fr->file();<br>
TagLib::MP4::File *mp4File = dynamic_cast<TagLib::MP4::File*>(f);<br>
TagLib::String key = TagLib::String("\251grp");<br>
<br>
if (mp4File != NULL) {<br>
cout << "MP4filefound" << endl;<br>
if(mp4File->tag()->itemListMap().contains(key)) {<br>
TagLib::MP4::Itemi = mp4File->tag()->itemListMap()[key];<br>
TagLib::Stringstr = i.toStringList().front();<br>
cout << "Grouping:" << str.toCString(true) << endl;<br>
}<br>
<br>
TagLib::StringList sl(TagLib::String("DATA"));<br>
mp4File->tag()->itemListMap().insert(key, TagLib::MP4::Item(sl));<br>
cout << "Groupingdatainserted" << endl;<br>
mp4File->save();<br>
cout << "Filesaved" << endl;<br>
}<br>
return0;<br>
}<br>
It works if I compile it without C++11. With C++11, it can't read the itemListMap and crashes on insert. I haven't had the time to delve into the TagLib codebase and see what I might have done wrong, so I really appreciate your help and familiarity with the lib.<br>
<br>
Best<br>
Ibrahim<br>
<br>
<br>
<br>
<br>
On 20 June 2015 at 17:11, Festus Hagen <<a href="javascript:;" onclick="_e(event, 'cvml', 'festushagenlists@yahoo.com')">festushagenlists@yahoo.com</a>> wrote:<br>
<br>
Whoops ... I should of been more clear, I didn't expect it to resolve the crash, just eliminating the obvious.<br>
>Like I said previously, The example code you provided works as is, even though it's slightly improper.<br>
><br>
>The first parameter (the key) is a TagLib::String not a c_string, it behooves you to use proper data types.<br>
><br>
>It appears you have an Mp4FileMetadata class with a setGrouping(QString const&) function.<br>
><br>
>I assume that is where the snippet of code you posted came from?<br>
>May we see the entire function?<br>
><br>
><br>
>Also, You should strip down your code to be as simple as possible and still have the issue, I suspect you have an overrun or the like someplace and this just happens to be where it's getting stepped on ...<br>
><br>
>If you want, I'll send/post my test kissapp (and its CMakeLists.txt) so you can try it on your system, it is short, simple and to the point, though not pretty.<br>
><br>
>The CMakeLists is hard coded to find TagLib and would need modification to fit your system.<br>
><br>
><br>
>-Enjoy<br>
>: )_~<br>
><br>
>________________________________<br>
>From: Ibrahim Sha'ath <<a href="javascript:;" onclick="_e(event, 'cvml', 'ibrahimshaath@gmail.com')">ibrahimshaath@gmail.com</a>><br>
>To: Festus Hagen <<a href="javascript:;" onclick="_e(event, 'cvml', 'festushagenlists@yahoo.com')">festushagenlists@yahoo.com</a>>; <a href="javascript:;" onclick="_e(event, 'cvml', 'taglib-devel@kde.org')">taglib-devel@kde.org</a><br>
>Sent: Friday, June 19, 2015 1:45 PM<br>
><br>
>Subject: Re: TagLib 1.9.1 crash using C++11<br>
><br>
><br>
><br>
>Unfortunately, that did not prevent the crash, though it did shorten the stack:<br>
><br>
>0 ... std::__1::map<TagLib::String, TagLib::MP4::Item, std::__1::less<TagLib::String>, std::__1::allocator<std::__1::pair<TagLib::String const, TagLib::MP4::Item> > >::operator[](TagLib::String const&) + 211<br>
>1 ... Mp4FileMetadata::setGrouping(QString const&) + 195<br>
><br>
>As it turned out I had already implemented this change in almost every similar method in my app, but not that one! So thanks for pointing it out. I've also tried using a TagLib::String as the map key rather than just the C-string, but to no avail. I didn't notice the MP4::Tag::item property implementation in master, but I'll take another look.<br>
><br>
>By any chance does the shorter stack clarify anything?<br>
><br>
>Thanks again.<br>
><br>
><br>
><br>
><br>
>On 19 June 2015 at 14:11, Ibrahim Sha'ath <<a href="javascript:;" onclick="_e(event, 'cvml', 'ibrahimshaath@gmail.com')">ibrahimshaath@gmail.com</a>> wrote:<br>
><br>
>Festus, thank you very much. That looks spot on. Let me try it out when I get home.<br>
>><br>
>><br>
>>On 19 June 2015 at 01:55, Festus Hagen <<a href="javascript:;" onclick="_e(event, 'cvml', 'festushagenlists@yahoo.com')">festushagenlists@yahoo.com</a>> wrote:<br>
>><br>
>>Hi,<br>
>>><br>
>>>The following particulate from your stack trace shows that the second argument to insert() is a TagLib::MP4::Item not a TagLib::StringList ...<br>
>>>> insert(TagLib::String const&, TagLib::MP4::Item const&)<br>
>>><br>
>>>However, I did wrap your sample code with the rest of the necessities and it tests fine using GCC c++11 on Windows, FreeBSD and OS X.<br>
>>><br>
>>>I shall try CLang when it's done building ...<br>
>>><br>
>>>Might I suggest a slight code change: mp4File->tag()->itemListMap().insert("\251grp", TagLib::MP4::Item(sl));<br>
>>><br>
>>>TagLib master has new accessors MP4::Tag::item(const String &key) and MP4::Tag::setItem(const String &key, const Item &value) for this in the next release.<br>
>>><br>
>>>-Enjoy<br>
>>>: )_~<br>
>>>________________________________<br>
>>>From: Ibrahim Sha'ath <<a href="javascript:;" onclick="_e(event, 'cvml', 'ibrahimshaath@gmail.com')">ibrahimshaath@gmail.com</a>><br>
>>>To: <a href="javascript:;" onclick="_e(event, 'cvml', 'taglib-devel@kde.org')">taglib-devel@kde.org</a><br>
>>>Sent: Thursday, June 11, 2015 2:11 PM<br>
>>>Subject: Re: TagLib 1.9.1 crash using C++11<br>
>>><br>
>>><br>
>>><br>
>>><br>
>>>Hmmm. taglib2 didn't work either. A simpler stack trace, but looks like the same crash essentially:<br>
>>><br>
>>>0 ... 0x0000000108214283 std::__1::map<TagLib::String, TagLib::MP4::Item, std::__1::less<TagLib::String>, std::__1::allocator<std::__1::pair<TagLib::String const, TagLib::MP4::Item> > >::operator[](TagLib::String const&) + 211<br>
>>>1 ... 0x00000001082132f1 TagLib::Map<TagLib::String, TagLib::MP4::Item>::insert(TagLib::String const&, TagLib::MP4::Item const&) + 97<br>
>>><br>
>>>Is anyone successfully using the itemListMap with C++11? I can't read from it either, though that doesn't crash.<br>
>>><br>
>>><br>
>>><br>
>>><br>
>>><br>
>>>On 11 June 2015 at 18:33, Ibrahim Sha'ath <<a href="javascript:;" onclick="_e(event, 'cvml', 'ibrahimshaath@gmail.com')">ibrahimshaath@gmail.com</a>> wrote:<br>
>>><br>
>>>Sadly, current master didn't improve matters, so I imagine neither will that specific tag.<br>
>>>>I'll try out the v2 branch.<br>
>>>><br>
>>>><br>
>>>>On 5 June 2015 at 09:36, Ibrahim Sha'ath <<a href="javascript:;" onclick="_e(event, 'cvml', 'ibrahimshaath@gmail.com')">ibrahimshaath@gmail.com</a>> wrote:<br>
>>>><br>
>>>>Excellent Rob, cheers; I'll definitely check that out.<br>
>>>>><br>
>>>>><br>
>>>>>Your email ended up in spam for some reason.<br>
>>>>><br>
>>>>><br>
>>>>>On 5 June 2015 at 09:03, Rob Arnold <<a href="javascript:;" onclick="_e(event, 'cvml', 'rob@loci.net')">rob@loci.net</a>> wrote:<br>
>>>>><br>
>>>>>Same, but with master (specifically v1.9.1-197-g62ab41f), so perhaps a little closer to 1.9.1 than the taglib2 branch<br>
>>>>>>On OS X 10.10 with Clang, C++11 and 14 options turned on.<br>
>>>>>>My code uses StringList, File:save() and tag(), but doesn’t directly use itemListMap()<br>
>>>>>><br>
>>>>>><br>
>>>>>>On Jun 4, 2015, at 7:02 PM, Stephen F. Booth <<a href="javascript:;" onclick="_e(event, 'cvml', 'me@sbooth.org')">me@sbooth.org</a>> wrote:<br>
>>>>>>><br>
>>>>>>>I've used TagLib and C++11 successfully together, however I used the taglib2 branch and not the 1.9.1 release. Some of my classes using TagLib are at <a href="https://github.com/sbooth/SFBAudioEngine/tree/master/Metadata" target="_blank">https://github.com/sbooth/SFBAudioEngine/tree/master/Metadata</a> if you'd like to take a look.<br>
>>>>>>><br>
>>>>>>><br>
>>>>>>>Stephen<br>
>>>>>>><br>
>>>>>>><br>
>>>>>>>On Wed, Jun 3, 2015 at 8:45 AM, Ibrahim Sha'ath <<a href="javascript:;" onclick="_e(event, 'cvml', 'ibrahimshaath@gmail.com')">ibrahimshaath@gmail.com</a>> wrote:<br>
>>>>>>><br>
>>>>>>>If no-one has any idea about this issue specifically, has anyone successfully used C++11 for a TagLib 1.9.1 project?<br>
>>>>>><br>
>>>>>>_______________________________________________<br>
>>>>>>taglib-devel mailing list<br>
>>>>>><a href="javascript:;" onclick="_e(event, 'cvml', '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>
>>>>>><br>
>>>>><br>
>>>><br>
>>><br>
>>><br>
>>>_______________________________________________<br>
>>>taglib-devel mailing list<br>
>>><a href="javascript:;" onclick="_e(event, 'cvml', '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="javascript:;" onclick="_e(event, 'cvml', '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>
>><br>
><br>
_______________________________________________<br>
taglib-devel mailing list<br>
<a href="javascript:;" onclick="_e(event, 'cvml', '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>
</blockquote></div>