_Heap_Initialize called twice, crashes second time around

Joel Sherrill joel.sherrill at OARcorp.com
Tue Feb 19 15:21:55 UTC 2013

On 2/19/2013 9:16 AM, Gedare Bloom wrote:
> Some BSPs also will unify the workspace and heap, in which case I
> believe initialization only happens once.
This is an application time configure option.

Some BSPs on hardware with non-contiguous address spaces
may assign one to workspace and one to heap. Sebastian added
that for the plethora of CPUs with on-chip RAM areas and off-chip
and slower RAM.

Most likely, there is a mistake in the memory map as you
suggested in the previous email.

There are some debug prints in bspgetworkarea and other places
which can give hints but definitely check the address ranges passed
to the two invocations, where you have reserved the stack you
are initializing the system on, and your .bss section. Sounds like
you have an overlap or are pointing to non-existent memory

> On Tue, Feb 19, 2013 at 10:15 AM, Gedare Bloom <gedare at rtems.org> wrote:
>> Heap Initialize is reused to initialize the RTEMS workspace, and the C
>> program heap. This is normal when the workspace and heap are separate
>> (non-unified). Check that your workspace and heap are indeed distinct
>> in your memory layout (linkcmds) and non-overlapping. Crashes can
>> happen when they overlap or when the malloc heap pointer is bogus.
>> -Gedare
>> On Tue, Feb 19, 2013 at 7:05 AM, Matthew J Fletcher <amimjf at gmail.com> wrote:
>>> Hi,
>>> I am not passing any particularly non-standard configure options,
>>> "--disable-cxx --disable-posix --disable-itron --enable-networking
>>> --target=arm-rtemseabi4.11 --enable-rtemsbsp=rtl22xx_t".
>>> 1st callstack
>>> boot_card()
>>> -> rtems_initialize_data_structures()
>>>    -> _Workspace_Handler_initialization()
>>>      -> _Heap_Initialize()
>>> 2nd callstack
>>> boot_card()
>>> -> bootcard_bsp_libc_helper()
>>>    -> bsp_libc_init()
>>>      -> RTEMS_Malloc_Initalize()
>>>        -> _Heap_Initalize()
>>> Is this BSP not configured quite right ?
>>> regards
>>> ---
>>> Matthew J Fletcher
>>> _______________________________________________
>>> rtems-users mailing list
>>> rtems-users at rtems.org
>>> http://www.rtems.org/mailman/listinfo/rtems-users
> _______________________________________________
> rtems-users mailing list
> rtems-users at rtems.org
> http://www.rtems.org/mailman/listinfo/rtems-users

Joel Sherrill, Ph.D.             Director of Research & Development
joel.sherrill at OARcorp.com        On-Line Applications Research
Ask me about RTEMS: a free RTOS  Huntsville AL 35805
Support Available                (256) 722-9985

More information about the users mailing list