| View previous topic :: View next topic |
| Author |
Message |
Art
Joined: 09 Nov 2005 Posts: 647
|
Posted: Wed Sep 23, 2009 4:58 pm Post subject: Routine works on PC, crashes on PSP.. Why? |
|
|
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. |
|
| Back to top |
|
 |
m0skit0
Joined: 02 Jun 2009 Posts: 226
|
Posted: Wed Sep 23, 2009 5:52 pm Post subject: |
|
|
Stack overflow? _________________
| The Incredible Bill Gates wrote: | | The obvious mathematical breakthrough would be development of an easy way to factor large prime numbers. |
|
|
| Back to top |
|
 |
Jim

Joined: 02 Jul 2005 Posts: 487 Location: Sydney
|
|
| Back to top |
|
 |
jbit Site Admin

Joined: 28 May 2005 Posts: 293 Location: København, Danmark
|
Posted: Wed Sep 23, 2009 8:49 pm Post subject: |
|
|
| Alignment? |
|
| Back to top |
|
 |
Coldbird

Joined: 08 Feb 2007 Posts: 155
|
Posted: Thu Sep 24, 2009 10:13 am Post subject: Re: Routine works on PC, crashes on PSP.. Why? |
|
|
| 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? |
|
| Back to top |
|
 |
Art
Joined: 09 Nov 2005 Posts: 647
|
Posted: Thu Sep 24, 2009 1:51 pm Post subject: |
|
|
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. |
|
| Back to top |
|
 |
Torch

Joined: 28 May 2008 Posts: 842
|
Posted: Thu Sep 24, 2009 5:18 pm Post subject: |
|
|
| 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. |
|
| Back to top |
|
 |
Art
Joined: 09 Nov 2005 Posts: 647
|
Posted: Thu Sep 24, 2009 10:39 pm Post subject: |
|
|
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. |
|
| Back to top |
|
 |
Coldbird

Joined: 08 Feb 2007 Posts: 155
|
Posted: Fri Sep 25, 2009 1:19 am Post subject: |
|
|
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? |
|
| Back to top |
|
 |
sauron_le_noir
Joined: 05 Jul 2008 Posts: 229
|
Posted: Fri Sep 25, 2009 1:32 am Post subject: |
|
|
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 |
|
| Back to top |
|
 |
jimparis
Joined: 10 Jun 2005 Posts: 1179 Location: Boston
|
Posted: Fri Sep 25, 2009 3:15 am Post subject: |
|
|
| On the PC, run it under valgrind to find memory corruption bugs. |
|
| Back to top |
|
 |
|