Issue with heap initialization.

Sebastian Huber sebastian.huber at embedded-brains.de
Sun May 6 11:58:05 UTC 2012


On 05/05/12 22:57, Rohan Kangralkar wrote:
> Hi RTEMS Developers,
>
> We have implemented some test benches for performance measurement. We tried
> to execute the test bench on arm csb336.
> But to our suprise RTEMS core failed due to memory management issues.

What do you mean with "memory management issues"?

The csb336, csb337, and csb637 are known to have problems in RTEMS 4.10 
and later.  Can you try to use a RTEMS 4.9 version and check if your 
problems exist also in this version?  The general BSP initialization, 
the IRQ handing and the linker command files changed considerable with 
RTEMS 4.10 and later.  I suppose it was never tested since we have no 
access to the hardware.

It is very good that you have a debugger for this system.  You should check

1. that the memory map (objdump -h) of the executable is all right,
2. that the interrupt initialization and dispatch is all right 
(c/src/lib/libcpu/arm/mc9328mxl/irq/irq.c),
3. that MMU initialization is all right, and
4. that the workspace and heap setup is all right (bsp_get_work_area()).

> RTEMS_Malloc_Initialize() is called from bsp_libc_init() at this stage of
> booting RTEMS in a SYSTEM_STATE_BEFORE_MULTITASKING state.
>
> #0  _Heap_Walk (heap=0x3e894, source=0, dump=true) at
> ../../../../../../rtems/c/src/../../cpukit/score/src/heapwalk.c:320
> #1  0x00016064 in _Protected_heap_Walk (the_heap=0x3e894, source=0,
> do_dump=true) at
> ../../../../../../rtems/c/src/../../cpukit/score/src/pheapwalk.c:47
> #2  0x00006f3c in RTEMS_Malloc_Initialize (heap_begin=0xf7ff8,
> heap_size=66112, sbrk_amount=0) at
> ../../../../../../rtems/c/src/../../cpukit/libcsupport/src/malloc_initialize.c:126
> #3  0x0000223c in bsp_libc_init (heap_begin=0xf7ff8, heap_size=66112,
> sbrk_amount=0) at
> ../../../../../../../../rtems/c/src/lib/libbsp/arm/csb336/../../shared/bsplibc.c:20
> #4  0x000018c8 in bootcard_bsp_libc_helper () at
> /home/student/rkangral/workspace/RTEMS_4.11/DB_BRANCH/sce/sw/os/rtems/os_wrapper.c:229
>
>
> We check the state of RTEMS before proceeding with heap walk
> if ( !(_System_state_Is_up( _System_state_Get() )) {
>      return true;
>    }
> RTEMS is still not up the core returns without checking the heap. Due to
> this we cannot test the initial heap.
>
> I think we should be able to perform the _Heap_Walk in
> SYSTEM_STATE_BEFORE_MULTITASKING. What is your sugession?

Yes, this system state dependency in _Heap_Walk() looks wrong.  On the 
other hand if the heap is damaged in this state you have quite a 
fundamental problem.

-- 
Sebastian Huber, embedded brains GmbH

Address : Obere Lagerstr. 30, D-82178 Puchheim, Germany
Phone   : +49 89 18 90 80 79-6
Fax     : +49 89 18 90 80 79-9
E-Mail  : sebastian.huber at embedded-brains.de
PGP     : Public key available on request.

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.




More information about the users mailing list