forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Mallocr.c _free_r problem,Really starting to bother me Alot.

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
KickinAezz



Joined: 03 Jun 2007
Posts: 328

PostPosted: Sat Jun 30, 2007 12:39 am    Post subject: Mallocr.c _free_r problem,Really starting to bother me Alot. Reply with quote




which point to
Code:

_free_r
../../../../../newlib/libc/stdlib/mallocr.c:2708

Code:

_free_r
../../../../../newlib/libc/stdlib/mallocr.c:3340


Changing Stack/heap sizes dint help...

There's 14050Kb of usable ram remaining....

The scenario: As I increase the number of statements in some function, EVEN BEFORE the control reaches that function, exception occurs....


Last edited by KickinAezz on Sat Jun 30, 2007 3:50 am; edited 2 times in total
Back to top
View user's profile Send private message
KickinAezz



Joined: 03 Jun 2007
Posts: 328

PostPosted: Sat Jun 30, 2007 2:07 am    Post subject: Reply with quote

Solved ATM,

sceKernelDcacheWritebackAll(); Did the trick...
Back to top
View user's profile Send private message
jimparis



Joined: 10 Jun 2005
Posts: 1179
Location: Boston

PostPosted: Sat Jun 30, 2007 2:31 am    Post subject: Reply with quote

Crashes in malloc/free are almost always due to heap corruption. The cache writeback is probably just hiding your problem for now.
Back to top
View user's profile Send private message
KickinAezz



Joined: 03 Jun 2007
Posts: 328

PostPosted: Sat Jun 30, 2007 3:41 am    Post subject: Reply with quote

jimparis wrote:
Crashes in malloc/free are almost always due to heap corruption. The cache writeback is probably just hiding your problem for now.


Is there any other solution for this?

Coz, this errors make me condense/reduce/limit the number of lines I put in a function...
Back to top
View user's profile Send private message
J.F.



Joined: 22 Feb 2004
Posts: 2906

PostPosted: Sat Jun 30, 2007 4:29 am    Post subject: Reply with quote

The solution is to debug your code. The last time I helped someone find a bug, it was a string overflow (writing too many characters into a fixed size string). Bugs like that will cause all kinds of interesting problems. I'm not saying this is your problem, just giving an example of how one type of bug can lead to issues elsewhere.
Back to top
View user's profile Send private message AIM Address
KickinAezz



Joined: 03 Jun 2007
Posts: 328

PostPosted: Sat Jun 30, 2007 7:24 am    Post subject: Reply with quote

J.F. wrote:
The solution is to debug your code. The last time I helped someone find a bug, it was a string overflow (writing too many characters into a fixed size string). Bugs like that will cause all kinds of interesting problems. I'm not saying this is your problem, just giving an example of how one type of bug can lead to issues elsewhere.


Oh, someone! I'll do my best in debugging.

Is it recommended that I invalidate Instruction cache every loop?

sceKernelIcacheInvalidateall(); ????
Back to top
View user's profile Send private message
Jim



Joined: 02 Jul 2005
Posts: 487
Location: Sydney

PostPosted: Sat Jun 30, 2007 11:44 am    Post subject: Reply with quote

No, you don't need to do it at all unless you are syncing with some other piece of hardware, such as the GU or ME.

Jim
_________________
http://www.dbfinteractive.com
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
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