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 897576 Details for
Bug 1099511
[PATCH] rpmdb often gets corrupted upon concurrent access due to a race in CDB
[?]
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]
Fix for bdb issue #3514381; el6/db4
0001-Fix-a-CDB-race.patch (text/plain), 2.67 KB, created by
Lubomir Rintel
on 2014-05-20 13:37:45 UTC
(
hide
)
Description:
Fix for bdb issue #3514381; el6/db4
Filename:
MIME Type:
Creator:
Lubomir Rintel
Created:
2014-05-20 13:37:45 UTC
Size:
2.67 KB
patch
obsolete
>From ae71c395ccd7652eeb5c158adbd8b5217e4e7f7e Mon Sep 17 00:00:00 2001 >From: michael brey <michael.brey@oracle.com> >Date: Tue, 20 May 2014 15:20:47 +0200 >Subject: [PATCH] Fix a CDB race > >Report and reproducer here: >https://community.oracle.com/thread/3514381 > >From: michael brey <michael.brey@oracle.com> >To: Lubomir Rintel <lkundrak@v3.sk> >Subject: Re: BDB crash >Date: Tue, 13 May 2014 09:07:45 -0600 (05/13/2014 05:07:45 PM) >Message-id: <53723541.7040203@oracle.com> > > attached are patches for each release. the 5.3.28 patch will apply on >top of 5.3.21. > >thanks >mike >--- > env/env_failchk.c | 24 ++++++++++++++++++++++++ > 1 files changed, 24 insertions(+), 0 deletions(-) > >diff --git a/env/env_failchk.c b/env/env_failchk.c >index 16d0bcb..b3f2738 100644 >--- a/env/env_failchk.c >+++ b/env/env_failchk.c >@@ -206,6 +206,7 @@ __env_in_api(env) > REGINFO *infop; > THREAD_INFO *thread; > u_int32_t i; >+ pid_t pid; > int unpin, ret; > > if ((htab = env->thr_hashtab) == NULL) >@@ -219,6 +220,7 @@ __env_in_api(env) > > for (i = 0; i < env->thr_nbucket; i++) > SH_TAILQ_FOREACH(ip, &htab[i], dbth_links, __db_thread_info) { >+ pid = ip->dbth_pid; > if (ip->dbth_state == THREAD_SLOT_NOT_IN_USE || > (ip->dbth_state == THREAD_OUT && > thread->thr_count < thread->thr_max)) >@@ -235,6 +237,28 @@ __env_in_api(env) > ip->dbth_state = THREAD_SLOT_NOT_IN_USE; > continue; > } >+ /* >+ * The above tests are not atomic, so it is possible that >+ * the process pointed by ip has changed during the tests. >+ * In particular, if the process pointed by ip when is_alive >+ * was executed terminated normally, a new process may reuse >+ * the same ip structure and change its dbth_state before the >+ * next two tests were performed. Therefore, we need to test >+ * here that all four tests above are done on the same process. >+ * If the process pointed by ip changed, all tests are invalid >+ * and can be ignored. >+ * Similarly, it's also possible for two processes racing to >+ * change the dbth_state of the same ip structure. For example, >+ * both process A and B reach the above test for the same >+ * terminated process C where C's dbth_state is THREAD_OUT. >+ * If A goes into the 'if' block and changes C's dbth_state to >+ * THREAD_SLOT_NOT_IN_USE before B checks the condition, B >+ * would incorrectly fail the test and run into this line. >+ * Therefore, we need to check C's dbth_state again and fail >+ * the db only if C's dbth_state is indeed THREAD_ACTIVE. >+ */ >+ if (ip->dbth_state != THREAD_ACTIVE || ip->dbth_pid != pid) >+ continue; > return (__db_failed(env, > "Thread died in Berkeley DB library", > ip->dbth_pid, ip->dbth_tid)); >-- >1.7.1 >
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 1099511
: 897576