[Bug 958305] Re: nscd crashed with SIGSEGV in _nss_files_init()

Daniel J Blueman daniel at quora.org
Mon Jul 9 14:54:00 UTC 2012


Based on feedback from Ubuntu developers, we see that unscd-0.48 was
released only to fix this issue [1]. On that basis, I feel it is
suitable as a pure backport to avoid introduction of other issues.

--- [1]

$ bzr branch lp:ubuntu/precise/unscd && mv unscd unscd-precise
$ bzr branch lp:ubuntu/quantal/unscd && mv unscd unscd-quantal
$ diff -ur --exclude 'debian' unscd-precise/nscd.c unscd-quantal/nscd.c 
--- unscd-precise/nscd.c	2012-07-09 22:37:10.781166000 +0800
+++ unscd-quantal/nscd.c	2012-07-09 22:41:19.204361000 +0800
@@ -139,8 +139,9 @@
  *        thanks to Sebastian Krahmer (krahmer AT suse.de)
  * 0.46   fix a case when we forgot to remove a future entry on worker failure
  * 0.47   fix nscd without -d to not bump debug level
+ * 0.48   fix for changes in __nss_disable_nscd API in glibc-2.15
  */
-#define PROGRAM_VERSION "0.47"
+#define PROGRAM_VERSION "0.48"
 
 #define DEBUG_BUILD 1
 
@@ -2097,7 +2098,7 @@
 };
 
 static const char *const help[] = {
-	"Do not daemonize; log to stderr",
+	"Do not daemonize; log to stderr (-dd: more verbosity)",
 	"File to read configuration from",
 	"Invalidate cache",
 	"Shut the server down",
@@ -2347,6 +2348,7 @@
 
 
 /* not static - don't inline me, compiler! */
+void readlink_self_exe(void);
 void readlink_self_exe(void)
 {
 	char buf[PATH_MAX + 1];
@@ -2389,15 +2391,32 @@
 		reqdata.req.key_len = arg_len;
 		memcpy(reqdata.arg, arg, arg_len);
 		xfull_write(sock, &reqdata, arg_len + sizeof(ureq));
-		printf("sent invalidate(%s) request, exiting\n", arg);
+		if (debug) {
+		  printf("sent invalidate(%s) request, exiting\n", arg);
+		}
 	}
 	exit(0);
 }
 
 
