#1629 closed defect (fixed)

sigsuspend not following POSIX spec

Reported by: Vinu Rajashekhar Owned by: Joel Sherrill
Priority: normal Milestone: 4.11
Component: score Version: 4.11
Severity: normal Keywords:
Cc: sebastian.huber@…, vinutheraj@… Blocked By:
Blocking:

Description

The current sigsuspend implementation is not does not follow the POSIX spec - http://www.opengroup.org/onlinepubs/009695399/functions/sigsuspend.html.

First, the spec wants the signal mask to be replaced. At present, the union of the new signal mask is taken with old signal mask.

Then, sigsuspend is implemented with the help of sigtimedwait. The set of signals sigtimedwait waits upon in the implementation consists of all the signals. This is wrong because sigtimedwait, will successfully return, if any of the signals in the set is pending, which is not the case with sigsuspend. sigsuspend should only return if any of the non-blocked signals are caught, or a signal causes termination of the process. So sigtimedwait should only wait on the non-blocked signals.

I have attached a patch with the necessary changes.

Attachments (6)

sigsuspend.patch (1.2 KB) - added by Vinu Rajashekhar on Jul 26, 2010 at 9:24:05 AM.
patch for sigsuspend.c
sigsuspend_v1.patch (1.3 KB) - added by Vinu Rajashekhar on Jul 26, 2010 at 9:55:09 AM.
patch for sigsuspend.c
sigsuspend_v2.patch (1.4 KB) - added by Vinu Rajashekhar on Jul 26, 2010 at 11:28:32 AM.
patch for sigsuspend.c
sigsuspend_v3.patch (1.3 KB) - added by Vinu Rajashekhar on Jul 26, 2010 at 11:59:44 AM.
patch for sigsuspend.c without RTEMS_DEBUG
sigsuspend_v4.patch (1.5 KB) - added by Vinu Rajashekhar on Jul 27, 2010 at 5:33:38 AM.
patch for sigsuspend.c
psx04_init.patch (466 bytes) - added by Vinu Rajashekhar on Jul 27, 2010 at 5:38:35 AM.
patch for psx04 test

Download all attachments as: .zip

Change History (12)

Changed on Jul 26, 2010 at 9:24:05 AM by Vinu Rajashekhar

Attachment: sigsuspend.patch added

patch for sigsuspend.c

Changed on Jul 26, 2010 at 9:55:09 AM by Vinu Rajashekhar

Attachment: sigsuspend_v1.patch added

patch for sigsuspend.c

comment:1 Changed on Jul 26, 2010 at 9:55:09 AM by Vinu Rajashekhar

attachments.isobsolete: 01

comment:2 Changed on Jul 26, 2010 at 11:16:36 AM by Sebastian Huber

Cc: Sebastian Huber added

Changed on Jul 26, 2010 at 11:28:32 AM by Vinu Rajashekhar

Attachment: sigsuspend_v2.patch added

patch for sigsuspend.c

comment:3 Changed on Jul 26, 2010 at 11:28:32 AM by Vinu Rajashekhar

attachments.isobsolete: 01

Changed on Jul 26, 2010 at 11:59:44 AM by Vinu Rajashekhar

Attachment: sigsuspend_v3.patch added

patch for sigsuspend.c without RTEMS_DEBUG

Changed on Jul 27, 2010 at 5:33:38 AM by Vinu Rajashekhar

Attachment: sigsuspend_v4.patch added

patch for sigsuspend.c

comment:4 Changed on Jul 27, 2010 at 5:33:38 AM by Vinu Rajashekhar

attachments.isobsolete: 01, 1

Changed on Jul 27, 2010 at 5:38:35 AM by Vinu Rajashekhar

Attachment: psx04_init.patch added

patch for psx04 test

comment:5 Changed on Jul 28, 2010 at 5:28:17 PM by Vinu Rajashekhar

Resolution: fixed
Status: newclosed

Replying to comment:10:

Patch applied. Confirm the fix is OK on your side and close.

Thanks. Yes, closing this PR.

comment:6 Changed on Nov 24, 2014 at 6:58:28 PM by Gedare Bloom

Version: HEAD4.11

Replace Version=HEAD with Version=4.11 for the tickets with Milestone >= 4.11

Note: See TracTickets for help on using tickets.