Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-12-SP3:GA
glibc-testsuite.11579
nscd-gc-crash.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File nscd-gc-crash.patch of Package glibc-testsuite.11579
[BZ #19755] * nscd/pwdcache.c (cache_addpw): Lock prune_run_lock while adding new entries in auto-propagate mode. * nscd/grpcache.c (cache_addgr): Likewise. Index: glibc-2.22/nscd/grpcache.c =================================================================== --- glibc-2.22.orig/nscd/grpcache.c +++ glibc-2.22/nscd/grpcache.c @@ -205,10 +205,19 @@ cache_addgr (struct database_dyn *db, in dataset = NULL; if (he == NULL) - dataset = (struct dataset *) mempool_alloc (db, total + n, 1); + { + /* Prevent an INVALIDATE request from pruning the data between + the two calls to cache_add. */ + if (db->propagate) + pthread_mutex_lock (&db->prune_run_lock); + dataset = (struct dataset *) mempool_alloc (db, total + n, 1); + } if (dataset == NULL) { + if (he == NULL && db->propagate) + pthread_mutex_unlock (&db->prune_run_lock); + /* We cannot permanently add the result in the moment. But we can provide the result as is. Store the data in some temporary memory. */ @@ -396,6 +405,8 @@ cache_addgr (struct database_dyn *db, in out: pthread_rwlock_unlock (&db->lock); + if (he == NULL && db->propagate) + pthread_mutex_unlock (&db->prune_run_lock); } } Index: glibc-2.22/nscd/pwdcache.c =================================================================== --- glibc-2.22.orig/nscd/pwdcache.c +++ glibc-2.22/nscd/pwdcache.c @@ -198,10 +198,19 @@ cache_addpw (struct database_dyn *db, in dataset = NULL; if (he == NULL) - dataset = (struct dataset *) mempool_alloc (db, total + n, 1); + { + /* Prevent an INVALIDATE request from pruning the data between + the two calls to cache_add. */ + if (db->propagate) + pthread_mutex_lock (&db->prune_run_lock); + dataset = (struct dataset *) mempool_alloc (db, total + n, 1); + } if (dataset == NULL) { + if (he == NULL && db->propagate) + pthread_mutex_unlock (&db->prune_run_lock); + /* We cannot permanently add the result in the moment. But we can provide the result as is. Store the data in some temporary memory. */ @@ -374,6 +383,8 @@ cache_addpw (struct database_dyn *db, in out: pthread_rwlock_unlock (&db->lock); + if (he == NULL && db->propagate) + pthread_mutex_unlock (&db->prune_run_lock); } }
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor