Summary: | amarok crashes reproducable when changing id3 tags of certain mp3s | ||
---|---|---|---|
Product: | [Frameworks and Libraries] taglib | Reporter: | Tilman Keskinöz <tilman> |
Component: | general | Assignee: | Scott Wheeler <wheeler> |
Status: | RESOLVED FIXED | ||
Severity: | crash | ||
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | FreeBSD Ports | ||
OS: | FreeBSD | ||
Latest Commit: | Version Fixed In: | ||
Attachments: | truncated sample of an mp3 that causes a taglib crash on my system |
Description
Tilman Keskinöz
2004-12-08 12:27:45 UTC
Markus Brueffer reminded me to add that, this is an amd64 system: % uname -a FreeBSD mchammer.arved.de 6.0-CURRENT FreeBSD 6.0-CURRENT #9: Tue Dec 7 10:10:38 CET 2004 root@mchammer.arved.de:/usr/obj/usr/src/sys/MCHAMMER amd64 Adding the following Observations: Markus Brueffer was able to edit the tags of the same file on a i386. After editing, he sent the file back to me, and now i am able to edit the file too. So it looks like a combination of a 64-bit issue and certain tags. The tag that makes amarok crash looks like this in hexedit: % hd Sertab_Erener-Here_I_am.mp3 | more 00000000 49 44 33 03 00 00 00 00 0b 2a 54 52 43 4b 00 00 |ID3......*TRCK..| 00000010 00 01 00 00 00 54 45 4e 43 00 00 00 01 40 00 00 |.....TENC....@..| 00000020 57 58 58 58 00 00 00 02 00 00 00 00 54 43 4f 50 |WXXX........TCOP| 00000030 00 00 00 01 00 00 00 54 4f 50 45 00 00 00 01 00 |.......TOPE.....| 00000040 00 00 54 43 4f 4d 00 00 00 01 00 00 00 43 4f 4d |..TCOM.......COM| 00000050 4d 00 00 00 05 00 00 00 00 08 00 00 54 43 4f 4e |M...........TCON| 00000060 00 00 00 08 00 00 00 28 31 33 29 50 6f 70 54 59 |.......(13)PopTY| 00000070 45 52 00 00 00 01 00 00 00 54 41 4c 42 00 00 00 |ER.......TALB...| 00000080 01 00 00 00 54 50 45 31 00 00 00 13 00 00 00 30 |....TPE1.......0| 00000090 38 20 2d 20 53 65 72 74 61 62 20 45 72 65 6e 65 |8 - Sertab Erene| 000000a0 72 54 49 54 32 00 00 00 0a 00 00 00 48 65 72 65 |rTIT2.......Here| 000000b0 20 49 20 41 6d 00 00 00 00 00 00 00 00 00 00 00 | I Am...........| 000000c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| * 000005b0 00 00 00 00 ff fb 92 40 00 00 02 4f 08 d0 69 89 |.......@ The editable tag looks like this: hd Sertab_Erener-Here_I_am.mp3| more 00000000 49 44 33 04 00 00 00 00 0b 2a 54 52 43 4b 00 00 |ID3......*TRCK..| 00000010 00 02 00 00 00 38 54 49 54 32 00 00 00 0a 00 00 |.....8TIT2......| 00000020 00 48 65 72 65 20 49 20 41 6d 54 50 45 31 00 00 |.Here I AmTPE1..| 00000030 00 0e 00 00 00 53 65 72 74 61 62 20 45 72 65 6e |.....Sertab Eren| 00000040 65 72 54 44 52 43 00 00 00 05 00 00 00 32 30 30 |erTDRC.......200| 00000050 34 54 43 4f 4e 00 00 00 03 00 00 00 31 33 00 00 |4TCON.......13..| 00000060 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| * 000005b0 00 00 00 00 ff fb 92 40 00 00 02 4f 08 d0 69 89 |.......@ Looks to me like a TagLib bug, as it crashes in TagLib::ID3v2::Tag::removeFrame. I'm reassigning this to TagLib. Scott, if you think this is not a TagLib bug, please assign it back to us. Cheers. Okay, I upgraded to taglib CVS, but the bug is still present. Just for the record another sample that triggers a crash: 00000000 49 44 33 04 00 00 00 00 09 20 54 49 54 32 00 00 |ID3...... TIT2..| 00000010 00 1b 00 00 00 42 61 62 79 20 6f 6e 65 20 6d 6f |.....Baby one mo| 00000020 72 65 20 74 69 6d 65 20 2d 20 52 65 6d 69 78 54 |re time - RemixT| 00000030 50 45 31 00 00 00 0f 00 00 00 42 72 69 74 6e 65 |PE1.......Britne| 00000040 79 20 53 70 65 61 72 73 54 41 4c 42 00 00 00 1e |y SpearsTALB....| 00000050 00 00 00 55 70 65 64 20 62 79 20 41 75 73 74 69 |...Uped by Austi| 00000060 6e 31 20 77 77 77 2e 73 70 65 61 72 73 2e 64 65 |n1 www.spears.de| 00000070 54 44 52 43 00 00 00 05 00 00 00 31 39 39 39 43 |TDRC.......1999C| 00000080 4f 4d 4d 00 00 00 14 00 00 00 20 20 20 00 6d 70 |OMM....... .mp| 00000090 33 68 69 74 7a 2e 74 73 78 2e 6f 72 67 54 43 4f |3hitz.tsx.orgTCO| 000000a0 4e 00 00 00 03 00 00 00 31 33 00 00 00 00 00 00 |N.......13......| 000000b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| * Okay, i commented out "delete *it" from void ID3v2::Tag::removeFrame in id3v2tag.cpp and the tag editing seems to work now. So why does it fail for some tags? Created attachment 9238 [details]
truncated sample of an mp3 that causes a taglib crash on my system
Scott asked for the first 10 KB of a sample file
Hmm. And you can reproduce the crash with this sample? Here it works just fine... Yes, this is reproducable with todays amarok-CVS, Maybe it works for you because you are running i386 and not amd64? Quite possibly. There have been a couple of weird bugs with x86_64 (I actually have one, but run in 32-bit mode.). It may even be some interaction of the libc on FBSD and x86_64. I've already worked around a couple of glibc quirks on x86_64. Another thing you might try is doing an unoptimized build of TagLib and see if the backtrace comes out the same. The unoptimized build crashes too, but i haven't got a backtrace, because i first need to disable the new amarok crashhandler, which i suspect to be the cause why i am getting unusable .core files. If you have any other idea what i might want to try, please followup. Thanks again for your work! This i a bug. replace if(del) delete *it by if(del) delete frame; after doing d->frameListMap[frame->frameID()].erase(it); it is invalid, because the list has changed, but not the iterator. It points to the element after the erased element. So delete *it actually deletes not the earased element but it successor. On next iteration of the calling ID3v2::Tag::removeFrames method, an already deleted element is used. But as we already have a nice pointer for the to be deletd element we can simply call "delete frame". CVS commit by wheeler: Nice catch from Gunnar Roth -- the iterator was invalid here. BUG:94662 M +1 -1 id3v2tag.cpp 1.49 --- kdesupport/taglib/mpeg/id3v2/id3v2tag.cpp #1.48:1.49 @@ -321,5 +321,5 @@ void ID3v2::Tag::removeFrame(Frame *fram // ...and delete as desired if(del) - delete *it; + delete frame; } |