Heap_Allocate infinite loop !!

Brendan Simon brendan at dgs.monash.edu.au
Tue Nov 10 12:57:04 UTC 1998

I have compiled the netdemos for RTEMS-4.0.0 with the eth_comms BSP from
Jay Monkman.  I'm trying to run this on an ADS860 board.  I have setup
the memory map on the ADS to and make it look like an eth_comm board.

My debugging tools are very limited at the moment.  I am using the
MPC8BUG which lets me trace through the powerpc assembler code.  I then
reconcile addresses and symbols using powerpc-rtems-nm.  It's tedious
but at least I'm getting somewhere.

The prgram is getting to _Thread_Initialize but never returns.  It seems
that it is getting stuck in _Thread_Stack_Allocate which calls
Workspace_Allocate.  Workspace allocate is a macro which susbtitutes
_Heap_Allocate.  It is in an endless loop in the code fragment listed
below.  For some reason the_block is pointing to location 0x00000000.
When it tries to get the_block->next, the address is 0x00000000 at this
location also.  Thus the for loop never terminates.

I know that Heap_Allocate works as it is called about 30 times before
Thread_Initialize and it returns ok.  What is Workspace and how is it
setup ?  Does the BSP do it or does RTEMS do it itself ??

Brendan Simon.

for ( the_block = the_heap->first; ; the_block = the_block->next )
    if ( the_block == _Heap_Tail( the_heap ) )
      return( NULL );
    if ( the_block->front_flag >= the_size )

More information about the users mailing list