Malloc failed in env_relocate
?
Hi
I am using u-boot-1.1.5 on MIPS32 core SoC. I am getting NULL pointer as return value of malloc from env_relocate() function.
while debugging in mem_malloc_init() I come to know that mem_malloc_start= 0x81f80000 and mem_malloc_end=0xFFFFFFFF. But when i checked both the values in sbrk() which is called from malloc() i got mem_malloc_start=0xFFFFFFFF and mem_malloc_end=0xFFFFFFFF.
How it happened ?? It may be the reason for getting NULL pointer. Please help me out.
One more thing what should be the value of gd->reloc_off at mem_malloc_init().because in mem_malloc_init, mem_malloc_end = CFG_MONITOR_BASE + gd->relo_off and CFG_MONITOR_BASE is base address of Flash. In my case gd-relo_off=0xc23c0000 and CFG_MONITOR_BASE=0xBFC00000 so mem_alloc_end should be 0x181FC0000 but it is of 4byte so here is overflow and it become 0xFFFFFFFF.Is there anything wrong??
Thanks,
Ashish
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.denx.de/pipermail/u-boot/attachments/20071203/8741d0b6/attachment.htm
Quoted 9 lines · Ashish Ranjan
?
Hi
I am using u-boot-1.1.5 on MIPS32 core SoC. I am getting NULL pointer as return value of malloc fromenv_relocate()function.while debugging in
mem_malloc_init()I come to know that mem_malloc_start=0x81f80000and mem_malloc_end=0xFFFFFFFF. But when i checked both the values insbrk()which is called frommalloc()i got mem_malloc_start=0xFFFFFFFF and mem_malloc_end=0xFFFFFFFF.How it happened ?? It may be the reason for getting NULL pointer. Please help me out.
One more thing what should be the value of
gd->reloc_offat mem_malloc_init().because inmem_malloc_init,mem_malloc_end=CFG_MONITOR_BASE+gd->relo_offandCFG_MONITOR_BASEis base address of Flash. In my case gd-relo_off=0xc23c0000 and CFG_MONITOR_BASE=0xBFC00000 somem_alloc_endshould be0x181FC0000but it is of 4byte so here is overflow and it become 0xFFFFFFFF.Is there anything wrong??
Please upgrade your u-boot to the last release 1.3.0
Best Regards,
J.