Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 692499 Details for
Bug 907204
SIGSEGV in tool_mm_flush()
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
synchronize provider state
sblim-sfcb-1.4.3-synchronize_provider_state.patch (text/plain), 5.42 KB, created by
Vaughan Cao
on 2013-02-03 19:45:39 UTC
(
hide
)
Description:
synchronize provider state
Filename:
MIME Type:
Creator:
Vaughan Cao
Created:
2013-02-03 19:45:39 UTC
Size:
5.42 KB
patch
obsolete
>commit 4699356c2c7973994aa0ad280d1a848c984d9a0f >Author: nsharoff <nsharoff@nsharoff.(none)> >Date: Wed Apr 4 10:53:18 2012 -0700 > > [ 3497096 ] double free during stopProc() > >(This is cherry-picked from upstream commit 4699356c2c7973994aa0ad280d1a848c984d9a0f) >Signed-off-by: Vaughan Cao <vaughan.cao@oracle.com> > >diff -Nurp sblim-sfcb-1.3.11.sigsegv/ChangeLog sblim-sfcb-1.3.11/ChangeLog >--- sblim-sfcb-1.3.11.sigsegv/ChangeLog 2013-02-01 18:22:54.753191318 +0800 >+++ sblim-sfcb-1.3.11/ChangeLog 2013-02-01 18:24:49.685798650 +0800 >@@ -1,5 +1,10 @@ > 2012-04-04 Narasimha Sharoff <nsharoff@us.ibm.com> > >+ * providerDrv.c, providerMgr.c, sfcBroker.c: >+ [ 3497096 ] double free during stopProc() >+ >+2012-04-04 Narasimha Sharoff <nsharoff@us.ibm.com> >+ > * providerDrv.c, providerMgr.c, providerMgr.h, support.c: > [ 3416060 ] SIGSEGV in tool_mm_flush() > >diff -Nurp sblim-sfcb-1.3.11.sigsegv/providerDrv.c sblim-sfcb-1.3.11/providerDrv.c >--- sblim-sfcb-1.3.11.sigsegv/providerDrv.c 2013-02-01 18:22:54.754191446 +0800 >+++ sblim-sfcb-1.3.11/providerDrv.c 2013-02-01 18:24:49.686798778 +0800 >@@ -367,11 +367,11 @@ static void stopProc(void *p) > mlogf(M_INFO,M_SHOW,"--- stopped %s %d\n",processName,getpid()); > ctx->ft->release(ctx); > >- uninit_sfcBroker(); >- uninitProvProcCtl(); >- uninitSocketPairs(); >- sunsetControl(); >- uninitGarbageCollector(); >+ //uninit_sfcBroker(); /* 3497096 */ >+ //uninitProvProcCtl(); >+ //uninitSocketPairs(); >+ //sunsetControl(); >+ //uninitGarbageCollector(); > > exit(0); > } >diff -Nurp sblim-sfcb-1.3.11.sigsegv/providerMgr.c sblim-sfcb-1.3.11/providerMgr.c >--- sblim-sfcb-1.3.11.sigsegv/providerMgr.c 2013-02-01 18:22:54.755191573 +0800 >+++ sblim-sfcb-1.3.11/providerMgr.c 2013-02-01 18:24:49.689799161 +0800 >@@ -124,6 +124,9 @@ static void notSupported(int *requestor, > free(req); > } > >+int prov_rdy_state = -1; /* 3497096 :77022 - stopBroker() reads this value */ >+pthread_mutex_t syncMtx=PTHREAD_MUTEX_INITIALIZER; /* shared with stopBroker */ >+ > /* ------------- > * --- > * Instance Provider support >@@ -966,11 +969,19 @@ void processProviderMgrRequests() > _SFCB_TRACE(1,("--- Mgr request for %s-%s (%d) from %d", req->nameSpace.data, > req->className.data,req->type,requestor)); > >+ pthread_mutex_lock(&syncMtx); /* 77022 */ >+ prov_rdy_state = -1; >+ pthread_mutex_unlock(&syncMtx); >+ > sigprocmask(SIG_SETMASK, &mask, &old_mask); > hdlr = mHandlers[req->type]; > hdlr.handler(&requestor, req); > sigprocmask(SIG_SETMASK, &old_mask, NULL); > >+ pthread_mutex_lock(&syncMtx); /* 77022 */ >+ prov_rdy_state = 1; >+ pthread_mutex_unlock(&syncMtx); >+ > _SFCB_TRACE(1,("--- Mgr request for %s-%s DONE", req->nameSpace.data, > req->className.data)); > free(req); >diff -Nurp sblim-sfcb-1.3.11.sigsegv/sfcBroker.c sblim-sfcb-1.3.11/sfcBroker.c >--- sblim-sfcb-1.3.11.sigsegv/sfcBroker.c 2010-05-25 23:07:43.000000000 +0800 >+++ sblim-sfcb-1.3.11/sfcBroker.c 2013-02-01 18:24:49.690799289 +0800 >@@ -149,6 +149,10 @@ static int stopNextAdapter() > return 0; > } > >+/* 3497096 :77022 */ >+extern pthread_mutex_t syncMtx; /* syncronize provider state */ >+extern int prov_rdy_state; /* -1 indicates not ready */ >+ > static pthread_mutex_t sdMtx=PTHREAD_MUTEX_INITIALIZER; > static pthread_cond_t sdCnd=PTHREAD_COND_INITIALIZER; > static int stopping=0; >@@ -157,9 +161,34 @@ extern int remSem(); > static void stopBroker(void *p) > { > struct timespec waitTime; >- int rc,sa=0,sp=0; >+ int rc,sa=0,sp=0, count = 0; >+ >+ /* SF 3497096 bugzilla 77022 */ >+ /* stopping is set to prevent other threads calling this routine */ >+ pthread_mutex_lock(&syncMtx); >+ if (stopping) { >+ printf("Stopping sfcb is in progress. Please wait...\n"); >+ pthread_mutex_unlock(&syncMtx); >+ return; >+ } >+ else { >+ stopping=1; >+ pthread_mutex_unlock(&syncMtx); >+ } > >- stopping=1; >+ /* Look for providers ready status. A 5 seconds wait is performed to >+ * avoid a hang here in the event of provider looping, crashing etc >+ */ >+ for (;;) { >+ pthread_mutex_lock(&syncMtx); >+ if (prov_rdy_state == -1) { >+ if (count >= 5) break; /* lock will be released later */ >+ pthread_mutex_unlock(&syncMtx); >+ sleep(1); >+ count++; >+ } >+ else break; /* lock will be released later */ >+ } > > stopLocalConnectServer(); > >@@ -167,7 +196,7 @@ static void stopBroker(void *p) > > if (adaptersStopped==0) { > pthread_mutex_lock(&sdMtx); >- waitTime.tv_sec=time(NULL)+5; >+ waitTime.tv_sec = time(NULL) + 1; //5 > waitTime.tv_nsec=0; > if (sa==0) fprintf(stderr,"--- Stopping adapters\n"); > sa++; >@@ -183,7 +212,7 @@ static void stopBroker(void *p) > > if (adaptersStopped) { > pthread_mutex_lock(&sdMtx); >- waitTime.tv_sec=time(NULL)+5; >+ waitTime.tv_sec = time(NULL) + 1; //5 > waitTime.tv_nsec=0; > if (sp==0) fprintf(stderr,"--- Stopping providers\n"); > sp++; >@@ -201,9 +230,11 @@ static void stopBroker(void *p) > uninitProvProcCtl(); > uninitSocketPairs(); > sunsetControl(); >-// uninitGarbageCollector(); >+ uninitGarbageCollector(); > closeLogging(); > >+ pthread_mutex_unlock(&syncMtx); >+ > if (restartBroker) { > char *emsg=strerror(errno); > execvp("sfcbd",restartArgv);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 907204
:
692459
| 692499 |
1132811
|
1136496