You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
(I would like to open this as a general discussion so using the Feature ticket as the closest one)
Running some of the OSAL's tests on macOS results in BUG IN CLIENT OF LIBDISPATCH: Semaphore object deallocated while in use". Instead of <semaphore.h> macOS's provides <dispatch/semaphore.h> and with some minor differences, the API is very similar. The above error message is a protection built in the implementation of semaphores to prevent a user from calling dispatch_release() on a semaphore that is still being used.
Describe the solution you'd like
3 of the current OSAL's test are hitting this error (see Appendix below) and I am wondering if it would be practical to improve the design of these tests.
I would also like to check with someone my understanding that destroying the resources while they are still being used results in undefined behaviour and that the undefined behaviour should be avoided even if the scope is test code, not the OSAL code itself.
Describe alternatives you've considered
For now, I am using an alternative implementation of semaphores found here but I think it would be better to use the dispatch_semaphore.h as a more native implementation on macOS.
Additional context
–
Requester Info
Stanislav Pankevich, individual contribution.
Appendix: Calling sem_destroy() when a semaphore is still being used
stanislaw
changed the title
Tests: Calling sem_destroy() on semaphores that are still being used
tests: Calling sem_destroy() on semaphores that are still being used
Sep 22, 2021
Is your feature request related to a problem? Please describe.
(I would like to open this as a general discussion so using the Feature ticket as the closest one)
Running some of the OSAL's tests on macOS results in
BUG IN CLIENT OF LIBDISPATCH: Semaphore object deallocated while in use"
. Instead of<semaphore.h>
macOS's provides<dispatch/semaphore.h>
and with some minor differences, the API is very similar. The above error message is a protection built in the implementation of semaphores to prevent a user from callingdispatch_release()
on a semaphore that is still being used.Describe the solution you'd like
3 of the current OSAL's test are hitting this error (see Appendix below) and I am wondering if it would be practical to improve the design of these tests.
I would also like to check with someone my understanding that destroying the resources while they are still being used results in undefined behaviour and that the undefined behaviour should be avoided even if the scope is test code, not the OSAL code itself.
Describe alternatives you've considered
For now, I am using an alternative implementation of semaphores found here but I think it would be better to use the
dispatch_semaphore.h
as a more native implementation on macOS.Additional context
–
Requester Info
Stanislav Pankevich, individual contribution.
Appendix: Calling sem_destroy() when a semaphore is still being used
70 - osal_core_UT (ILLEGAL)
54 - count-sem-test (ILLEGAL)
55 - count-sem-timeout-test (ILLEGAL)
The text was updated successfully, but these errors were encountered: