Hello, While looking through instrumentation data, we found a bug in the data passed as arguments for THREAD_WAKE, THREAD_SUSPEND and THREAD_RESUME.
In revision 1.10 of sched.hxx, SMP support was added, which changed
current_thread from a simple pointer to an array-of-pointers. A
convenience function get_current_thread() was added. The below
instances of instrumentation code were not adapted, which makes them
always pass the address of the array instead of a real thread pointer.
Kind regards,
Pieter-Jan Busschaert
--- C:/Documents and Settings/pjbu/SIDist/temp/SID48419.tmp Tue May 12
13:36:17 2009
+++ z:/develop/ecos/packages/kernel/current/src/common/thread.cxx Tue
May 12 13:22:23 2009
@@ -366,7 +366,7 @@
{
CYG_REPORT_FUNCTION();
- CYG_INSTRUMENT_THREAD(WAKE,this,Cyg_Scheduler::current_thread);
+ CYG_INSTRUMENT_THREAD(WAKE,this,Cyg_Scheduler::get_current_thread());
// Prevent preemption
Cyg_Scheduler::lock();
@@ -507,7 +507,7 @@
{
CYG_REPORT_FUNCTION();
- CYG_INSTRUMENT_THREAD(WAKE,this,Cyg_Scheduler::current_thread);
+ CYG_INSTRUMENT_THREAD(WAKE,this,Cyg_Scheduler::get_current_thread());
// Prevent preemption
Cyg_Scheduler::lock();
@@ -538,7 +538,7 @@
{
CYG_REPORT_FUNCTION();
- CYG_INSTRUMENT_THREAD(WAKE,this,Cyg_Scheduler::current_thread);
+ CYG_INSTRUMENT_THREAD(WAKE,this,Cyg_Scheduler::get_current_thread());
// Prevent preemption
Cyg_Scheduler::lock();
@@ -562,7 +562,7 @@
{
CYG_REPORT_FUNCTION();
- CYG_INSTRUMENT_THREAD(SUSPEND,this,Cyg_Scheduler::current_thread);
+ CYG_INSTRUMENT_THREAD(SUSPEND,this,Cyg_Scheduler::get_current_thread());
// Prevent preemption
Cyg_Scheduler::lock();
@@ -596,7 +596,7 @@
{
CYG_REPORT_FUNCTION();
- CYG_INSTRUMENT_THREAD(RESUME,this,Cyg_Scheduler::current_thread);
+ CYG_INSTRUMENT_THREAD(RESUME,this,Cyg_Scheduler::get_current_thread());
// Prevent preemption
Cyg_Scheduler::lock();
@@ -636,7 +636,7 @@
{
CYG_REPORT_FUNCTION();
- CYG_INSTRUMENT_THREAD(RESUME,this,Cyg_Scheduler::current_thread);
+ CYG_INSTRUMENT_THREAD(RESUME,this,Cyg_Scheduler::get_current_thread());
// Prevent preemption
Cyg_Scheduler::lock();
kernel_thread_instrumentation.patch
Description: Binary data
