FS#8402 - vbrfix plugin causes *PANIC* Stkov main

Attached to Project: Rockbox
Opened by bundy (bundy) - Friday, 04 January 2008, 17:08 GMT
Last edited by Linus Nielsen Feltzing (linusnielsen) - Wednesday, 09 January 2008, 12:39 GMT
Task Type Bugs
Category Plugins
Status Closed
Assigned To No-one
Operating System iAudio X5
Severity Low
Priority Normal
Reported Version Daily build (which?)
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No


I tried to correct the VBR information in one MP3 which showed above 20 minutes of playtime, even if I know it contains only 4 minutes.

After percentage went quite fast to 99% it stopped here. Almost immediately the "*PANIC* Stkov main" message showed up. I had to restart it.

I even tried to narrow down the problem - added few splashes into vbrfix code. The stack overflow occurs within insert_data_in_file function. The last splash occurred right before renaming of temporal file to original name. The splash after rename never came, as the PANIC halted the unit.

Fortunately I simply renamed the temp file by hand and had a working file.

I even analyzed the original MP3 file (I've had a backup) afterwards, it didn't contain VBR information, nor was there space between ID3 tag and MP3 stream.

Hope this helps to solve the problem.
This task depends upon

Closed by  Linus Nielsen Feltzing (linusnielsen)
Wednesday, 09 January 2008, 12:39 GMT
Reason for closing:  Fixed
Additional comments about closing:  Thanks for your assistance in finding this bug.
Comment by Linus Nielsen Feltzing (linusnielsen) - Monday, 07 January 2008, 08:54 GMT
Was the file name long?
Comment by bundy (bundy) - Monday, 07 January 2008, 15:21 GMT
No. In fact, I suspected the same thing, so I copied it again as \new\01.mp3 and it crashed with the same problem.
Comment by Linus Nielsen Feltzing (linusnielsen) - Monday, 07 January 2008, 15:48 GMT
Hmmm, I can't reproduce the problem with my X5. I wonder why...?
Comment by bundy (bundy) - Tuesday, 08 January 2008, 08:05 GMT
I will try to repeat it again with a smaller sample of the same file (i.e. I will cut the mp3) and I may post it somewhere if it persist.
Comment by Linus Nielsen Feltzing (linusnielsen) - Tuesday, 08 January 2008, 09:00 GMT
Do you mean that the MP3 file itself is very big? That might be a clue.
Comment by bundy (bundy) - Wednesday, 09 January 2008, 08:13 GMT
Well, the file itself is in reasonable size.

I uploaded another crash sample here:
The password for the 7z archive is my nick. It includes a MP3 file, it's removed VBR frame and my config file.

You don't need to download the archive. There is a way to reproduce it on your own:
1) take any VBR mp3 file (I tried few, all show the same behavior)
2) remove ID3v2 tag
3) remove first frame, which contains VBR information (any decent hex editor should work)
4) run vbrfix plugin to recover the first frame

It seems like it recovers it, but just before the rename the crash happens.