glibc/nscd
Andreas Schwab bd499987c6 Fix nscd assertion failure in gc (bug 19755)
If a GETxxBYyy request (for passwd or group) is running in parallel to
an INVALIDATE request (for the same database) then in a particular order
of events the garbage collector is not properly marking all used memory
and fails an assertion:

   GETGRBYNAME (root)
Haven't found "root" in group cache!
add new entry "root" of type GETGRBYNAME for group to cache (first)
handle_request: request received (Version = 2) from PID 7413
   INVALIDATE (group)
pruning group cache; time 9223372036854775807
considering GETGRBYNAME entry "root", timeout 1456763027
add new entry "0" of type GETGRBYGID for group to cache
remove GETGRBYNAME entry "root"
nscd: mem.c:403: gc: Assertion `next_data == &he_data[db->head->nentries]' failed.

Here the first call to cache_add added the GETGRBYNAME entry, which is
immediately marked for collection by prune_cache.  Then the GETGRBYGID
entry is added which shares the data packet with the first entry and
therefore is marked as !first, while the marking look in prune_cache has
already finished.  When the garbage collector runs, it only considers
references by entries marked as first, missing the reference by the
secondary entry.

The only way to fix that is to prevent prune_cache from running while the
two related entries are added.
2016-06-09 09:57:40 +02:00
..
aicache.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
cache.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
connections.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
dbg_log.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
dbg_log.h Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
Depend Don't mention linuxthreads in Depend files. 2014-05-21 16:53:11 +00:00
gai.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
getgrgid_r.c NSS: Implement group merging support. 2016-04-29 22:18:21 -04:00
getgrnam_r.c NSS: Implement group merging support. 2016-04-29 22:18:21 -04:00
gethstbyad_r.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
gethstbynm3_r.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
getpwnam_r.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
getpwuid_r.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
getsrvbynm_r.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
getsrvbypt_r.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
grpcache.c Fix nscd assertion failure in gc (bug 19755) 2016-06-09 09:57:40 +02:00
hstcache.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
initgrcache.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
Makefile Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
mem.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
netgroupcache.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
nscd_conf.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
nscd_getai.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
nscd_getgr_r.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
nscd_gethst_r.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
nscd_getpw_r.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
nscd_getserv_r.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
nscd_helper.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
nscd_initgroups.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
nscd_netgroup.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
nscd_proto.h Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
nscd_setup_thread.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
nscd_stat.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
nscd-client.h Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
nscd.c Fix build errors with -DNDEBUG. 2016-01-15 10:44:07 -07:00
nscd.conf Implement caching of nscd 2011-10-07 10:06:31 -04:00
nscd.h Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
nscd.init . 2007-07-31 13:33:18 +00:00
nscd.service nscd: also invalidate netgroup cache on reload 2014-03-19 14:45:10 +01:00
nscd.tmpfiles Add systemd unit file for nscd 2013-12-16 11:22:01 +10:00
pwdcache.c Fix nscd assertion failure in gc (bug 19755) 2016-06-09 09:57:40 +02:00
res_hconf.c [BZ #4814] 2007-08-22 03:14:29 +00:00
selinux.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
selinux.h Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
servicescache.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00