[U-Boot] facing issues with malloc in U-Boot

Hi Everyone,
I am facing issues with malloc in U-Boot while trying to allocate some memory. Here are the prints which I am getting after enabling the debug.
U-Boot 2011.12 (May 31 2012 - 20:49:16)
U-Boot code: 60800020 -> 60824874 BSS: -> 608592BC monitor len: 0005929C ramsize: 20000000 TLB table at: 7fff0000 Top of RAM usable for U-Boot at: 7fff0000 Reserving 356k for U-Boot at: 7ff96000 Reserving 1024k for malloc() at: 7fe96000 Reserving 32 Bytes for Board Info at: 7fe95fe0 Reserving 120 Bytes for Global Data at: 7fe95f68 New Stack Pointer is: 7fe95f58 RAM Configuration: Bank #0: 60000000 512 MiB Bank #1: 80000000 512 MiB relocation Offset is: 1f795fe0 WARNING: Caches not enabled monitor flash len: 00028904 Board Init called.. GPIO Init called.. spi_setup_slave: bus:0 cs:0 SPI Init Done... spi_xfer: tx:9f rx:00 spi_xfer: tx:ff rx:ef spi_xfer: tx:ff rx:40 spi_xfer: tx:ff rx:17 spi_xfer: tx:ff rx:0 spi_xfer: tx:ff rx:0 spi_cs_deactivate Done... SF: Got idcodes 00000000: ef 40 17 00 00 .@... ARRAY_SIZE = 1 shift = 0 idcode = 0xEF shift = 0 idcode = 0xEF Calling Probe... SF: Winbond id 0x4017 found SF: Failed to allocate memory SF: Unsupported manufacturer ef spi_release_bus: bus:0 cs:0 spi_release_bus Done... dlmalloc.c:1656: do_check_chunk: Assertion `(char*)p >= sbrk_base' failed. resetting ...)
Any kind of help will be highly appreciated.
Thanks and Regards, Sandeep
<PRE><font size="2" face="calibri" color="blue">The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material.If you are not the intended recipient of this message please do not read, copy, use or disclose this communication and notify the sender immediately.It should be noted that any review, retransmission, dissemination or other use of, or taking action or reliance upon, this information by persons or entities other than the intended recipient is prohibited.</PRE>

Hi Sandeep,
On Fri, Jun 1, 2012 at 1:42 AM, Sandeep Kumar Sandeep.Kumar@open-silicon.com wrote:
Hi Everyone,
I am facing issues with malloc in U-Boot while trying to allocate some memory. Here are the prints which I am getting after enabling the debug.
U-Boot 2011.12 (May 31 2012 - 20:49:16)
What board are you using?
Regargs,
Graeme

Hi ,
I am using vexpress board (ca9x4_ct_vxp). During run time all the malloc are failing even if it's of 1 byte. I tried to increase the malloc pool size to 1MB also but it is not helping out. Any king of pointer or help will be highly appreciated.
Thanks and Regards, Sandeep
-----Original Message----- From: Graeme Russ [mailto:graeme.russ@gmail.com] Sent: 01 June 2012 05:21 To: Sandeep Kumar Cc: u-boot@lists.denx.de Subject: Re: [U-Boot] facing issues with malloc in U-Boot
Hi Sandeep,
On Fri, Jun 1, 2012 at 1:42 AM, Sandeep Kumar Sandeep.Kumar@open-silicon.com wrote:
Hi Everyone,
I am facing issues with malloc in U-Boot while trying to allocate some memory. Here are the prints which I am getting after enabling the debug.
U-Boot 2011.12 (May 31 2012 - 20:49:16)
What board are you using?
Regargs,
Graeme <PRE><font size="2" face="calibri" color="blue">The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material.If you are not the intended recipient of this message please do not read, copy, use or disclose this communication and notify the sender immediately.It should be noted that any review, retransmission, dissemination or other use of, or taking action or reliance upon, this information by persons or entities other than the intended recipient is prohibited.</PRE>

Hi Sandeep,
On Fri, Jun 1, 2012 at 3:50 PM, Sandeep Kumar Sandeep.Kumar@open-silicon.com wrote:
Hi ,
I am using vexpress board (ca9x4_ct_vxp). During run time all the malloc are failing even if it's of 1 byte. I tried to increase the malloc pool size to 1MB also but it is not helping out. Any king of pointer or help will be highly appreciated.
The comments in dlmalloc.c indicate that do_check_chunk() is intended to catch memory corruption. A few further quick questions:
1) Is this reproducible on multiple boards? Can you rule-out SDRAM component failures? 2) Is mem_malloc_init() being called - I assume so as a) this is a in-tree board without apparent modification and b) malloc() checks for init 3) Is the failure during the first call to malloc()? If not, is the failure always at the same location?
I think you are going to need to add some printf() debugging in dlmalloc()
Regards,
Graeme
P.S. Please stop top-posting
Thanks and Regards, Sandeep
-----Original Message----- From: Graeme Russ [mailto:graeme.russ@gmail.com] Sent: 01 June 2012 05:21 To: Sandeep Kumar Cc: u-boot@lists.denx.de Subject: Re: [U-Boot] facing issues with malloc in U-Boot
Hi Sandeep,
On Fri, Jun 1, 2012 at 1:42 AM, Sandeep Kumar Sandeep.Kumar@open-silicon.com wrote:
Hi Everyone,
I am facing issues with malloc in U-Boot while trying to allocate some memory. Here are the prints which I am getting after enabling the debug.
U-Boot 2011.12 (May 31 2012 - 20:49:16)
What board are you using?
Regargs,
Graeme
<PRE><font size="2" face="calibri" color="blue">The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material.If you are not the intended recipient of this message please do not read, copy, use or disclose this communication and notify the sender immediately.It should be noted that any review, retransmission, dissemination or other use of, or taking action or reliance upon, this information by persons or entities other than the intended recipient is prohibited.</PRE>

Hi Graeme,
Thanks a lot for prompt reply and helping me in resolving my problem. The problem was that my board specific code was calling malloc before " mem_malloc_init" being called. Moving my code after calling mem_malloc_init resolved the issue.
Thanks a lot. :-)
Thanks and Regards, Sandeep
-----Original Message----- From: Graeme Russ [mailto:graeme.russ@gmail.com] Sent: 01 June 2012 11:47 To: Sandeep Kumar Cc: u-boot@lists.denx.de Subject: Re: [U-Boot] facing issues with malloc in U-Boot
Hi Sandeep,
On Fri, Jun 1, 2012 at 3:50 PM, Sandeep Kumar Sandeep.Kumar@open-silicon.com wrote:
Hi ,
I am using vexpress board (ca9x4_ct_vxp). During run time all the malloc are failing even if it's of 1 byte. I tried to increase the malloc pool size to 1MB also but it is not helping out. Any king of pointer or help will be highly appreciated.
The comments in dlmalloc.c indicate that do_check_chunk() is intended to catch memory corruption. A few further quick questions:
1) Is this reproducible on multiple boards? Can you rule-out SDRAM component failures? 2) Is mem_malloc_init() being called - I assume so as a) this is a in-tree board without apparent modification and b) malloc() checks for init 3) Is the failure during the first call to malloc()? If not, is the failure always at the same location?
I think you are going to need to add some printf() debugging in dlmalloc()
Regards,
Graeme
P.S. Please stop top-posting
Thanks and Regards, Sandeep
-----Original Message----- From: Graeme Russ [mailto:graeme.russ@gmail.com] Sent: 01 June 2012 05:21 To: Sandeep Kumar Cc: u-boot@lists.denx.de Subject: Re: [U-Boot] facing issues with malloc in U-Boot
Hi Sandeep,
On Fri, Jun 1, 2012 at 1:42 AM, Sandeep Kumar Sandeep.Kumar@open-silicon.com wrote:
Hi Everyone,
I am facing issues with malloc in U-Boot while trying to allocate some memory. Here are the prints which I am getting after enabling the debug.
U-Boot 2011.12 (May 31 2012 - 20:49:16)
What board are you using?
Regargs,
Graeme
<PRE><font size="2" face="calibri" color="blue">The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material.If you are not the intended recipient of this message please do not read, copy, use or disclose this communication and notify the sender immediately.It should be noted that any review, retransmission, dissemination or other use of, or taking action or reliance upon, this information by persons or entities other than the intended recipient is prohibited.</PRE>
<PRE><font size="2" face="calibri" color="blue">The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material.If you are not the intended recipient of this message please do not read, copy, use or disclose this communication and notify the sender immediately.It should be noted that any review, retransmission, dissemination or other use of, or taking action or reliance upon, this information by persons or entities other than the intended recipient is prohibited.</PRE>
participants (2)
-
Graeme Russ
-
Sandeep Kumar