rtems_task acting strange

Salman unix at gofree.indigo.ie
Thu Mar 13 13:50:39 UTC 2003


On Wed, 2003-03-12 at 13:37, Joel Sherrill wrote:
> Salman wrote:
> > 
> > Hi guys,
> > 
> > I'm observing strange behavior when executing the following osif_init
> > function.
> > 
> > It gets as far as printing "were gonna startthe task 0 !!!!" (status = 0
> > -> successful task creation) and waiting for return key.
> > when I press return key, it goes mental, the screen either starts
> > dumping infinite garbage, or I get a page of errors with heading related
> > to thread error or something (i can't fully read it, cos system reboots
> > straight afterwards)
> > 
> > any idea whats going wrong ?
> 
> If osif_init() is an initialization task and an RTEMS Classic API task, 
> then it is falling off the bottom and that is a fatal error.  So I think
> the system is giving a fatal error.  Try adding an
> rtems_task_delete(RTEMS_SELF)
> to the bottom instead of a return.
> 
> For sure the mq task at the bottom is also falling out the bottom since
> you have commented out the infinite task body loop.
> 

I don't know whether it's my code, or a possible bug in rtems, but one
thread always gets killed in middle of my program. Hence, I create a
dummy "victim thread" named "RND0" so that it doesn't kill my main
thread.

>From my point of view, the following "RND0" thread, should not encounter
any problems, regardless of what goes on in other threads. I'm not even
producing any other thread with the same name and it still dies !

For the moment, this approach of having a dummy "victim thread" is
working for me, so i'm not keen on fixing it, but after my project is
finished, I'll look into this :)


rtems_task
totest_task(rtems_task_argument args)
{
   while (1)
   {
           printk ("still awake");
           rtems_task_wake_after(TICKS_PER_SECOND * 10);
   }

}

void testfirst()
{

   rtems_status_code status;
   rtems_id   Task_id;
  status = rtems_task_create(
                  rtems_build_name( 'R', 'N', 'D', '0'),
                  2, RTEMS_MINIMUM_STACK_SIZE * 2, RTEMS_DEFAULT_MODES,
                  RTEMS_DEFAULT_ATTRIBUTES, &Task_id);
  printf("were gonna startthe task %i !!!!",(int)status);
  getchar();
  status = rtems_task_start( Task_id,
totest_task,(rtems_task_argument)0);
  printf("we just did %i !!!!",(int)status);
  getchar();

}

rtems_task Init(
  rtems_task_argument ignored
)
{
  printk( "Hello World\n" );

  getchar();
  testfirst();

  getchar();
  sci_init(0);
  getchar();

  IRM19_GenIf_unit_test_main();

  exit( 0 );
}





More information about the users mailing list