Possible bug in _CORE_mutex_Seize()

Phil Torre ptorre at zetron.com
Wed Oct 1 00:03:16 UTC 2003


On Tue, Sep 30, 2003 at 03:19:30PM -0700, Till Straumann wrote:
> Joel Sherrill wrote:
> >Phil Torre wrote:
> >
> >>I'm running now with some of the changes suggested by Till and Joel:
> >>
> >>1.    "Paranoia" added to _CORE_mutex_Seize() which checks
> >>    _Thread_Dispatch_disable_level and throws an internal error if
> >>    its nonzero when it shouldn't be.
> >
> >
> >Be careful with this one.  I don't think this is the right place to
> >check it. You can attempt to obtain a mutex in an ISR and
> >_Thread_Dispatch_disable_level will definitely be non-zero.  You
> >can't use the Allocator Mutex when _Thread_Dispatch_disable_level
> >is non-zero but it is conceivable that you could use another mutex.

I am running our application now with the patches attached.  The paranoia
check in coremutex.h is there, along with the actual bugfix in newlibc.c.
(If the call to _Workspace_Allocate() fails, we would rather have an error
propagated back up to the application than have an RTEMS fatal error
thrown.  I don't know what the majority opinion would be of that.)

I can file a PR and attach my patches to it as soon as a consensus is
reached about the validity of the paranoia check.

-Phil




  

    

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: allocator_mutex_patched_coremutex.h.diff
URL: <http://lists.rtems.org/pipermail/users/attachments/20030930/a3c64e89/attachment.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: allocator_mutex_patched_newlibc.c.diff
URL: <http://lists.rtems.org/pipermail/users/attachments/20030930/a3c64e89/attachment-0001.ksh>


More information about the users mailing list