nscd: cache.c:335: prune_cache: Assertion `dh->usable' failed.

Bug #57214 reported by David N. Welton
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
glibc (Debian)
New
Unknown
glibc (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

I obvserved the same behavior on my up to date ubuntu system as reported here, including the error message:

#344563

Erasing the old cached data seemed to fix things, we'll see if it fails again in the future.

Tags: nscd
Revision history for this message
In , Arjan Oosting (arjanoosting) wrote : sort of solved the same problem

Hi,

I noticed nscd was not running on my machine either (after upgrade from
sarge to etch), and when I started it manually I got the same error.
After I deleted the deleted the databases in /var/db/nscd/ and started
nscd the problem was gone.

 Greetings Arjan Oosting

Revision history for this message
In , Tom Albers (tomalbers-deactivatedaccount) wrote : nscd will not keep on running

Now with another customer, I spend again a whole day on nscd which will not
keep on running. In debugging mode the error is:

"nscd: cache.c:144: cache_add: Assertion `newp->key + newp->len <=
table->head->first_free' failed."

Removing the databases in /var/db/nscd/ resolved the problem.

The database locations are not documented, nor is there any other usefull
documentation on nscd.

Revision history for this message
In , T-Bone (varenet) wrote : nscd fails to start, assertion 'dh->usable' failed

Package: nscd
Version: 2.3.6-3
Followup-For: Bug #344563

this bug is still there. I'm quite surprised as ISTR that I had previous
version of nscd running fine on that box. I may be wrong tho.

Here's the debug output:
# nscd -d
7688: Reloading "oident" in group cache!
7688: Reloading "newsrss.bbc.co.uk" in hosts cache!
7688: Reloading "0" in password cache!
7688: Reloading "tty" in group cache!
7688: Reloading "gdm" in group cache!
7688: Reloading "0" in password cache!
7688: Reloading "lp" in password cache!
7688: Reloading "1" in password cache!
7688: Reloading "110" in password cache!
7688: Reloading "ftp.de.debian.org" in hosts cache!
7688: Reloading "112" in password cache!
7688: Reloading "104" in password cache!
nscd: cache.c:335: prune_cache: Assertion `dh->usable' failed.
Aborted

HTH

-- System Information:
Debian Release: testing/unstable
  APT prefers testing
  APT policy: (990, 'testing'), (90, 'unstable')
Architecture: powerpc (ppc)
Shell: /bin/sh linked to /bin/bash
Kernel: Linux 2.6.15-ck1-tbone
Locale: LANG=en_US, LC_CTYPE=en_US (charmap=ISO-8859-1)

Versions of packages nscd depends on:
ii libc6 2.3.6-3 GNU C Library: Shared libraries an

nscd recommends no packages.

-- no debconf information

Revision history for this message
In , Nikita V. Youshchenko (yoush) wrote : Easy fix ?

> Removing the databases in /var/db/nscd/ resolved the problem.

So why not just remove old files on nscd package upgrade?..

Revision history for this message
In , T-Bone (varenet) wrote : Removing files doesn't fix it

I tried removing the db files, but it doesn't solve the issue. nscd
starts, but after a while it dies anyway. No message in the logs...

I'm running 2.3.6-7

HTH

T-Bone

--
Thibaut VARENE
http://www.parisc-linux.org/~varenet/

Revision history for this message
In , Fabian Knittel (fabian-knittel) wrote : Re: Easy fix ?

[ Sorry, Nikita, private mail was unintentional. ]

Hi,

On Thu, Apr 27, 2006 at 11:42:12AM +0400, Nikita V. Youshchenko wrote:
> > Removing the databases in /var/db/nscd/ resolved the problem.
>
> So why not just remove old files on nscd package upgrade?..

Deleting the corrupted cache only temporarily fixes the problem.
Unfortunately nscd currently crashes (or exits unexpectedly - we've
never actually seen it happen "live") in annoyingly regular intervals
and always leaves it's cache in an inconsistent state.

Greetings, Fabian

Revision history for this message
David N. Welton (davidnwelton) wrote : nscd suffers from this Debian bug: #344563

I obvserved the same behavior on my up to date ubuntu system as reported here, including the error message:

#344563

Erasing the old cached data seemed to fix things, we'll see if it fails again in the future.

Revision history for this message
Simon Law (sfllaw) wrote :

Which version of nscd are you running?

Changed in glibc:
status: Unconfirmed → Needs Info
Revision history for this message
David N. Welton (davidnwelton) wrote : Re: [Bug 57214] Re: nscd: cache.c:335: prune_cache: Assertion `dh->usable' failed.

