BTW, https://github.com/apache/nuttx/pull/5070 report that the system will
crash if  the priority inheritance enabled semaphore is waited or posted
from different threads.
True.  sem_post should fail if priority inheritance is enabled and the caller is not a holder of a semaphore count.  That check should be added.  Certainly it is not a justification for eliminating core functionality.

PR https://github.com/apache/nuttx/pull/8938 adds that check.

If you merge this PR and enable CONFIG_DEBUG_ASSERTIONS, then the condition that causes the error mentioned  in the PR will always be detected and will cause an assertion.  This error condition has been known and was documented six years ago in the confluence Wiki: https://cwiki.apache.org/confluence/display/NUTTX/Signaling+Semaphores+and+Priority+Inheritance

It is not a new or recent issue.


Reply via email to