-
Notifications
You must be signed in to change notification settings - Fork 253
Description
Describe the bug
As part of the global lock the POSIX implementation is setting the signal mask of the parent process. However, the signal mask which is being set is the same mask that was already set in the parent process during the initialization.
To Reproduce
N/A
Expected behavior
The signal mask is already configured during initialization, so it should not be re-configured when locking/unlocking the global object tables.
Code snips
Locking:
osal/src/os/posix/src/os-impl-idmap.c
Line 98 in fa0cffa
| if (pthread_sigmask(SIG_SETMASK, &POSIX_GlobalVars.MaximumSigMask, &previous) != 0) |
Unlocking:
osal/src/os/posix/src/os-impl-idmap.c
Line 149 in fa0cffa
| pthread_sigmask(SIG_SETMASK, &previous, NULL); |
System observed on:
Ubuntu 20.04
Additional context
I have investigated and I cannot find any justification for this anymore. In older versions of OSAL the signal(s) were not blocked and therefore e.g. SIGINT, SIGALRM etc could be handled by any thread. In this design it was likely important to make sure that a timer/interrupt doesn't get processed while internal OSAL ops are being performed.
But In the current OSAL design all of these signals are blocked initially in the main task - which all normal tasks then inherit. So this is only resetting the same mask that was already configured.
Reporter Info
Joseph Hickey, Vantage Systems, Inc.