They always show the same symptoms, the debug log ends with multiple failed calls to sceKernelAllocPartitionMemory like this line repeatedly:
Code: Select all
call to sceKernelAllocPartitionMemory partitionId: 2, name: block, type:0, size:19456000, addr:0x00000000
failed with result: 0x800200D9For my test I used R105 with a modified _hook_sceKernelAllocPartitionMemory function:
Code: Select all
SceUID _hook_sceKernelAllocPartitionMemory(SceUID partitionid, const char *name, int type, SceSize size, void *addr)
{
tGlobals * g = get_globals();
LOGSTR5("call to sceKernelAllocPartitionMemory partitionId: %d, name: %s, type:%d, size:%d, addr:0x%08lX\n", partitionid, (u32)name, type, size, (u32)addr);
sceKernelWaitSema(g->memSema, 1, 0);
// Try to allocate the requested memory. If the allocation fails due to an insufficient
// amount of free memory try again with 10kB less until the allocation succeeds.
// Don't allow to go under 80 % of the initial amount of memory.
SceUID uid;
SceSize original_size = size;
do
{
uid = sceKernelAllocPartitionMemory(partitionid,name, type, size, addr);
if (uid <= 0)
{
// Allocation failes, check if we can go lower for another try
if ((size > 10000) && ((size - 10000) > original_size - (original_size / 5)))
{
// Try again with 1kB less
size -= 10000;
}
else
{
// Limit reached, break out of loop
break;
}
}
}
while (uid <= 0);
LOGSTR3("-> final allocation made for %d of %d requested bytes with result 0x%08lX\n", size, original_size, uid);
if (uid > 0)
{
/***********************************************************************/
/* Succeeded OS alloc. Record the block ID in the tracking list. */
/* (Don't worry if there's no space to record it, we'll just have to */
/* leak it). */
/***********************************************************************/
if (g->osAllocNum < MAX_OS_ALLOCS)
{
g->osAllocs[g->osAllocNum] = uid;
g->osAllocNum ++;
LOGSTR1("Num tracked OS blocks now: %08lX\n", g->osAllocNum);
}
else
{
LOGSTR0("!!! EXCEEDED OS ALLOC TRACKING ARRAY\n");
}
}
sceKernelSignalSema(g->memSema, 1);
return uid;
}requested: 19456000 byte, granted: 19252000 byte -> delta of ~200kB
For Kurok with the same setup the situation is this:
requested: 18874368 byte, granted: 18338368 byte -> delta of ~500kB
Thoughts on this? On the one hand it will allow some previously broken homebrews to start, on the other hand there is no guarantee that they will run without error.
Advertising