On 8/22/06, Simon Law <email address hidden> wrote:
> Which version of nscd are you running?

Version: 2.3.6-0ubuntu20

Thanks,
--
David N. Welton
 - http://www.dedasys.com/davidw/

Linux, Open Source Consulting
 - http://www.dedasys.com/

Changed in glibc:
status: Unknown → Unconfirmed
Revision history for this message
Markus Jonskog (omljud) wrote :

Same problem here. nscd sporadically crashes with the message:
nscd: cache.c:384: prune_cache: Assertion `dh->usable' failed.

Version: 2.5-0ubuntu2

Revision history for this message
Markus Jonskog (omljud) wrote :

This problem breaks gnome-settings-daemon(crashes), gnome-screensaver(can't unlock), kate(file protocol dies => can't open files) and probably other things as well. Things start working if permissions on /etc/libnss-ldap.conf is set to 644, but it should be 600 becuase it contains credentials.
It's hard to use LDAP this way if nscd isn't working since lookups must be handled through nscd.

Revision history for this message
Jan Groenewald (jan-aims) wrote :

Not sure if this is related:
On an up to date feisty box

134 root@dikkop:~#nscd -d
23974: Reloading "1" in password cache!
23974: Reloading "102" in password cache!
23974: Reloading "103" in password cache!
23974: Reloading "112" in password cache!
23974: Reloading "113" in password cache!
23974: Reloading "105" in password cache!
23974: Reloading "106" in password cache!
23974: Reloading "107" in password cache!
23974: Reloading "jan" in password cache!
23974: Reloading "root" in group cache!
23974: Reloading "dikkop" in hosts cache!
nscd: hstcache.c:389: cache_addhst: Assertion `hst->h_addr_list[1] == ((void *)0)' failed.
Aborted (core dumped)

Version:
ii nscd 2.5-0ubuntu11

Revision history for this message
In , Jim Barber (jim-barber) wrote : nscd still crashing at version 2.3.6.ds1-13

I have a system where the nscd daemon constantly crashes too.
nscd, libc6, locales, etc is at version 2.3.6.ds1-13

I've tried commenting out the user and group caching settings in the /etc/nscd.conf file hoping to avoid the crashes since I only need it to cache host lookups.
This made no difference.
Nor does leaving the entries there and just changing the value of 'enable-cache' for the passwd and group entries to 'no'.

Starting nscd with the -d parameter it starts and runs for about 20 seconds before failing with:

 nscd: cache.c:335: prune_cache: Assertion `dh->usable' failed.
 Aborted

This error usually happens after entries like:

 27822: Reloading "250.186.184.59.sbl-xbl.spamhaus.org." in hosts cache!
 27822: Reloading "164.152.206.86.sbl-xbl.spamhaus.org." in hosts cache!

Clearing the databases like so:

 nscd -i hosts
 nscd -i passwd
 nscd -i group
Doesn't seem to help either.

I then got rid of the following files by moving them elsewhere:

 /var/db/nscd/group
 /var/db/nscd/hosts
 /var/db/nscd/passwd

This seems to at least get things working for a while, but eventually the nscd daemon falls over again.

Regards,

--
----------
Jim Barber
DDI Health

Revision history for this message
In , Pierre Habouzit (madcoder) wrote : Re: Bug#344563: nscd still crashing at version 2.3.6.ds1-13

On Thu, Mar 22, 2007 at 11:30:41AM +0900, Jim Barber wrote:
> I have a system where the nscd daemon constantly crashes too.
> nscd, libc6, locales, etc is at version 2.3.6.ds1-13
>
> I've tried commenting out the user and group caching settings in the
> /etc/nscd.conf file hoping to avoid the crashes since I only need it to
> cache host lookups.
> This made no difference.
> Nor does leaving the entries there and just changing the value of
> 'enable-cache' for the passwd and group entries to 'no'.
>
> Starting nscd with the -d parameter it starts and runs for about 20
> seconds before failing with:
>
> nscd: cache.c:335: prune_cache: Assertion `dh->usable' failed.
> Aborted
>
> This error usually happens after entries like:
>
> 27822: Reloading "250.186.184.59.sbl-xbl.spamhaus.org." in hosts cache!
> 27822: Reloading "164.152.206.86.sbl-xbl.spamhaus.org." in hosts cache!
>
> Clearing the databases like so:
>
> nscd -i hosts
> nscd -i passwd
> nscd -i group
> Doesn't seem to help either.
>
> I then got rid of the following files by moving them elsewhere:
>
> /var/db/nscd/group
> /var/db/nscd/hosts
> /var/db/nscd/passwd
>
> This seems to at least get things working for a while, but eventually the
> nscd daemon falls over again.
>

  A backtrace would really be of help. Please install the -dbg package
for the libc, and try to have one so that we can know which codepath
generates the issue.

  Also be warned that hosts caching in nscd sucks, it's not really built
to deal with DNS caching that other tools like dnsmasq or even bind
really deal with better.

--
·O· Pierre Habouzit
··O <email address hidden>
OOO http://www.madism.org

Revision history for this message
In , Pierre Habouzit (madcoder) wrote :

  Does nscd from libc 2.5 fixes the problem ?

On Thu, Mar 22, 2007 at 11:30:41AM +0900, Jim Barber wrote:
> I have a system where the nscd daemon constantly crashes too.
> nscd, libc6, locales, etc is at version 2.3.6.ds1-13
>
> I've tried commenting out the user and group caching settings in the
> /etc/nscd.conf file hoping to avoid the crashes since I only need it to
> cache host lookups.
> This made no difference.
> Nor does leaving the entries there and just changing the value of
> 'enable-cache' for the passwd and group entries to 'no'.
>
> Starting nscd with the -d parameter it starts and runs for about 20
> seconds before failing with:
>
> nscd: cache.c:335: prune_cache: Assertion `dh->usable' failed.
> Aborted
>
> This error usually happens after entries like:
>
> 27822: Reloading "250.186.184.59.sbl-xbl.spamhaus.org." in hosts cache!
> 27822: Reloading "164.152.206.86.sbl-xbl.spamhaus.org." in hosts cache!
>
> Clearing the databases like so:
>
> nscd -i hosts
> nscd -i passwd
> nscd -i group
> Doesn't seem to help either.
>
> I then got rid of the following files by moving them elsewhere:
>
> /var/db/nscd/group
> /var/db/nscd/hosts
> /var/db/nscd/passwd
>
> This seems to at least get things working for a while, but eventually the
> nscd daemon falls over again.
>
> Regards,
>
> --
> ----------
> Jim Barber
> DDI Health
>
>
>

On Sun, Apr 09, 2006 at 12:26:55PM +0200, Thibaut VARENE wrote:
> Package: nscd
> Version: 2.3.6-3
> Followup-For: Bug #344563
>
> this bug is still there. I'm quite surprised as ISTR that I had previous
> version of nscd running fine on that box. I may be wrong tho.
>
> Here's the debug output:
> # nscd -d
> 7688: Reloading "oident" in group cache!
> 7688: Reloading "newsrss.bbc.co.uk" in hosts cache!
> 7688: Reloading "0" in password cache!
> 7688: Reloading "tty" in group cache!
> 7688: Reloading "gdm" in group cache!
> 7688: Reloading "0" in password cache!
> 7688: Reloading "lp" in password cache!
> 7688: Reloading "1" in password cache!
> 7688: Reloading "110" in password cache!
> 7688: Reloading "ftp.de.debian.org" in hosts cache!
> 7688: Reloading "112" in password cache!
> 7688: Reloading "104" in password cache!
> nscd: cache.c:335: prune_cache: Assertion `dh->usable' failed.
> Aborted
>
> HTH
>
> -- System Information:
> Debian Release: testing/unstable
> APT prefers testing
> APT policy: (990, 'testing'), (90, 'unstable')
> Architecture: powerpc (ppc)
> Shell: /bin/sh linked to /bin/bash
> Kernel: Linux 2.6.15-ck1-tbone
> Locale: LANG=en_US, LC_CTYPE=en_US (charmap=ISO-8859-1)
>
> Versions of packages nscd depends on:
> ii libc6 2.3.6-3 GNU C Library: Shared libraries an
>
> nscd recommends no packages.
>
> -- no debconf information
>
>

--
·O· Pierre Habouzit
··O <email address hidden>
OOO http://www.madism.org

Revision history for this message
In , Ola Lundqvist (opal) wrote : I can report the same problem

Hi

I have the same problem om etch installation and i686.

nscd 2.3.6.ds1-13

Removing the files in /var/db/nscd/ solved the problem, at
least temporarily. I think it would be good if it either removes
these files on this failure, or that it tries to recover from
the situation instead of just dying.

Regards,

// Ola

--
 --------------------- Ola Lundqvist ---------------------------
/ <email address hidden> Annebergsslingan 37 \
| <email address hidden> 654 65 KARLSTAD |
| http://opalsys.net/ +46 (0)70-332 1551 |
\ gpg/f.p.: 7090 A92B 18FE 7994 0C36 4FE4 18A1 B1CF 0FE5 3DD9 /
 ---------------------------------------------------------------

Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for glibc (Ubuntu) because there has been no activity for 60 days.]

Revision history for this message
In , IOhannes m zmoelnig (umlaeute) wrote : nscd: confirmed

Package: nscd
Version: 2.3.6.ds1-13etch2
Followup-For: Bug #344563

well yes: the "nscd: cache.c:335: prune_cache: Assertion `dh->usable' failed."
bug still exists on current etch.

actually it just re-occured; i haven't experienced it for a while.
the only notable change on my side was that i did a security-upgrade the day
before yesterday, which - according to the logs - included perl and horde3.
so i don't think this is related.

deleting the db-files in /var/db/nscd/ seems to have solved the problem.

btw, this is the last request that was made when running "nscd -d" before it crashed:
29453: Reloading "10001243920.0000020425.acesso.oni.pt" in hosts cache!
nscd: cache.c:335: prune_cache: Assertion `dh->usable' failed.
Aborted

it crashed 2 times in a row just after this request.
then i deleted the db-files and the problem was gone.

so i guess the db-file was corrupted just at the mentioned host-entry.

mfgas.dr
IOhannes

-- System Information:
Debian Release: 4.0
  APT prefers stable
  APT policy: (500, 'stable')
Architecture: i386 (i686)
Shell: /bin/sh linked to /bin/bash
Kernel: Linux 2.6.18-4-686
Locale: LANG=de_AT.UTF-8, LC_CTYPE=de_AT.UTF-8 (charmap=UTF-8)

Versions of packages nscd depends on:
ii libc6 2.3.6.ds1-13etch2 GNU C Library: Shared libraries

nscd recommends no packages.

-- no debconf information

Revision history for this message
In , Hermann Lauer (hermann-lauer) wrote : nscd disk cache corrupted again

Package: nscd
Version: 2.3.6.ds1-13etch7
Followup-For: Bug #344563

today I noticed a failure of nscd, restarting in debug mode
yields to the famous "nscd: cache.c:335: prune_cache: Assertion `dh->usable' failed."
Cleaning the cache files in /var/db/nscd helped for the moment. So yes,
this bug is still in the latest etch update.

Btw., Bug#443475 and Bug#424723 are probably duplicates of this.

Greetings
  Hermann

-- System Information:
Debian Release: 4.0
  APT prefers stable
  APT policy: (500, 'stable')
Architecture: amd64 (x86_64)
Shell: /bin/sh linked to /bin/bash
Kernel: Linux 2.6.18-6-amd64
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)

Versions of packages nscd depends on:
ii libc6 2.3.6.ds1-13etch7 GNU C Library: Shared libraries

nscd recommends no packages.

-- no debconf information

Revision history for this message
In , Don Armstrong (don-debian) wrote : notfound 344563 in 2.3.5-9, found 344563 in 2.3.5-9

notfound 344563 2.3.5-9
found 344563 2.3.5-9

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.