This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug server/13334] New: stap server list nssInit() never finishes


http://sourceware.org/bugzilla/show_bug.cgi?id=13334

             Bug #: 13334
           Summary: stap server list nssInit() never finishes
           Product: systemtap
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: server
        AssignedTo: systemtap@sourceware.org
        ReportedBy: mjw@redhat.com
    Classification: Unclassified


Running client.exp on rawhide it never finishes.
It seems a server list never succeeds:

 1959 pts/1    S+     0:00  |                       \_ make check-DEJAGNU
RUNTESTFLAGS= --tool_opts \'install \'
 1960 pts/1    S+     0:00  |                           \_ /bin/sh -c
srcdir=`CDPATH="${ZSH_VERSION+.}:" && cd /home/mark/src/systemtap/testsuite &&
pwd`; export srcdir; \ EXPECT=expect; export EXP
 1996 pts/1    S+     0:00  |                               \_ /bin/sh
/home/mark/src/systemtap/testsuite/execrc runtest --tool systemtap --tool_opts
'' --srcdir /home/mark/src/systemtap/testsuite
 1997 pts/1    S+     0:15  |                                   \_ expect --
/usr/share/dejagnu/runtest.exp --tool systemtap --tool_opts  --srcdir
/home/mark/src/systemtap/testsuite --tool_opts ins
 7369 ?        Zs     0:00  |                                       \_
[eu-readelf] <defunct>
17955 ?        Zs     0:00  |                                       \_
[eu-readelf] <defunct>
18572 ?        Zs     0:00  |                                       \_
[eu-readelf] <defunct>
31854 ?        Zs     0:00  |                                       \_
[staprun] <defunct>
23225 ?        Zs     0:00  |                                       \_ [stap]
<defunct>
13825 ?        Zs     0:00  |                                       \_ [stap]
<defunct>
13829 ?        Zs     0:00  |                                       \_ [stap]
<defunct>
13833 ?        Zs     0:00  |                                       \_ [stap]
<defunct>
13837 ?        Zs     0:00  |                                       \_ [stap]
<defunct>
13848 pts/1    S+     0:00  |                                       \_ stap
--list-servers=online,trusted,compatible

Looking with gdb where this process is stuck gives:

(gdb) thread apply all bt

Thread 1 (Thread 0x7fdb78727800 (LWP 13848)):
#0  pthread_cond_wait@@GLIBC_2.3.2 ()
    at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:165
#1  0x0000003656823380 in PR_WaitCondVar (cvar=0xd461b0, timeout=4294967295)
    at ../../../mozilla/nsprpub/pr/src/pthreads/ptsynch.c:417
#2  0x0000003657c1a6ad in nss_Init (
    configdir=0xd48d78 "/usr/local/install/systemtap/etc/systemtap/staprun", 
    certPrefix=0x3657cfa597 "", keyPrefix=0x3657cfa597 "", 
    secmodName=0x3657cfa083 "secmod.db", updateDir=0x3657cfa597 "", 
    updCertPrefix=0x3657cfa597 "", updKeyPrefix=0x3657cfa597 "", 
    updateID=0x3657cfa597 "", updateName=0x3657cfa597 "", initContextPtr=0x0, 
    initParams=0x0, readOnly=1, noCertDB=0, noModDB=0, forceOpen=0, 
    noRootInit=0, optimizeSpace=1, noSingleThreadedModules=0, 
    allowAlreadyInitializedModules=0, dontFinalizeModules=0) at nssinit.c:594
#3  0x0000003657c1b6e8 in NSS_Init (configdir=<optimized out>) at nssinit.c:771
#4  0x0000000000561ba5 in nssInit (
    db_path=0xd48d78 "/usr/local/install/systemtap/etc/systemtap/staprun", 
    readWrite=<optimized out>, issueMessage=1)
    at /home/mark/src/systemtap/nsscommon.cxx:169
#5  0x0000000000549dc4 in get_server_info_from_db (s=..., 
    servers=std::vector of length 1, capacity 1 = {...}, cert_db_path=
    "/usr/local/install/systemtap/etc/systemtap/staprun")
    at /home/mark/src/systemtap/csclient.cxx:1929
#6  0x000000000054ab19 in get_or_keep_signing_server_info (s=..., 
    servers=std::vector of length 0, capacity 0, keep=false)
    at /home/mark/src/systemtap/csclient.cxx:2640
#7  0x000000000054df73 in query_server_status (status_string=<optimized out>, 
    s=...) at /home/mark/src/systemtap/csclient.cxx:2170
#8  query_server_status (s=...) at /home/mark/src/systemtap/csclient.cxx:2140
#9  0x000000000040d484 in main (argc=<optimized out>, argv=<optimized out>)
    at /home/mark/src/systemtap/main.cxx:996

The nssInit() call in stap is:

extern "C"
SECStatus
nssInit (const char *db_path, int readWrite, int issueMessage)
{
  SECStatus secStatus;
  if (readWrite)
    secStatus = NSS_InitReadWrite (db_path);
  else
=>  secStatus = NSS_Init (db_path);
  if (secStatus != SECSuccess && issueMessage)
    {
      nsscommon_error (_F("Error initializing NSS for %s", db_path));
      nssError ();
    }
  return secStatus;
}


Where the nss NSS_Init() part is:

    /*
     * if we haven't done basic initialization, single thread the 
     * initializations.
     */
    PZ_Lock(nssInitLock);
    isReallyInitted = NSS_IsInitialized();
    if (!isReallyInitted) {
        while (!isReallyInitted && nssIsInInit) {
=>          PZ_WaitCondVar(nssInitCondition,PR_INTERVAL_NO_TIMEOUT);
            isReallyInitted = NSS_IsInitialized();
        }
        /* once we've completed basic initialization, we can allow more than 
         * one process initialize NSS at a time. */
    }
    /* get the current value */
    nssIsInInit++;
    PZ_Unlock(nssInitLock);

This is strange, since there is only one thread running.
So maybe this is a bug in nssInit()?

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]