bugfastcgi++ - Bugs: bug #34386, Initialize struct sigaction

 
 
Show feedback again

bug #34386: Initialize struct sigaction

Submitted by:  David Schneider <davidschneider>
Submitted on:  Mon 26 Sep 2011 12:58:10 PM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: NoneStatus: Fixed
Privacy: PublicAssigned to: Eddie Carle <eddic>
Open/Closed: Open

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Tue 27 Sep 2011 04:23:20 PM UTC, comment #3:

Alright, you have convinced me. I'll commit your patch to it.

Eddie Carle <eddic>
Project AdministratorIn charge of this item.
Tue 27 Sep 2011 02:18:42 PM UTC, comment #2:

POSIX standard gives the implementer quite much freedom. See definition of sigemtyset paragraph RATIONALE:
http://pubs.opengroup.org/onlinepubs/000095399/functions/sigemptyset.html#tag_03_684_08
The implementer is free to "abuse" sigemptyset() and sigfillset() to store additional data (like version) into sa_mask. Either sigemptyset() or sigfillset() must be called prior to any other use of the signal set.

=> Acording the POSIX standard you should not initialize the struct with memset.

David Schneider <davidschneider>
Mon 26 Sep 2011 09:03:32 PM UTC, comment #1:

I opted to just memset the class to 0. It should have the same effect right?

Eddie Carle <eddic>
Project AdministratorIn charge of this item.
Mon 26 Sep 2011 12:58:10 PM UTC, original submission:

The struct sigaction used for signal setup is not completely initialized.

--- src/manager.cpp (.../manager.cpp)
+++ src/manager.cpp (.../manager.cpp)
@@ -38,7 +38,9 @@
void Fastcgipp::ManagerPar::setupSignals()
{
struct sigaction sigAction;
sigAction.sa_handler=Fastcgipp::ManagerPar::signalHandler;
+ sigemptyset(&sigAction.sa_mask);
+ sigAction.sa_flags=0;

sigaction(SIGPIPE, &sigAction, NULL);
sigaction(SIGUSR1, &sigAction, NULL);

David Schneider <davidschneider>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by eddic (Posted a comment)
  • -unavailable- added by davidschneider (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sat 01 Oct 2011 11:07:20 PM UTCeddicStatusIn Progress=>Fixed
    Tue 27 Sep 2011 04:28:50 PM UTCeddicStatusFixed=>In Progress
    Mon 26 Sep 2011 09:03:32 PM UTCeddicStatusNone=>Fixed
      Assigned toNone=>eddic
    Show feedback again

    Back to the top


    Powered by Savane 3.1-cleanup