Mutex Problems

Joel Sherrill <joel@OARcorp.com> joel.sherrill at OARcorp.com
Wed Mar 23 15:22:34 UTC 2005


Gert Caspersen wrote:
> I am currently using RTEMS in combination with the GNAT Ada 95 compiler. 
> I am observing a non-deterministic failure, that appears to be the 
> result of a race condition.
> 
> My application is crashing after a while with the error message:
> 
>     /assertion "0" failed: file 
> "/opt/rtems-4.6/source/rtems-4.6.1/cpukit/posix/src/mutexfromcorestatus.c", 
> line 50
> /
> Execution is appearantlyu falling off the end of the following case:
> 
>      switch ( status ) {
>        case CORE_MUTEX_STATUS_SUCCESSFUL:
>          return 0;
>        case CORE_MUTEX_STATUS_UNSATISFIED_NOWAIT:
>          return EBUSY;
>        case CORE_MUTEX_STATUS_NESTING_NOT_ALLOWED:
>          return EDEADLK;
>        case CORE_MUTEX_STATUS_NOT_OWNER_OF_RESOURCE:
>          return EPERM;
>        case CORE_MUTEX_WAS_DELETED:
>          return EINVAL;
>        case CORE_MUTEX_TIMEOUT:
>          return EAGAIN;
>        case CORE_MUTEX_STATUS_CEILING_VIOLATED:
>          return EINVAL;
>        default:
>          break;
>      }
>      assert( 0 );
> 
> Has anybody seen this one before?
> Do you have any suggestions as to what may be causing this.
> 

Can you find out what the actual status is when it goes into
default?

I checked cpukit/score/include/rtems/score/coremutex.h and this
appears to be the complete list of status codes.  So I don't
have a clue what is happening.  My guesses would be stack
overflow and random corruption.


-- 
Joel Sherrill, Ph.D.             Director of Research & Development
joel 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