questions to spfatal07 and unlimited tests

Joel Sherrill joel.sherrill at OARcorp.com
Thu Aug 20 13:56:20 UTC 2009


Christian Mauderer wrote:
> Hello,
>
> I've questions to two tests of the rtems testsuite:
>
> First question is to spfatal07 out of sptests. The test has the
> following force_error function:
> void force_error()
> {
>   Configuration.interrupt_stack_size = (STACK_MINIMUM_SIZE-1);
>   rtems_initialize_data_structures();
>   
>   /* we will not run this far */
> }
> But if i look up the interrupt_stack_size field, there is the following
> comment:
>   /** This field specifies the size of the interrupt stack.  If less than or
>    *  equal to the minimum stack size, then the interrupt stack will be of
>    *  minimum stack size.
>    */
>   uint32_t                       interrupt_stack_size;
> This comment seems to say that the error is caught and therefore the
> test tests something, what cannot appear.
> Can anyone approve that?
>   
On sparc/sis, it hits the error. 

(gdb) r
Starting program: 
/home/joel/rtems-4.10-work/build/build-sparc-sis-rtems/sparc-rtems4.10/c/sis/testsuites/sptests/spfatal07/spfatal07.exe 


Breakpoint 1, _Internal_error_Occurred (the_source=INTERNAL_ERROR_CORE,
    is_internal=true, the_error=5)
    at ../../../../../../rtems/c/src/../../cpukit/score/src/interr.c:53
53      _Internal_errors_What_happened.the_source  = the_source;
(gdb) bt
#0  _Internal_error_Occurred (the_source=INTERNAL_ERROR_CORE,
    is_internal=true, the_error=5)

Task stacks are rounded up to minimum but not the interrupt stack. 
I won't guess whether we need to fix the behaviour or change the comment. :)

The allocation of the stack is conditional:

49    #if ( CPU_ALLOCATE_INTERRUPT_STACK == TRUE )

So this test will not fail if that isn't the target architecture's setting.
The test should DEFINITELY be updated to be conditional and
print a message that this fatal error does not apply on this
target architecture and exit quickly.

My recollection is that the PowerPC BSPs allocate their own
interrupt stack so you couldn't get there on the PowerPC.


> My second question is to the unlimited test out of samples.
> In the file system.h is the following line without any comment to the value:
>  #define TASK_ALLOCATION_SIZE     (5)
> Then the CONFIGURE_MAXIMUM_TASKS  is defined with the following line:
> #define CONFIGURE_MAXIMUM_TASKS 
> rtems_resource_unlimited(TASK_ALLOCATION_SIZE)
> In the rtems_resource_unlimited this value will be conjuncted with
> RTEMS_UNLIMITED_OBJECTS with a logical OR.
> I would like to know where this value 5 comes from.
>
>   
Arbitrary test decision.  Instead of being a hard limit of 5 tasks,
it says that tasks will be allocated in chunks of 5. Start with 5,
when you create #6, it allocates TCBs for 6-10.

So a bit of an opportunity to clean up the fatal test :)
> Best regards,
> Christian Mauderer
>
>   


-- 
Joel Sherrill, Ph.D.             Director of Research & Development
joel.sherrill at OARcorp.com        On-Line Applications Research
Ask me about RTEMS: a free RTOS  Huntsville AL 35805
   Support Available             (256) 722-9985





More information about the users mailing list