• Steam recently changed the default privacy settings for all users. This may impact tracking. Ensure your profile has the correct settings by following the guide on our forums.

how to handle runtime errors?

AndrewYY

New Member
Ok, so here's the problem: I've been working on a few projects for the PSP (using the PSPSDK), and I've noticed that sometimes, the game freezes completely, and one of two things happen:
  1. The PSP completely crashes, and turns itself off after a while - this is often because of a segfault
  2. Only the game is frozen, and I can press the home button, but if I try to exit the game, it gets stuck (no crash) - this often happens if I forget to free up memory
Now I realize that I have to ultimately fix these bugs by finding the problem code and making it work as intended, but for the second case, I feel that it may be salvageable (i.e. some sort of force-quit function that won't require me to reboot the PSP)

The reason I'm looking for something like this is that I'm running on ChickHEN, and running the exploit every time the game crashes gets VERY frustrating.

Any thoughts?

Thanks,
Andrew
 

slicer4ever

Coding random shit
1. install psplink, it'll help you track down the problem, but it's as you said, it's due to seg-fault's, look for wherever you access large amounts of data and you'll probably find an out of bound request, re-deleting already deleted memory, or something along those lines

2. most likly you've most likly entered an infinite loop, which is why only the home button works(different thread), and most likly as well is that w/e your doing to free memory causes the crash(similar to problem 1)

you've already figured out 1, to help track down the problems i recommend psplink, it's a great tool for any psp-developer
 

AndrewYY

New Member
thanks for the tips :)

I've setup a separate thread that can call the quit function even if I'm on an infinite loop in the main thread. I don't think I should have that problem anymore.

As for psplink, it looks like a godsend. Can't believe I haven't stumbled upon it yet.

Cheers!
 

MenaceInc

Staff Member
PSPlink is included with the PSPSDK and honestly it's quite difficult to setup (especially on Windows 7 x64 due to signed driver requirements) but it helps a lot. You'd find a lot of information on PSP-Programming.com Forums - Index that should help with setting it up.
 

Hellcat

Contributor
Make sure the callback that gets created for the ExitGame call is also created from a seperate thread and that thread is then set to SleepThreadCB or - if does perform more work - calls a CB (callback checking) sys func' every now and then.

Do not create the ExitGame callback from your main thread, or it likely will NEVER be called / triggered / executed.
 

wololo

New Member
There's a great plugin that you can add to your homebrews, which would help you with segfaults. I'm using it in Wagic and it works like a charm, for segfaults.

forums.ps2dev.org :: View topic - Exception Handler for Kernel 3.xx

Edit: this plugin is great for "release" purposes (it avoids pissing off ChickHen users if there's a bug in your application :D ). For testing and debugging your application yourself, psplink is the best choice, as people above me already suggested.
 

AndrewYY

New Member
having problems with psplink. To be expected, I guess :/

Oslib doesn't seem to like being compiled into a prx. I get exception - syscall and crash. All of my projects not using oslib seem to work fine.

on the other hand. the exception handler prx seems to work fine.

edit: oops, missed your post there Hellcat. Roger, re. what you said.
 
Top