Rockbox Technical Forums

Support and General Use => Plugins/Viewers => Topic started by: sidnancy on May 24, 2012, 09:27:16 PM

Title: Crash on return from a plugin after booting directly to it
Post by: sidnancy on May 24, 2012, 09:27:16 PM
Hi,
(Huge rockbox fan)

I'm using 3.11.2 on an ipod mini 1st Gen.
I installed using the standard windows installer and everything worked fine.
I set up a development environment using the Virtual machine as described here:
http://www.rockbox.org/wiki/DevelopmentGuide#Virtual_Machine_40Strongly_Recommended_41

No problem.
I created a plugin, and the plugin works fine in the emulator and on the actual Ipod Mini when run from the plugin menu.

I want rockbox to boot directly to the plugin, so I edited the main.c file to enable the autostart.rock, and renamed my plugin. Everything worked fine in the emulator, booting directly to the plugin, and back to the main menu when the user quits the plugin.

On the actual Ipod, however, when the user quits the plugin, the screen reads:

Divide by zero at 01E87
bt pc: 0x01E875FC, sp:
bt end

If I change the name of autorun.rock, I can run it like a regular plugin, and everything works fine on this custom build without crashing.

Since the standard build has autorun disabled, I can't reproduce, so haven't filed a bug report or anything like that.

So wondering if anyone has any ideas how I would go about debugging this?

Title: Re: Crash on return from a plugin after booting directly to it
Post by: saratoga on May 24, 2012, 10:54:17 PM
In 3.11.2, that address is in bookmark_exists (or a nearby static function) as far as I can tell from the map file. 

That said, are you actually running 3.11.2?  Seems unlikely if you're building from source unless you went and checked out the old code. If you're not, check where that address is in the rockbox.map in your build directory.  Maybe that will have a clue.
Title: Re: Crash on return from a plugin after booting directly to it
Post by: sidnancy on May 25, 2012, 04:08:30 AM
Thanks for your reply, saratoga.

I see now that in rockbox-info.txt it says:
Version: bb0e4ccM-120524

And in the rockbox.map it does say:

 .text          0x00001d00     0x143c /home/ubuntu/rockbox/ipodminilive/apps/bookmark.o
                0x00001d2c                bookmark_is_bookmarkable_state
                0x00001e04                bookmark_exists
                0x00002a04                bookmark_load
                0x00002ab0                bookmark_autoload

So thanks for pointing me at that.

Also, is there somewhere I can find more information on the versioning, and how to be sure I have the latest stable version of code?
I used Git as described on this page: http://www.rockbox.org/wiki/HowToCompile
I did that on April 13. Is there something that keeps things up to date, or do I need to do that manually?

Thanks again.
Title: Re: Crash on return from a plugin after booting directly to it
Post by: saratoga on May 25, 2012, 10:01:43 AM
Yeah see http://www.rockbox.org/wiki/UsingGit#Updating_the_source
Title: Re: Crash on return from a plugin after booting directly to it
Post by: sidnancy on May 25, 2012, 01:08:15 PM
I have changed the code to the point of removing the entire bookmark_exists function, the memory map has changed, yet the error message remains:

Divide by zero at 01E87
bt pc: 0x01E875FC, sp:
bt end

No change at all. Same error, same error location.

Any other suggestions would be welcomed.

Thanks

EDIT:
For what it's worth, moving the
#ifdef AUTOROCK

section of code out of main.c and into the root_menu() function in the root_menu.c file fixes the problem. I now have it just before the while(true) loop.

Anyway, thanks for the help, and thanks for RockBox.