Rockbox.org home
Downloads
Release release
Dev builds dev builds
Extras extras
themes themes
Documentation
Manual manual
Wiki wiki
Device Status device status
Support
Forums forums
Mailing lists mailing lists
IRC IRC
Development
Bugs bugs
Patches patches
Dev Guide dev guide
Search



Donate

Rockbox Technical Forums


Login with username, password and session length
Home Help Search Staff List Login Register
News:

Rockbox Ports are now being developed for various digital audio players!

+  Rockbox Technical Forums
|-+  Support and General Use
| |-+  Hardware
| | |-+  Clip Zip Divide by Zero 30083AC0
« previous next »
  • Print
Pages: 1 [2]

Author Topic: Clip Zip Divide by Zero 30083AC0  (Read 6470 times)

Offline saratoga

  • Developer
  • Member
  • *
  • Posts: 8974
Re: Clip Zip Divide by Zero 30083AC0
« Reply #15 on: April 23, 2015, 06:46:18 PM »
Config file doesn't matter for me (crashes if its deleted), but the folder does matter.  If I put it in a directory alone, then it plays.  If I put it in a directory with one other MP3 file so that a track after it must be buffered, then it crashes. 

Try with this folder:

http://mit.edu/mgg6/www/crashes.7z

Edit:  This crashes the Zip, but not the Clip+.
« Last Edit: April 24, 2015, 10:59:16 AM by saratoga »
Logged

Offline mudlord

  • Member
  • *
  • Posts: 3
Re: Clip Zip Divide by Zero 30083AC0
« Reply #16 on: April 23, 2015, 07:11:23 PM »
Found something interesting, indeed doesnt crash from the Zip's internal memory, only crashes from the microSD card. I'll try adding more files and seeing what happens from internal memory.

edit: yep, confirmed your crash scenario with internal memory, too.
« Last Edit: April 23, 2015, 07:16:01 PM by mudlord »
Logged

Offline dreamlayers

  • Developer
  • Member
  • *
  • Posts: 425
  • Boris Gjenero
    • My Blog
Re: Clip Zip Divide by Zero 30083AC0
« Reply #17 on: April 23, 2015, 07:19:06 PM »
I'm getting crashes when running from internal memory when there are other things to play afterwards. There is no crash if the m4a is the only playable file in the directory or if it comes last. The crash is when fetching cached->id at the "if (cached && cached->id == handle_id) {" line in find_handle() in apps/buffering.c:

Edit: disregard what I said before. It is actually in the while loop lower down in find_handle(), when fetching m->id:

http://git.rockbox.org/?p=rockbox.git;a=blob;f=apps/buffering.c;h=96ec92201fffa468128c10015fad6580d5bbff1c;hb=HEAD#l403

Code: [Select]
    while (m && m->id != handle_id) {
        m = m->next;
    }

Edit2: This is a RAM dump when the crash occurred: https://dl.dropboxusercontent.com/u/16662598/Rockbox/internal_ram_clipzip_buffercrash.bin.xz This seems to be the handle situation. Offsets are in RAM dump, which started at 0x30000000 in memory. first_handle (pointer to first handle) is at A4A40 and pointer to next handle is at handle offset plus 0x12C.

1680a0 id=1
168918 id=2
169124 Next handle should be here, but there's no sign of it and other data instead.

Edit3: This starts around 7d1a47c Rewrite filesystem code (WIP), because 95a4c3a works but da4938d crashes.
« Last Edit: April 27, 2015, 01:35:27 AM by dreamlayers »
Logged

Offline jhMikeS

  • Developer
  • Member
  • *
  • Posts: 242
Re: Clip Zip Divide by Zero 30083AC0
« Reply #18 on: April 28, 2015, 03:57:20 PM »
This is particular to the file format?
Logged

Offline saratoga

  • Developer
  • Member
  • *
  • Posts: 8974
Re: Clip Zip Divide by Zero 30083AC0
« Reply #19 on: April 28, 2015, 04:46:58 PM »
Quote from: jhMikeS on April 28, 2015, 03:57:20 PM
This is particular to the file format?

I have only been able to reproduce it with an AAC followed by an MP3. 
Logged

Offline jhMikeS

  • Developer
  • Member
  • *
  • Posts: 242
Re: Clip Zip Divide by Zero 30083AC0
« Reply #20 on: April 28, 2015, 05:08:47 PM »
A regular, non-zero pattern fill of the entire audio buffer just before playback starts might help. It's hard to tell if the garbage was already there or filled-in by playback's file reading. Post a RAM dump of that.
Logged

Offline jhMikeS

  • Developer
  • Member
  • *
  • Posts: 242
