Stack checker broken on PowerPC/virtex BSP - or later

Robert S. Grimes rsg at
Tue Aug 14 16:42:59 UTC 2007


Don't really know if this is specific to the new PowerPC/virtex BSP or not.

Adding the stack checker by putting the following #define before
included confdefs.h does not work!

    #define STACK_CHECKER_ON
    #include <rtems/confdefs.h>

In my case, for a version of RTEMS pulled from CVS Head in mid-July,
this will generally allow the application to get through RTEMS
initialization and pass control to the user initialization routine.  In
my case, my application worked arbitrarily long.  It was only when a
message was sent over a serial port that the system would crash with an
Exception 7 (Illegal instruction).

For the snapshot, RTEMS does not finish initialization before
the crash (again, Exception 7) occurs.  Through much trial and error, I
narrowed it down to line 39 in cpukit/score/src/userextthreadcreate.c -
this is the line that starts "status = (*the_enxtension" below:

    if ( the_extension->Callouts.thread_create != NULL ) {
      status = (*the_extension->Callouts.thread_create)(      <== This
fails - eventually
      if ( !status )
        return FALSE;

But it is not the first time this code is hit that is the problem.  I
get here after hitting a breakpoint on line 221 of
cpukit/score/src/threadinitialize.c - reproduced here:

   *  Invoke create extensions

  if ( !_User_extensions_Thread_create( the_thread ) ) {      <== second
call to this

The second time this code is executed is during RTEMS' creation of my
user initialization task.  The extension being referenced by line 39 of
userextthreadcreate is the stack checker.  Removing the stack checker
removes the problem.

Oh, one more thing, in case it is relevant - I've also enabled both the
RTEMS Monitor and the Capture Engine in all the referenced
configurations.  I don't think this matters, but you never know...

This is not terribly crucial to me, at least right now - I can live
without the stack checker, though it would be nice to have it! 
Unfortunately, I can't really allocate more time to resolving this, as
my unfamiliarity with the intricacies of RTEMS internals and my project
schedule conspire against it.  Still, I would be happy, however, to try
out any suggestions or fixes, should they materialize...


More information about the users mailing list