+/* Callback for glibc-2.15 */
+struct traced_file;
+static void do_nothing(size_t dbidx, struct traced_file *finfo)
+{
+	/* nscd from glibc-2.15 does something like this:
+	if (!dbs[dbidx].enabled || !dbs[dbidx].check_file)
+		return;
+	add_file_to_watch_list(finfo->fname);
+	*/
+}
+
 /* This internal glibc function is called to disable trying to contact nscd.
- * We _are_ nscd, so we need to do the lookups, and not recurse. */
-void __nss_disable_nscd(void);
+ * We _are_ nscd, so we need to do the lookups, and not recurse.
+ * Until 2.14, this function was taking no parameters.
+ * In 2.15, it takes a function pointer from hell.
+ */
+void __nss_disable_nscd(void (*hell)(size_t, struct traced_file*));
+
 
 int main(int argc, char **argv)
 {
@@ -2407,7 +2426,7 @@
 	const char *conffile;
 
 	/* make sure we don't get recursive calls */
-	__nss_disable_nscd();
+	__nss_disable_nscd(do_nothing);
 
 	if (argv[0][0] == 'w') /* "worker_nscd" */
 		worker(argv[1]);


** Description changed:

  Clean x86-64 install of precise as of 2012-03-17; unscd is hit with SEGV
  whenever it starts, ie 100% reproducability.
  
  ProblemType: Crash
  DistroRelease: Ubuntu 12.04
  Package: unscd 0.47-2build2
  ProcVersionSignature: Ubuntu 3.2.0-19.30-generic 3.2.11
  Uname: Linux 3.2.0-19-generic x86_64
  ApportVersion: 1.94.1-0ubuntu2
  Architecture: amd64
  Date: Sun Mar 18 11:18:59 2012
  Disassembly: => 0x1:	Cannot access memory at address 0x1
  ExecutablePath: /usr/sbin/nscd
  InstallationMedia: Ubuntu 12.04 LTS "Precise Pangolin" - Alpha amd64 (20120316)
  ProcCmdline: /usr/sbin/nscd
  ProcEnviron:
-  LANGUAGE=en_SG:en
-  TERM=linux
-  LANG=en_SG.UTF-8
-  SHELL=/bin/bash
+  LANGUAGE=en_SG:en
+  TERM=linux
+  LANG=en_SG.UTF-8
+  SHELL=/bin/bash
  SegvAnalysis:
-  Segfault happened at: 0x1:	Cannot access memory at address 0x1
-  PC (0x00000001) not located in a known VMA region (needed executable region)!
+  Segfault happened at: 0x1:	Cannot access memory at address 0x1
+  PC (0x00000001) not located in a known VMA region (needed executable region)!
  SegvReason: executing NULL VMA
  Signal: 11
  SourcePackage: unscd
  StacktraceTop:
-  ?? ()
-  _nss_files_init (cb=0x1) at nss_files/files-init.c:47
-  nss_load_library (ni=<optimized out>) at nsswitch.c:412
-  nss_load_all_libraries (def=0x7f03dd560b74 "dns [!UNAVAIL=return] files", service=0x7f03dd560b90 "hosts") at nsswitch.c:875
-  __nss_disable_nscd (cb=<optimized out>) at nsswitch.c:895
+  ?? ()
+  _nss_files_init (cb=0x1) at nss_files/files-init.c:47
+  nss_load_library (ni=<optimized out>) at nsswitch.c:412
+  nss_load_all_libraries (def=0x7f03dd560b74 "dns [!UNAVAIL=return] files", service=0x7f03dd560b90 "hosts") at nsswitch.c:875
+  __nss_disable_nscd (cb=<optimized out>) at nsswitch.c:895
  Title: nscd crashed with SIGSEGV in _nss_files_init()
  UpgradeStatus: No upgrade log present (probably fresh install)
  UserGroups:
+ 
+ unscd 0.48 fixes just this issue (see patch delta below) and is already released in Quantal, so is a candidate fix for this issue in Precise:
+ http://archive.ubuntu.com/ubuntu/pool/universe/u/unscd/
+ 
+ http://archive.ubuntu.com/ubuntu/pool/universe/u/unscd/unscd_0.48-2_amd64.deb
+ http://archive.ubuntu.com/ubuntu/pool/universe/u/unscd/unscd_0.48-2_i386.deb
+ 
+ I have verified this here and it addresses the issue. SRU justification:
+ [Impact] unscd-0.47 crashes each time it is started, thus is useless and obtrusive
+ [Test Case] start unscd-0.47: sudo /etc/init.d/unscd start
+ [Regression Potential] None due to existing crasher

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to eglibc in Ubuntu.
https://bugs.launchpad.net/bugs/958305

Title:
  nscd crashed with SIGSEGV in _nss_files_init()

Status in “eglibc” package in Ubuntu:
  Invalid
Status in “unscd” package in Ubuntu:
  Fix Released

Bug description:
  Clean x86-64 install of precise as of 2012-03-17; unscd is hit with
  SEGV whenever it starts, ie 100% reproducability.

  ProblemType: Crash
  DistroRelease: Ubuntu 12.04
  Package: unscd 0.47-2build2
  ProcVersionSignature: Ubuntu 3.2.0-19.30-generic 3.2.11
  Uname: Linux 3.2.0-19-generic x86_64
  ApportVersion: 1.94.1-0ubuntu2
  Architecture: amd64
  Date: Sun Mar 18 11:18:59 2012
  Disassembly: => 0x1:	Cannot access memory at address 0x1
  ExecutablePath: /usr/sbin/nscd
  InstallationMedia: Ubuntu 12.04 LTS "Precise Pangolin" - Alpha amd64 (20120316)
  ProcCmdline: /usr/sbin/nscd
  ProcEnviron:
   LANGUAGE=en_SG:en
   TERM=linux
   LANG=en_SG.UTF-8
   SHELL=/bin/bash
  SegvAnalysis:
   Segfault happened at: 0x1:	Cannot access memory at address 0x1
   PC (0x00000001) not located in a known VMA region (needed executable region)!
  SegvReason: executing NULL VMA
  Signal: 11
  SourcePackage: unscd
  StacktraceTop:
   ?? ()
   _nss_files_init (cb=0x1) at nss_files/files-init.c:47
   nss_load_library (ni=<optimized out>) at nsswitch.c:412
   nss_load_all_libraries (def=0x7f03dd560b74 "dns [!UNAVAIL=return] files", service=0x7f03dd560b90 "hosts") at nsswitch.c:875
   __nss_disable_nscd (cb=<optimized out>) at nsswitch.c:895
  Title: nscd crashed with SIGSEGV in _nss_files_init()
  UpgradeStatus: No upgrade log present (probably fresh install)
  UserGroups:

  unscd 0.48 fixes just this issue (see patch delta below) and is already released in Quantal, so is a candidate fix for this issue in Precise:
  http://archive.ubuntu.com/ubuntu/pool/universe/u/unscd/

  http://archive.ubuntu.com/ubuntu/pool/universe/u/unscd/unscd_0.48-2_amd64.deb
  http://archive.ubuntu.com/ubuntu/pool/universe/u/unscd/unscd_0.48-2_i386.deb

  I have verified this here and it addresses the issue. SRU justification:
  [Impact] unscd-0.47 crashes each time it is started, thus is useless and obtrusive
  [Test Case] start unscd-0.47: sudo /etc/init.d/unscd start
  [Regression Potential] None due to existing crasher

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/eglibc/+bug/958305/+subscriptions




More information about the foundations-bugs mailing list