Testing alsa applications, which use the rather strange idiom that:
DOWN(sem) = SEMOP (wait for semaphore to go to zero, increment semaphore)
UP(sem) = SEMOP (decrement semaphore)
we find that sometimes the semaphore is left at 1 when a process exits, which should be impossible as all operations are done with the SEM_UNDO flag set.
Tracing the ssi_semexit code shows an adjustment of +1 being applied to a semaphore with value 0, which should also be impossible - with this idiom the undo should either be -1 or zero
The semaphore is initially zero. If an application does a DOWN() call then it will have an adjustment of -1. When it does an UP it will have an adjustment of 0.
Log in to post a comment.