Having traced this a number of times, I have consistently seen this assertion fail: nscd: mem.c:335: gc: Assertion `off_alloc <= db->head->first_free' failed. This occurs during garbage collection, when the code is calculating slack space in it's tree layout: ref_t off_alloc = (byte * BITS + cnt) * BLOCK_ALIGN; assert (off_alloc <= db->head->first_free); ...it detects an overlap. This always fires after a new thread has been created: # valgrind --trace-children=yes /usr/sbin/nscd -d ==7565== Memcheck, a memory error detector. ==7565== Copyright (C) 2002-2007, and GNU GPL'd, by Julian Seward et al. ==7565== Using LibVEX rev 1854, a library for dynamic binary translation. ==7565== Copyright (C) 2004-2007, and GNU GPL'd, by OpenWorks LLP. ==7565== Using valgrind-3.3.1-Debian, a dynamic binary instrumentation framework. ==7565== Copyright (C) 2000-2007, and GNU GPL'd, by Julian Seward et al. ==7565== For more details, rerun with: -v ==7565== 7565: handle_request: request received (Version = 2) from PID 7063 7565: GETFDGR 7565: provide access to FD 6, for group 7565: handle_request: request received (Version = 2) from PID 7586 7565: GETFDPW 7565: provide access to FD 4, for passwd 7565: handle_request: request received (Version = 2) from PID 7600 7565: GETFDPW 7565: provide access to FD 4, for passwd 7565: handle_request: request received (Version = 2) from PID 7603 7565: GETFDPW 7565: provide access to FD 4, for passwd 7565: handle_request: request received (Version = 2) from PID 7651 7565: GETFDPW 7565: provide access to FD 4, for passwd 7565: handle_request: request received (Version = 2) from PID 7651 7565: GETFDHST 7565: handle_request: request received (Version = 2) from PID 7651 7565: GETHOSTBYNAME (sony) 7565: Reloading "root" in password cache! 7565: Reloading "gdm" in password cache! 7565: Reloading "haldaemon" in password cache! 7565: Reloading "messagebus" in password cache! 7565: Reloading "polkituser" in password cache! 7565: Reloading "daniel" in password cache! 7565: Reloading "sshd" in password cache! 7565: Reloading "ntp" in password cache! 7565: Reloading "nobody" in password cache! 7565: Reloading "7" in password cache! 7565: Reloading "1" in password cache! 7565: Reloading "110" in password cache! 7565: Reloading "115" in password cache! 7565: Reloading "root" in password cache! 7565: Reloading "gdm" in password cache! 7565: Reloading "haldaemon" in password cache! 7565: Reloading "messagebus" in password cache! 7565: Reloading "polkituser" in password cache! 7565: Reloading "daniel" in password cache! 7565: Reloading "sshd" in password cache! 7565: Reloading "ntp" in password cache! 7565: Reloading "nobody" in password cache! 7565: Reloading "7" in password cache! 7565: Reloading "1" in password cache! 7565: Reloading "110" in password cache! 7565: Reloading "115" in password cache! 7565: Reloading "root" in password cache! 7565: Reloading "gdm" in password cache! 7565: Reloading "haldaemon" in password cache! 7565: Reloading "messagebus" in password cache! 7565: Reloading "polkituser" in password cache! 7565: Reloading "daniel" in password cache! 7565: Reloading "sshd" in password cache! 7565: Reloading "ntp" in password cache! 7565: handle_request: request received (Version = 2) from PID 8717 7565: GETFDPW 7565: provide access to FD 4, for passwd 7565: handle_request: request received (Version = 2) from PID 8720 7565: GETFDPW 7565: provide access to FD 4, for passwd 7565: handle_request: request received (Version = 2) from PID 8721 7565: GETFDGR 7565: provide access to FD 6, for group 7565: handle_request: request received (Version = 2) from PID 8721 7565: GETFDPW 7565: provide access to FD 4, for passwd 7565: handle_request: request received (Version = 2) from PID 8722 7565: GETFDGR 7565: provide access to FD 6, for group 7565: handle_request: request received (Version = 2) from PID 8722 7565: GETFDPW 7565: provide access to FD 4, for passwd 7565: handle_request: request received (Version = 2) from PID 8723 7565: GETFDGR 7565: provide access to FD 6, for group 7565: handle_request: request received (Version = 2) from PID 8723 7565: GETFDPW 7565: provide access to FD 4, for passwd 7565: handle_request: request received (Version = 2) from PID 8724 7565: GETFDGR 7565: provide access to FD 6, for group 7565: handle_request: request received (Version = 2) from PID 8724 7565: GETFDPW 7565: provide access to FD 4, for passwd 7565: handle_request: request received (Version = 2) from PID 8725 7565: GETFDGR 7565: provide access to FD 6, for group 7565: handle_request: request received (Version = 2) from PID 8725 7565: GETFDPW 7565: provide access to FD 4, for passwd 7565: handle_request: request received (Version = 2) from PID 8726 7565: GETFDGR 7565: provide access to FD 6, for group 7565: handle_request: request received (Version = 2) from PID 8726 7565: GETFDPW 7565: provide access to FD 4, for passwd 7565: handle_request: request received (Version = 2) from PID 8727 7565: GETFDGR 7565: provide access to FD 6, for group 7565: handle_request: request received (Version = 2) from PID 8727 7565: GETFDPW 7565: provide access to FD 4, for passwd 7565: handle_request: request received (Version = 2) from PID 8728 7565: GETFDGR 7565: provide access to FD 6, for group 7565: handle_request: request received (Version = 2) from PID 8728 7565: GETFDPW 7565: provide access to FD 4, for passwd 7565: handle_request: request received (Version = 2) from PID 8729 7565: GETFDGR 7565: provide access to FD 6, for group 7565: handle_request: request received (Version = 2) from PID 8729 7565: GETFDPW 7565: provide access to FD 4, for passwd 7565: handle_request: request received (Version = 2) from PID 8730 7565: GETFDGR 7565: provide access to FD 6, for group 7565: handle_request: request received (Version = 2) from PID 8730 7565: GETFDPW 7565: provide access to FD 4, for passwd 7565: handle_request: request received (Version = 2) from PID 8731 7565: GETFDGR 7565: provide access to FD 6, for group 7565: handle_request: request received (Version = 2) from PID 8731 7565: GETFDPW 7565: provide access to FD 4, for passwd 7565: handle_request: request received (Version = 2) from PID 8732 7565: GETFDGR 7565: provide access to FD 6, for group 7565: handle_request: request received (Version = 2) from PID 8732 7565: GETFDPW 7565: provide access to FD 4, for passwd 7565: handle_request: request received (Version = 2) from PID 8733 7565: GETFDGR 7565: provide access to FD 6, for group 7565: handle_request: request received (Version = 2) from PID 8733 7565: GETFDPW 7565: provide access to FD 4, for passwd 7565: handle_request: request received (Version = 2) from PID 8734 7565: GETFDGR 7565: provide access to FD 6, for group 7565: handle_request: request received (Version = 2) from PID 8734 7565: GETFDPW 7565: provide access to FD 4, for passwd 7565: handle_request: request received (Version = 2) from PID 8735 7565: GETFDGR 7565: provide access to FD 6, for group 7565: handle_request: request received (Version = 2) from PID 8735 7565: GETFDPW 7565: provide access to FD 4, for passwd 7565: handle_request: request received (Version = 2) from PID 8736 7565: GETFDGR 7565: provide access to FD 6, for group 7565: handle_request: request received (Version = 2) from PID 8736 7565: GETFDPW 7565: provide access to FD 4, for passwd 7565: handle_request: request received (Version = 2) from PID 8737 7565: GETFDGR 7565: provide access to FD 6, for group 7565: handle_request: request received (Version = 2) from PID 8737 7565: GETFDPW 7565: provide access to FD 4, for passwd 7565: handle_request: request received (Version = 2) from PID 8738 7565: GETFDGR 7565: provide access to FD 6, for group 7565: handle_request: request received (Version = 2) from PID 8738 7565: GETFDPW 7565: provide access to FD 4, for passwd 7565: handle_request: request received (Version = 2) from PID 8739 7565: GETFDGR 7565: provide access to FD 6, for group 7565: handle_request: request received (Version = 2) from PID 8739 7565: GETFDPW 7565: provide access to FD 4, for passwd 7565: handle_request: request received (Version = 2) from PID 8740 7565: GETFDGR 7565: provide access to FD 6, for group 7565: handle_request: request received (Version = 2) from PID 8740 7565: GETFDPW 7565: provide access to FD 4, for passwd 7565: handle_request: request received (Version = 2) from PID 8741 7565: GETFDGR 7565: provide access to FD 6, for group 7565: handle_request: request received (Version = 2) from PID 8741 7565: GETFDPW 7565: provide access to FD 4, for passwd 7565: handle_request: request received (Version = 2) from PID 8742 7565: GETFDGR 7565: provide access to FD 6, for group 7565: handle_request: request received (Version = 2) from PID 8742 7565: GETFDPW 7565: provide access to FD 4, for passwd 7565: handle_request: request received (Version = 2) from PID 8743 7565: GETFDGR 7565: provide access to FD 6, for group 7565: handle_request: request received (Version = 2) from PID 8743 7565: GETFDPW 7565: provide access to FD 4, for passwd 7565: handle_request: request received (Version = 2) from PID 8744 7565: GETFDGR 7565: provide access to FD 6, for group 7565: handle_request: request received (Version = 2) from PID 8744 7565: GETFDPW 7565: provide access to FD 4, for passwd 7565: handle_request: request received (Version = 2) from PID 8745 7565: GETFDGR 7565: provide access to FD 6, for group 7565: handle_request: request received (Version = 2) from PID 8745 7565: GETFDPW 7565: provide access to FD 4, for passwd 7565: handle_request: request received (Version = 2) from PID 8746 7565: GETFDGR 7565: provide access to FD 6, for group 7565: handle_request: request received (Version = 2) from PID 8746 7565: GETFDPW 7565: provide access to FD 4, for passwd 7565: handle_request: request received (Version = 2) from PID 8747 7565: GETFDGR 7565: provide access to FD 6, for group 7565: handle_request: request received (Version = 2) from PID 8747 7565: GETFDPW 7565: provide access to FD 4, for passwd 7565: handle_request: request received (Version = 2) from PID 8748 7565: GETFDGR 7565: provide access to FD 6, for group 7565: handle_request: request received (Version = 2) from PID 8748 7565: GETFDPW 7565: provide access to FD 4, for passwd 7565: handle_request: request received (Version = 2) from PID 8749 7565: GETFDGR 7565: provide access to FD 6, for group 7565: handle_request: request received (Version = 2) from PID 8749 7565: GETFDPW 7565: provide access to FD 4, for passwd 7565: handle_request: request received (Version = 2) from PID 8750 7565: GETFDGR 7565: provide access to FD 6, for group 7565: handle_request: request received (Version = 2) from PID 8750 7565: GETFDPW 7565: provide access to FD 4, for passwd 7565: handle_request: request received (Version = 2) from PID 8751 7565: GETFDGR 7565: provide access to FD 6, for group 7565: handle_request: request received (Version = 2) from PID 8751 7565: GETFDPW 7565: provide access to FD 4, for passwd 7565: handle_request: request received (Version = 2) from PID 8752 7565: GETFDGR 7565: provide access to FD 6, for group 7565: handle_request: request received (Version = 2) from PID 8752 7565: GETFDPW 7565: provide access to FD 4, for passwd 7565: handle_request: request received (Version = 2) from PID 8753 7565: GETFDGR 7565: provide access to FD 6, for group 7565: handle_request: request received (Version = 2) from PID 8753 7565: GETFDPW 7565: provide access to FD 4, for passwd 7565: handle_request: request received (Version = 2) from PID 8754 7565: GETFDGR 7565: provide access to FD 6, for group 7565: handle_request: request received (Version = 2) from PID 8754 7565: GETFDPW 7565: provide access to FD 4, for passwd 7565: handle_request: request received (Version = 2) from PID 8755 7565: GETFDGR 7565: provide access to FD 6, for group 7565: handle_request: request received (Version = 2) from PID 8755 7565: GETFDPW 7565: provide access to FD 4, for passwd 7565: handle_request: request received (Version = 2) from PID 8756 7565: GETFDGR 7565: provide access to FD 6, for group 7565: handle_request: request received (Version = 2) from PID 8756 7565: GETFDPW 7565: provide access to FD 4, for passwd 7565: handle_request: request received (Version = 2) from PID 8757 7565: GETFDGR 7565: provide access to FD 6, for group 7565: handle_request: request received (Version = 2) from PID 8757 7565: GETFDPW 7565: provide access to FD 4, for passwd 7565: handle_request: request received (Version = 2) from PID 8758 7565: GETFDGR 7565: provide access to FD 6, for group 7565: handle_request: request received (Version = 2) from PID 8758 7565: GETFDPW 7565: provide access to FD 4, for passwd 7565: handle_request: request received (Version = 2) from PID 8759 7565: GETFDGR 7565: provide access to FD 6, for group 7565: handle_request: request received (Version = 2) from PID 8759 7565: GETFDPW 7565: provide access to FD 4, for passwd 7565: Reloading "nobody" in password cache! 7565: Reloading "7" in password cache! 7565: Reloading "1" in password cache! 7565: Reloading "110" in password cache! 7565: Reloading "115" in password cache! 7565: Reloading "root" in password cache! 7565: Reloading "gdm" in password cache! 7565: Reloading "haldaemon" in password cache! 7565: Reloading "messagebus" in password cache! 7565: Reloading "polkituser" in password cache! 7565: Reloading "daniel" in password cache! 7565: Reloading "sshd" in password cache! 7565: Reloading "ntp" in password cache! 7565: Reloading "nobody" in password cache! 7565: Reloading "7" in password cache! 7565: Reloading "1" in password cache! 7565: Reloading "110" in password cache! 7565: Reloading "115" in password cache! 7565: handle_request: request received (Version = 2) from PID 9337 7565: GETFDPW 7565: provide access to FD 4, for passwd 7565: Reloading "root" in password cache! 7565: Reloading "gdm" in password cache! 7565: Reloading "haldaemon" in password cache! 7565: Reloading "messagebus" in password cache! 7565: Reloading "polkituser" in password cache! 7565: Reloading "daniel" in password cache! 7565: Reloading "sshd" in password cache! 7565: Reloading "ntp" in password cache! 7565: Reloading "nobody" in password cache! 7565: Reloading "7" in password cache! 7565: Reloading "1" in password cache! 7565: Reloading "110" in password cache! 7565: Reloading "115" in password cache! 7565: Reloading "audio" in group cache! 7565: Reloading "root" in group cache! 7565: Reloading "gdm" in group cache! 7565: Reloading "gdm" in group cache! 7565: Reloading "haldaemon" in group cache! 7565: Reloading "haldaemon" in group cache! 7565: Reloading "120" in group cache! 7565: Reloading "104" in group cache! 7565: Reloading "30" in group cache! 7565: Reloading "123" in group cache! 7565: Reloading "20" in group cache! 7565: Reloading "4" in group cache! 7565: Reloading "125" in group cache! 7565: Reloading "44" in group cache! 7565: Reloading "108" in group cache! 7565: Reloading "127" in group cache! 7565: Reloading "24" in group cache! 7565: Reloading "daniel" in group cache! 7565: Reloading "46" in group cache! 7565: Reloading "25" in group cache! 7565: Reloading "100" in group cache! 7565: Reloading "0" in group cache! 7565: Reloading "tty" in group cache! 7565: remove GETPWBYUID entry "0" 7565: remove GETPWBYUID entry "111" 7565: remove GETPWBYNAME entry "root" 7565: remove GETPWBYUID entry "105" 7565: remove GETPWBYNAME entry "gdm" 7565: remove GETPWBYNAME entry "haldaemon" 7565: remove GETPWBYNAME entry "messagebus" 7565: remove GETPWBYUID entry "108" 7565: remove GETPWBYNAME entry "polkituser" 7565: remove GETPWBYUID entry "1500" 7565: remove GETPWBYUID entry "109" 7565: remove GETPWBYNAME entry "daniel" ==7565== Thread 2: ==7565== Conditional jump or move depends on uninitialised value(s) ==7565== at 0x108A0: (within /usr/sbin/nscd) ==7565== by 0xFBBD: (within /usr/sbin/nscd) ==7565== by 0x5D56: (within /usr/sbin/nscd) ==7565== by 0x484F50E: start_thread (in /lib/tls/i686/cmov/libpthread-2.8.90.so) ==7565== by 0x495C7ED: clone (in /lib/tls/i686/cmov/libc-2.8.90.so) 7565: Reloading "nogroup" in group cache! 7565: handle_request: request received (Version = 2) from PID 6756 7565: GETPWBYNAME (daniel) 7565: Haven't found "daniel" in password cache! 7565: remove GETPWBYNAME entry "sshd" 7565: remove GETPWBYNAME entry "ntp" 7565: remove GETPWBYUID entry "116" 7565: remove GETPWBYUID entry "117" ==7565== ==7565== Conditional jump or move depends on uninitialised value(s) ==7565== at 0x10A10: (within /usr/sbin/nscd) ==7565== by 0xFBBD: (within /usr/sbin/nscd) ==7565== by 0x5D56: (within /usr/sbin/nscd) ==7565== by 0x484F50E: start_thread (in /lib/tls/i686/cmov/libpthread-2.8.90.so) ==7565== by 0x495C7ED: clone (in /lib/tls/i686/cmov/libc-2.8.90.so) ==7565== ==7565== Conditional jump or move depends on uninitialised value(s) ==7565== at 0x10B90: (within /usr/sbin/nscd) ==7565== by 0xFBBD: (within /usr/sbin/nscd) ==7565== by 0x5D56: (within /usr/sbin/nscd) ==7565== by 0x484F50E: start_thread (in /lib/tls/i686/cmov/libpthread-2.8.90.so) ==7565== by 0x495C7ED: clone (in /lib/tls/i686/cmov/libc-2.8.90.so) ==7565== ==7565== Conditional jump or move depends on uninitialised value(s) ==7565== at 0x10BD2: (within /usr/sbin/nscd) ==7565== by 0xFBBD: (within /usr/sbin/nscd) ==7565== by 0x5D56: (within /usr/sbin/nscd) ==7565== by 0x484F50E: start_thread (in /lib/tls/i686/cmov/libpthread-2.8.90.so) ==7565== by 0x495C7ED: clone (in /lib/tls/i686/cmov/libc-2.8.90.so) nscd: mem.c:335: gc: Assertion `off_alloc <= db->head->first_free' failed. ==7565== ==7565== ERROR SUMMARY: 8 errors from 4 contexts (suppressed: 40 from 2) ==7565== malloc/free: in use at exit: 13,620 bytes in 40 blocks. ==7565== malloc/free: 2,135 allocs, 2,095 frees, 182,826 bytes allocated. ==7565== For counts of detected errors, rerun with: -v ==7565== searching for pointers to 40 not-freed blocks. ==7565== checked 8,151,852 bytes. ==7565== ==7565== LEAK SUMMARY: ==7565== definitely lost: 444 bytes in 31 blocks. ==7565== possibly lost: 1,008 bytes in 7 blocks. ==7565== still reachable: 12,168 bytes in 2 blocks. ==7565== suppressed: 0 bytes in 0 blocks. ==7565== Rerun with --leak-check=full to see details of leaked memory. Killed