Skip to content

POSIX unnecessarily setting signal masks in global lock #673

@jphickey

Description

@jphickey

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:

if (pthread_sigmask(SIG_SETMASK, &POSIX_GlobalVars.MaximumSigMask, &previous) != 0)

Unlocking:

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.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions