 |
forums.ps2dev.org Homebrew PS2, PSP & PS3 Development Discussions
|
| View previous topic :: View next topic |
| Author |
Message |
ab5000
Joined: 06 May 2008 Posts: 74
|
Posted: Tue Aug 11, 2009 3:07 am Post subject: [SOLVED] Strange VLF crash |
|
|
Hi.
I ported moonlight's psppacker to PSP. The application uses VLF, but there's a strange crash. Here's the code:
| Code: | | while(prxSearch[++i] && pathnum < MAXPATHS) { |
that's the line causing the crash. prxSearch is an array of paths to search for PRX on the MemoryStick (so then the user can select what prx to compress). pathnum is the number of found PRXs.
prxSearch[0] and prxSearch[1] are valid paths, prxSearch[2] is NULL, to make the loop break. when it reach the NULL, boom, crash. i start from -1 (I do that to make the loop a bit more compact). the VERY strange thing is that the program also search PBPs, and it's done before PRX search. this line:
| Code: | | while(gameSearch[++i] && pathnum < MAXPATHS) { |
doesn't crash!
here's prxSearch and gameSearch:
| Code: | char *gameSearch[] = {
"ms0:/PSP/GAME/",
"ms0:/PSP/GAME150/",
"ms0:/PSP/GAME3XX/",
"ms0:/PSP/GAME4XX/",
"ms0:/PSP/GAME5XX/",
"ms0:/CGAME/",
NULL
};
char *prxSearch[] = {
"ms0:/seplugins/",
"ms0:/CPRX/",
NULL
}; |
crash details:
| Code: | Exception - Bus error (data)
Thread ID - 0x044B665D
Th Name - user_main
Module ID - 0x044BEB51
Mod Name - VLF_Module
EPC - 0x08869C90
Cause - 0x1000001C
BadVAddr - 0x00000000
Status - 0x20088613
zr:0x00000000 at:0xDEADBEEF v0:0x4C505351 v1:0x00000067
a0:0x4C505350 a1:0x00000080 a2:0x4C505350 a3:0x00000000
t0:0x00000086 t1:0x00000000 t2:0x09FB7D00 t3:0x10199999
t4:0xDEADBEEF t5:0x40601999 t6:0x00000000 t7:0xDEADBEEF
s0:0x08B25170 s1:0x4C505350 s2:0x09FB7DB0 s3:0x00000080
s4:0x000000F0 s5:0x08910000 s6:0x00000000 s7:0x000000F0
t8:0xDEADBEEF t9:0x08814F4C k0:0x09FBBF00 k1:0x00000000
gp:0x08893B30 sp:0x09FB7D08 fp:0x08807D94 ra:0x0881CF3C
0x08869C90: 0x90830000 '....' - lbu $v1, 0($a0) |
the crash is in VLF module. very strange, 'cause when it crash i doesn't call any vlf function...
can somebody help me?
thanks! _________________
| Code: | %:include<stdio.h>
int _(int __,int ___,int ____,int _____)
<%for(;____<___;_____=_____*__,____++);
return _____;%>main()<%printf
("%d\n",_(2,5,0,1));%> |
Last edited by ab5000 on Wed Aug 12, 2009 6:27 pm; edited 1 time in total |
|
| Back to top |
|
 |
Mon Ouïe
Joined: 05 Jul 2009 Posts: 36
|
Posted: Tue Aug 11, 2009 4:59 am Post subject: |
|
|
| I have never used the vlf, but you should use psplink. You'll get a better backtrace (because you'll be able to use gdb). |
|
| Back to top |
|
 |
ab5000
Joined: 06 May 2008 Posts: 74
|
Posted: Tue Aug 11, 2009 8:14 pm Post subject: |
|
|
| Mon Ouïe wrote: | | I have never used the vlf, but you should use psplink. You'll get a better backtrace (because you'll be able to use gdb). |
i use psplink, but i cannot make psp-gdb work. the program start ONLY if it's a prx, and even if i compile with -g no debugging symbol are in prx.
EDIT: i figured out it. psplink only loads prx. to debug a prx just load the prx in pspslink and the elf in psp-gdb
EDIT2: it doesn't work. breakpoints gets detected by psplink, but psp-gdb is still "continuing."... :( _________________
| Code: | %:include<stdio.h>
int _(int __,int ___,int ____,int _____)
<%for(;____<___;_____=_____*__,____++);
return _____;%>main()<%printf
("%d\n",_(2,5,0,1));%> |
|
|
| Back to top |
|
 |
jojojoris
Joined: 30 Mar 2008 Posts: 261
|
Posted: Wed Aug 12, 2009 2:20 am Post subject: |
|
|
I use eclipse as graphical GDB ... thing.
[url=http://sourceforge.net/projects/minpspw/files/book/PSP Dev with Eclipse/pspeclipse.pdf]here[/url]
There is described how to do it. _________________
| Code: | int main(){
SetupCallbacks();
makeNiceGame();
sceKernelExitGame();
} |
|
|
| Back to top |
|
 |
ab5000
Joined: 06 May 2008 Posts: 74
|
Posted: Wed Aug 12, 2009 3:02 am Post subject: |
|
|
| jojojoris wrote: | I use eclipse as graphical GDB ... thing.
[url=http://sourceforge.net/projects/minpspw/files/book/PSP Dev with Eclipse/pspeclipse.pdf]here[/url]
There is described how to do it. |
thanks. _________________
| Code: | %:include<stdio.h>
int _(int __,int ___,int ____,int _____)
<%for(;____<___;_____=_____*__,____++);
return _____;%>main()<%printf
("%d\n",_(2,5,0,1));%> |
|
|
| Back to top |
|
 |
Torch

Joined: 28 May 2008 Posts: 842
|
Posted: Wed Aug 12, 2009 1:23 pm Post subject: |
|
|
| Sure its not something within the loop? Can't say unless you post more code. |
|
| Back to top |
|
 |
ab5000
Joined: 06 May 2008 Posts: 74
|
Posted: Wed Aug 12, 2009 6:26 pm Post subject: |
|
|
| Torch wrote: | | Sure its not something within the loop? Can't say unless you post more code. |
I did more debug, it was an error in a centralMenu ;) _________________
| Code: | %:include<stdio.h>
int _(int __,int ___,int ____,int _____)
<%for(;____<___;_____=_____*__,____++);
return _____;%>main()<%printf
("%d\n",_(2,5,0,1));%> |
|
|
| Back to top |
|
 |
bkc

Joined: 20 May 2008 Posts: 20 Location: Sweden
|
Posted: Fri Aug 21, 2009 11:01 pm Post subject: |
|
|
this:
| Code: | | while(prxSearch[++i] && pathnum < MAXPATHS) { |
should be:
| Code: | | while(prxSearch[++i] && (pathnum < MAXPATHS)) { |
_________________ I only speak these languages:
- C / C + +
- ASM
- Python
- (x)HTML
- PHP
- CSS
- SQL
- JavaScript
|
|
| Back to top |
|
 |
Jim

Joined: 02 Jul 2005 Posts: 487 Location: Sydney
|
Posted: Sat Aug 22, 2009 9:29 am Post subject: |
|
|
That won't make any difference. < has a higher precedence than &&.
Jim _________________ http://www.dbfinteractive.com |
|
| Back to top |
|
 |
Torch

Joined: 28 May 2008 Posts: 842
|
Posted: Sat Aug 22, 2009 12:22 pm Post subject: |
|
|
Its && not &. There's no other way to evaluate it other than (prxSearch[++i] && (pathnum < MAXPATHS))
Does (prxSearch[++i] && pathnum) even return a value that can be compared with < ? |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|