Re: Clip Zip Divide by Zero 30083AC0
« Reply #21 on: April 28, 2015, 05:16:36 PM »
Perhaps provide the very file as well, please?
Logged

Offline saratoga

  • Developer
  • Member
  • *
  • Posts: 8974
Re: Clip Zip Divide by Zero 30083AC0
« Reply #22 on: April 28, 2015, 06:12:19 PM »
Sorry thought you had this:
http://mit.edu/mgg6/www/crashes.7z

Edit:  Playing the M4A in that folder structure generates the crash.  Other structures do not necessarily (see dreamlayers comment above).

Edit2:  The Zip and Fuze+ crash, but I could not get the Clip+ to. 
« Last Edit: April 28, 2015, 09:58:52 PM by saratoga »
Logged

Offline jhMikeS

  • Developer
  • Member
  • *
  • Posts: 242
Re: Clip Zip Divide by Zero 30083AC0
« Reply #23 on: May 02, 2015, 06:43:59 AM »
Quote from: saratoga on April 28, 2015, 06:12:19 PM
Sorry thought you had this:
http://mit.edu/mgg6/www/crashes.7z

I guess I missed that. I tried the direct m4a link and it wasn't working.

Does this only happen when the buffering of the mp3 starts (I don't think the first file will fit in its entirety)? I ask because I don't know if I'll be able to duplicate it because the closest device I have as far as memory size is a Fuze V2. My only AMS V1 is a clip with only 2MB.

I'm suspicious that it's low-level if it's specific to certain devices. It's worth mentioning here again that the newer file system code doesn't align buffers at the file API level, which already had side effects on another model but that was fixed up.

It's also possible that obeying POSIX more closely actually changed some expected return values/errnums.

Getting a sentinel-marked buffer dump would help me see if the last handle for the MP3 metadata isn't just being clobbered on account of over reading the previous M4A.

Well, I've got plenty of ideas of things to check but not much info yet to start ruling things out. Will get back...
Logged

Offline saratoga

  • Developer
  • Member
  • *
  • Posts: 8974
Re: Clip Zip Divide by Zero 30083AC0
« Reply #24 on: May 02, 2015, 03:15:52 PM »
Fuze v2 and Zip are nearly identical (same SOC, same memory, both color displays) so I expect it will happen on Fuze v2, but I don't have one to try. 

There was also a report of an ALAC file that causes the same effect (crash post file system rework, fine before it), but I never got a sample to test so I didn't pay attention to it.  Does the MP4 parser do something unusual compared to other codecs?
Logged

Offline dreamlayers

  • Developer
  • Member
  • *
  • Posts: 425
  • Boris Gjenero
    • My Blog
Re: Clip Zip Divide by Zero 30083AC0
« Reply #25 on: May 03, 2015, 12:10:26 PM »
When playing the "crashes" directory, the Clip Zip sim prints "rebuffer_handle(): space is needed". This does not happen when: the mp3 file comes first and I play either file, the m4a is the only file in the folder, or I play a folder with mp3 files. Everything seems to work fine in the sim, but I wonder if that rebuffer_handle() somehow fails on the real device.
Logged

Offline jhMikeS

  • Developer
  • Member
  • *
  • Posts: 242
Re: Clip Zip Divide by Zero 30083AC0
« Reply #26 on: May 06, 2015, 01:59:27 AM »
The Fuze V2 gets hit with a data abort followed by an undefined instruction. It looks like that particular MP3 has to follow the M4A. I haven't found other MP3 files already on the device that I replace it with that trigger the bug.

ETA: e200 V1 also has issues with the same file combination but doesn't crash outright. I attached a capture of the crazy buffering screen stats.

ETAA: It's worthy to note that both files fit in the buffer so it's strictly these in series that's triggering.

* dump 150506-030221.PNG (4.1 kB, 176x220 - viewed 325 times.)
« Last Edit: May 06, 2015, 03:34:35 AM by jhMikeS »
Logged

Offline jhMikeS

  • Developer
  • Member
  • *
  • Posts: 242
Re: Clip Zip Divide by Zero 30083AC0
« Reply #27 on: April 08, 2017, 07:17:32 PM »
Finally should be squashed in eefc7c7.
Logged

  • Print
Pages: 1 [2]
« previous next »
+  Rockbox Technical Forums
|-+  Support and General Use
| |-+  Hardware
| | |-+  Clip Zip Divide by Zero 30083AC0
 

  • SMF 2.0.17 | SMF © 2019, Simple Machines
  • Rockbox Privacy Policy
  • XHTML
  • RSS
  • WAP2

Page created in 0.087 seconds with 14 queries.