In capture example CT1c is referenced after it is deleted

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


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

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  
see:
(gdb) print the_thread
$4 = (Thread_Control *) 0x30f328
...
(gdb) print the_thread->Object.id
$7 = 0xa010005
(gdb) print the_thread->extensions
$8 = (void **) 0x312f50
(gdb)

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->Object.id
$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  
deleted:

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

What is supposed to prevent this?

Peter



More information about the users mailing list