Bug 724050 - coroipcc_service_connect forces threads stacks > 12*4k
Summary: coroipcc_service_connect forces threads stacks > 12*4k
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Corosync Cluster Engine
Classification: Retired
Component: unknown
Version: 1.4
Hardware: All
OS: All
unspecified
unspecified
Target Milestone: ---
Assignee: Jan Friesse
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-07-21 19:16 UTC by dan clark
Modified: 2011-08-17 07:47 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-08-17 07:47:09 UTC


Attachments (Terms of Use)
proposed diff agains corosync-1.4.0 that provides dynamic allocation/free (2.68 KB, application/octet-stream)
2011-07-21 19:16 UTC, dan clark
no flags Details
Patch sent to ML (5.53 KB, patch)
2011-07-27 15:32 UTC, Jan Friesse
no flags Details | Diff

Description dan clark 2011-07-21 19:16:54 UTC
Created attachment 514263 [details]
proposed diff agains corosync-1.4.0 that provides dynamic allocation/free

Description of problem:
coroipcc appropriately uses PATH_MAX sized variables for various data structures handling files in the initialization of the client.  Due to the use of 12 of these structures declared as stack variables, the application stack balloons to over 12*4k. This is especially problematic if threads are used by long running daemons to restart the connection to corosync so as to be resilient in the face of system services restarting (service corosync restart).  A simple alternative is to allocate temporary memory to avoid requirements of large thread stacks.

Version-Release number of selected component (if applicable):
corosync-1.4.0

How reproducible:
always

Steps to Reproduce:
1. create an application thread with a small stack to restart (cpg_model_initialize or cpg_initialize) when a failure is detected.
2.
3.
  
Actual results:
threads with small stack sizes corrupt memory

Expected results:
use of small stacks sizes is acceptable when using corosync library.

Additional info:

Comment 1 Steven Dake 2011-07-21 19:38:00 UTC
Honza,

Patch looks ok to me for master.  Could you make a proper git commit and submit to ml so it can be reviewed (give Dan Clark credit for the work please).

Thanks!
-steve

Comment 2 Jan Friesse 2011-07-27 15:32:49 UTC
Created attachment 515547 [details]
Patch sent to ML

Patch sent to ML. It's GITized version of original patch + extra memset to avoid valgrind warnings.

Comment 3 Jan Friesse 2011-08-17 07:47:09 UTC
Patch is now included in flatiron branch, and will be included in next release.


Note You need to log in before you can comment on or make changes to this bug.