Bug in latest snapshot (patch).

Joel Sherrill joel.sherrill at OARcorp.com
Fri May 25 16:34:25 UTC 2001

Sergei Organov wrote:
> I believe I've found bug in the ss-20010424 snapshot. Please see attached
> patch.
> The bug shows itself when counting semaphore is released from ISR and obtained
> from thread. The effect is that the thread is eventually blocked on unlocked
> semaphore :-( I think there is a race condition in the semaphore
> _CORE_semaphore_Seize_isr_disable code where interrupts are unlocked too early
> (apparently due to nasty mistake introduced by copy-and-paste of code from
> another place).

Exactly.  This is NOT (REPEAT NOT) in 4.5.0.  It was introduced by 
an optimization to speed up semaphore and mutex operations when there
was no contention.

This patch is necessary and there is the same bug in the macros
version of this routine.

Chris Johns .. this could easily be the problem you saw.

> BR,
> Sergei.
>   ------------------------------------------------------------------------
>                   Name: bug.diff.gz
>    bug.diff.gz    Type: GNU Zip (application/x-gzip)
>               Encoding: base64

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