NULL call to _Workspace_Free() via _Objects_Extend_information at startup

Peter Dufault dufault at hda.com
Mon Feb 28 23:33:56 UTC 2011


I'm trying to move my mpc5554 BSP from 4.9 to 4.10 and I'm bombing out early on where it is calling _Heap_Free with a NULL block.  This is the CVS head from 2 days ago, I've checked and don't see any relevant changes.

Here's the backtrace where it's about to happen:

#0  _Objects_Extend_information (information=0x210373a8)
    at ../../../../../../rtems-head/c/src/../../cpukit/score/src/objectextendinformation.c:209
#1  0x00081cf0 in _Objects_Initialize_information (information=0x210373a8, 
    the_api=OBJECTS_INTERNAL_API, the_class=0x2, maximum=0x1, size=0x74, 
    is_string=0x0, maximum_name_length=0x0)
    at ../../../../../../rtems-head/c/src/../../cpukit/score/src/objectinitializeinformation.c:156
#2  0x0007cbd8 in _API_Mutex_Initialization (maximum_mutexes=0x1)
    at ../../../../../../rtems-head/c/src/../../cpukit/score/src/apimutex.c:23
#3  0x0007b76c in rtems_initialize_data_structures ()
    at ../../../../../../rtems-head/c/src/../../cpukit/sapi/src/exinit.c:125
#4  0x00026724 in boot_card (cmdline=0x0)
    at ../../../../../../../../rtems-head/c/src/lib/libbsp/powerpc/mpc55xxevb/../../shared/bootcard.c:163
#5  0x00000134 in start ()
    at ../../../../../../../../rtems-head/c/src/lib/libbsp/powerpc/mpc55xxevb/startup/start.S:219
(gdb) 

"information" is a pointer to _API_Mutex_Information, and its object_blocks member was set to 0 in _Objects_Initialize_information()
(gdb) print _API_Mutex_Information.object_blocks
$4 = (void **) 0x0
(gdb) 

but _Objects_Extend_information() is saving that away:
209	    old_tables = information->object_blocks;
(gdb) next
211	    information->object_blocks = object_blocks;
(gdb) print old_tables
$5 = (void *) 0x0
(gdb) 

And if we continue a bit it's going to unconditionally call _Workspace_Free()
Breakpoint 5, _Objects_Extend_information (information=0x210373a8)
    at ../../../../../../rtems-head/c/src/../../cpukit/score/src/objectextendinformation.c:224
224	    _Workspace_Free( old_tables );
(gdb) 

and that's all, folks.  Does anyone recognize what I might have done to get in this mess?

Peter
-----------------
Peter Dufault
HD Associates, Inc.      Software and System Engineering





More information about the users mailing list