Routine works on PC, crashes on PSP.. Why?

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
Art
Posts: 642
Joined: Wed Nov 09, 2005 8:01 am

Routine works on PC, crashes on PSP.. Why?

Post by Art »

Hi Guys,
I spent a lot of time debugging a routine that runs through files and converts
strings to floats, sorting, indexing, and other things.

The PSP version runs well for a while on some particular files, and crashes
in the same place every time.

The same routine running on my PC with identical array sizes, endian-ness, etc. processes the entire files fine.

I'm stumped as to why a very standard and straight forward operation would
work on one platform and not another.

The only difference is the PC version writes to another RAM buffer, and the PSP writes direct to MS.
Many files do work on the PSP version though, and give expected results.

Would the potential time spent in while loops crash the PSP?
Any other ideas?
Cheers, Art.
If not actually, then potentially.
m0skit0
Posts: 191
Joined: Tue Jun 02, 2009 8:58 pm

Post by m0skit0 »

Stack overflow?
The Incredible Bill Gates wrote:The obvious mathematical breakthrough would be development of an easy way to factor large prime numbers.
User avatar
Jim
Posts: 476
Joined: Sat Jul 02, 2005 10:06 pm
Location: Sydney
Contact:

Post by Jim »

That or memory corruption.

Jim
User avatar
jbit
Site Admin
Posts: 293
Joined: Sat May 28, 2005 3:11 am
Location: København, Danmark
Contact:

Post by jbit »

Alignment?
User avatar
Coldbird
Posts: 97
Joined: Thu Feb 08, 2007 7:22 am

Re: Routine works on PC, crashes on PSP.. Why?

Post by Coldbird »

Art wrote:Would the potential time spent in while loops crash the PSP?
Yup... the PSP loves to nuke itself if a loop is repeating itself too fast. Mostly becaue of CPU hogging...

Try to place a sceKernelDelayThread(100); inside your loop somewhere and see if that fixes your problems.
Been gone for some time. Now I'm back. Someone mind getting me up-2-date?
Art
Posts: 642
Joined: Wed Nov 09, 2005 8:01 am

Post by Art »

Thanks for the replies guys.
I have a feeling the length of time spent in a while loop is causing it
because it's crashing when the array is larger, and execution is hanging
around in a while loop longer.

I'll try the delay first up since it seems to fit.
If not actually, then potentially.
User avatar
Torch
Posts: 825
Joined: Wed May 28, 2008 2:50 am

Post by Torch »

You haven't mentioned the kind of crash at all. If you are sure that the program was executing all the while until the second it powered off then its because the loop is too long. You need to delay thread. If it crashed ten seconds before powering off then its another error.
Art
Posts: 642
Joined: Wed Nov 09, 2005 8:01 am

Post by Art »

Well the delay didn't help. It crashes in the same place.
Yes it stops ten seconds or so before powering off.

I don't think alignment is a problem since it's only dealing with an array of bytes
where floats expressed in ascii text are converted to floats expressed as four bytes
(using a few float variables to do the conversions).
If not actually, then potentially.
User avatar
Coldbird
Posts: 97
Joined: Thu Feb 08, 2007 7:22 am

Post by Coldbird »

Would you be so kind and pastebin the code?
Theory is nice and good but... actual code would be better.
Been gone for some time. Now I'm back. Someone mind getting me up-2-date?
sauron_le_noir
Posts: 203
Joined: Sat Jul 05, 2008 8:03 am

Post by sauron_le_noir »

Does it crash when running under gdb & psplink debugger ?
If not try to seek for unitialize variable ;) . Under your pc and under the debugger
normaly all memory zone are set to 0x00.

Pointer's are good candiate for this type of behavior's
jimparis
Posts: 1145
Joined: Fri Jun 10, 2005 4:21 am
Location: Boston

Post by jimparis »

On the PC, run it under valgrind to find memory corruption bugs.
Post Reply