In capture example CT1c is referenced after it is deleted

Peter Dufault dufault at
Tue Sep 22 13:21:38 UTC 2009

Again, a BSP for the Phytec MPC5554 derived from the existing  

I'm on to the capture example.

It is dying when it starts to work on CT1c after it is deleted.

In rtems_task_create after the call to _Thread_Initialize for CT1c I  
(gdb) print the_thread
$4 = (Thread_Control *) 0x30f328
(gdb) print the_thread->
$7 = 0xa010005
(gdb) print the_thread->extensions
$8 = (void **) 0x312f50

I added something to rtems_capture_record() to detect a bogus task  
pointer.  I trap one of 0x8, and then when I go up the call stack to  
rtems_capture_switch_task() I see it now has an extensions area of 0:

(gdb) print current_task
$9 = (rtems_tcb *) 0x30f328
(gdb) print current_task->
$10 = 0xa010005
(gdb) print current_task->extensions
$11 = (void **) 0x0

And if I check the global deleted flag in "test1.c" it says CT1c is  

(gdb) print capture_CT1a_deleted
$13 = 0x0
(gdb) print capture_CT1b_deleted
$14 = 0x0
(gdb) print capture_CT1c_deleted
$15 = 0x1

What is supposed to prevent this?


More information about the users mailing list