Stack checker broken on PowerPC/virtex BSP - 4.7.99.1 or later

Joel Sherrill joel.sherrill at oarcorp.com
Wed Aug 15 00:34:36 UTC 2007


Robert S. Grimes wrote:
> Hi,
>
> 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
>     <snip>
>     #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 4.7.99.2 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
>         _Thread_Executing,
>         the_thread
>       );
>       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...
>
>   
I have done a lot of work on the stack checker since 4.7 was branched
so it is possible something is broken but I did a lot of testing so think
it is really ok.

Since you mention having the monitor and capture engine enabled,
is it possible that the number of extensions configured isn't right.

Or that since the user extensions manager was mandatory and now
is OPTIONAL that you really are linking against the stub?  How
large is rtems_extension_create?  If only a few bytes, then it is
a stub.
> Thanks,
> -Bob
> _______________________________________________
> rtems-users mailing list
> rtems-users at rtems.com
> http://rtems.rtems.org/mailman/listinfo/rtems-users
>   




More information about the users mailing list