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

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

Moderators: cheriff, TyRaNiD

Post Reply
KickinAezz
Posts: 328
Joined: Sun Jun 03, 2007 10:05 pm

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

Post by KickinAezz »

Image
Image
Image
which point to

Code: Select all

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

Code: Select all

_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.
KickinAezz
Posts: 328
Joined: Sun Jun 03, 2007 10:05 pm

Post by KickinAezz »

Solved ATM,

sceKernelDcacheWritebackAll(); Did the trick...
jimparis
Posts: 1145
Joined: Fri Jun 10, 2005 4:21 am
Location: Boston

Post by jimparis »

Crashes in malloc/free are almost always due to heap corruption. The cache writeback is probably just hiding your problem for now.
KickinAezz
Posts: 328
Joined: Sun Jun 03, 2007 10:05 pm

Post by KickinAezz »

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...
J.F.
Posts: 2906
Joined: Sun Feb 22, 2004 11:41 am

Post by J.F. »

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.
KickinAezz
Posts: 328
Joined: Sun Jun 03, 2007 10:05 pm

Post by KickinAezz »

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(); ????
User avatar
Jim
Posts: 476
Joined: Sat Jul 02, 2005 10:06 pm
Location: Sydney
Contact:

Post by Jim »

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
Post Reply