tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: netbsd-5 + wip/pdnsd + pthread = hang up



> On Sun, Mar 15, 2009 at 06:02:33PM +0200, Aleksey Cheusov wrote:

 >> Afer upgrading from netbsd-4 to netbsd-5 I've seen one significant
 >> regression. This is wip/pdnsd, pthread-based dns cache daemon, it
 >> doesn't work anymore.
 >> 
 >> That is it hangs up when it receives SIGTERM. '/etc/rc.d/pdnsd restart'
 >> doesn't work anymore.  pdnsd daemon hangs up somewhere in close(2).
 >> 
 >> Can anybody familiar with pthread programming check whether it is a
 >> problem in pdnsd or in netbsd-5's implementation of pthreads?
 >> 
 >> I'm running a few days old netbsd-5 branch system.

> Please ktrace it and provide kdump output. If it is hanging in close,
> please find out what the descriptor is, and if any other threads are
> making long-running system calls referencing that descriptor. One thing
> we do not have is code to force other threads out of the kernel when
> you close() a descriptor they are using.

I attached truss to running pdnsd, then send SIGTERM to it.  ktruss
shows the following, then pdnsd hangs.  If this information is not
exactly what you need I think you can easily reproduce the problem.
Trivial pdnsd config is below.

 15403      1 pdnsd    __sigtimedwait              = 0
 15403      1 pdnsd    open("/var/pdnsd/pdnsd.cache", 0x601, 0x1b6) = 8
 15403      1 pdnsd    __fstat30(0x8, 0xbfbfea48)  = 0
 15403      1 pdnsd    write(0x8, 0xbb82d000, 0x2000) = 8192
       
"pd12\M^?\n\0\0\0\^A\0\0mL\M-KH\0\0\0\0\M^?\M^?\^F\^A\M^R\^_\0\0\^E\M-{\M-*I0\0@"
 15403      1 pdnsd    write(0x8, 0xbb82d000, 0x2000) = 8192
       
"\^Fakamai\^Ccom\0I\M-*\^?1\0\^A_\M^P\0\^A_\M^P\0\^A_\M^P\0\0\0\M-4\^N\^A\0\0"
 15403      1 pdnsd    write(0x8, 0xbb82d000, 0x2000) = 8192
       "hell\^Corg\^A\^A\M-@\M-(\0\0X\M-*"
 15403      1 pdnsd    write(0x8, 0xbb82d000, 0x2000) = 8192
       "\M-)I 
\0\^D\0\M-@^I\^E\^W\^A\0\0\M-S\^S\^^I\0\0\0\0\M^?\M^?\^Dns2c\rjohncompani"
 15403      1 pdnsd    write(0x8, 0xbb82d000, 0x2000) = 8192
       "E\^A\^\\^A\M^YI\^A\0\M-"\M-#\M-*I0\0\^P\0 
\^A\^E\^BF\^R\0\0\0\0\0\0\0\0\0\^A\^T"
 15403      1 pdnsd    write(0x8, 0xbb82d000, 0x2000) = 8192
       "\0\M^?\M^?\^Cns3\^Bw3\^Corg\^A\^A"
 15403      1 pdnsd    write(0x8, 0xbb82d000, 0x2000) = 8192
       
"\M-\j\0\0\M->Q\^SI0\0\^D\0\M-A3\M-PB\^P\^A\0\0\M-)\v\^RI\0\0\0\0\^B\^B\^Cwww\bo"
 15403      1 pdnsd    write(0x8, 0xbb82d000, 0x2000) = 8192
       
"\0\t:\M^@\0\^B\M-#\0\^R\^A\0\0>G\^_I\0\0\0\0\^C\M^?\^Da957\^Ag\^Fakamai\^Cnet"
 15403      1 pdnsd    write(0x8, 0xbb82d000, 0x2000) = 8192
       "\M-UH \0\^D\0\M^^&\M^X?\^X\^A\0\0tG"
 15403      1 pdnsd    write(0x8, 0xbb82d000, 0x2000) = 8192
       
"\M-gH\0\0\0\0\M^?\M^?\afabrice\abellard\^Dfree\^Bfr\^E\^A\^P\^N\0\0\M-a\240-I "
 15403      1 pdnsd    write(0x8, 0xbb82d000, 0x2000) = 8192
       
"*0\0\0\^N\^P\0'\M^M\0\0\^AQ\M^@\^P\^A\0\0\^B\M^[)I\0\0\0\0\M^?\M^?\^Cns0\^Edemo"
 15403      1 pdnsd    write(0x8, 0xbb82d000, 0x2000) = 8192
       "\^RI \0\^D\0\M-C\M-!w\M-B\^D\0\M-C\M-!w\M-A"
 15403      1 pdnsd    write(0x8, 0xbb82d000, 0x2000) = 8192
       "\f\^C\0\0\M-g\240-I\0\0\0\0\^B\^B\abellard\^Corg\^A\^A0*\0\0\M-g\240-I 
\0\^D\0X"
 15403      1 pdnsd    write(0x8, 0xbb82d000, 0x2000) = 8192
       "\M-r\M-i\0\08@\0\0\^\ \0\^N\M^@\M^@\0\0\^\ 
\^Q\^A\0\0\^?\^E\M-zH\0\0\0\0\M^?"
 15403      1 pdnsd    write(0x8, 0xbb82d000, 0x2000) = 8192
       "\^Cns2\asurfnet\^Bnl\0"
 15403      1 pdnsd    write(0x8, 0xbb82d000, 0x2000) = 8192
       
"\^R\0\^Bns\thyperreal\^Corg\0\^F\^A\b\a\0\0y\^]\M-\H0\0:\0\^Bns\thyperreal\^Cor"
 15403      1 pdnsd    write(0x8, 0xbb82d000, 0x2000) = 8192
       
"I0\0\^S\0\^Cns1\twordpress\^Ccom\0\^S\0\^Cns2\twordpress\^Ccom\0\^S\0\^Cns3\two"
 15403      1 pdnsd    write(0x8, 0xbb82d000, 0x2000) = 8192
       "\M-_\M-|H\0\0\0\0\M^?\M^?\^Dkona\ak"
 15403      1 pdnsd    write(0x8, 0xbb82d000, 0x2000) = 8192
       "ontera\^Ccom\tedgesuite\^Cnet\^E\^A\M^W\^N\0\0\M-2\M-B\M^_I 
\0\^S\0\^Da302\^Ag"
 15403      1 pdnsd    write(0x8, 0xbb82d000, 0x2000) = 8192
       
"ernal\^Bru\^A\^A\M-<!\0\0\M^X\M-=\M-TH0\0\^D\0\M-Ao\\\^^\^U\^A\0\0\M^HO\M-zH\0"
 15403      1 pdnsd    write(0x8, 0xbb82d000, 0x2000) = 8192
       "al\^Bru\^A\^A\M^X*\0\0\M^X\M-=\M-TH0"
 15403      1 pdnsd    write(0x8, 0xbb82d000, 0x2000) = 8192
       
"\0\^D\0\M-Ao\\\^N\^S\^A\0\0:\M^Q\M^HI\0\0\0\0\M^?\M^?\^Bda\vgentoo-wiki\^Ccom"
 15403      1 pdnsd    write(0x8, 0xbb82d000, 0x2000) = 8192
       
"jaard\^Dname\0\f\^A\0\09\M-w\M-KH\0\0\0\0\M^?\M^?\^Cwww\^Cgnu\^Corg\^E\^A~\0\0"
 15403      1 pdnsd    write(0x8, 0xbb82d000, 0x2000) = 8192
       "eoycs-l\^Cgy1\^Ab\^Eya"
 15403      1 pdnsd    write(0x8, 0xbb82d000, 0x2000) = 8192
       
"hoo\^Ccom\0\^S\^A\0\0\M-Q~\M-wH\0\0\0\0\^B\^B\^Dpigu\^Bjp\^Fnetbsd\^Corg\^A\^A"
 15403      1 pdnsd    write(0x8, 0xbb82d000, 0x2000) = 8192
       "!q\M-{H\0\0\0\0\M^?\M^?\^Fportal\^Eopera\^Ccom\^E\^A\M-_\v\0\0!q\M-{H 
\0\^Q\0"
 15403      1 pdnsd    write(0x8, 0xbb82d000, 0x2000) = 8192
       "\M^?\aremote2\aeasydn"
 15403      1 pdnsd    write(0x8, 0xbb82d000, 0x173c) = 5948
       
"s\^Ccom\^A\^A\^Q\^Z\0\0\M-nr\M-)I0\0\^D\0\M-Q\M-H\M^C\^F\^V\^A\0\0\^FT\M-QH\0\0"
 15403      1 pdnsd    close(0x8)                  = 0
       
"R\M-Q\M-p\M-q\^R\^A\0\0\M^M\M^R\^UI\0\0\0\0\M^?\M^?\^Fns-921\^Famazon\^Ccom\^A"
 15403      1 pdnsd    gettimeofday(0xbfbfdf68, 0) = 0
       "com\0\0\0\0\^A\0\^AQ\M^@\0\0\^C\M^D"
 15403      1 pdnsd    getpid()                    = 15403, 1
       
"\0\0\a\b\0\0\0\^^\n\^B\0\0\^\\M-k\M-tH\0\0\0\0\M^?\M^?\^Cwww\^Bbn\^Bby\^E\^A\^X"
 15403      1 pdnsd    __socket30(0x1, 0x2, 0)     = 8
       
"ns\^Cnet\^A\^A\240\^C\^B\0)\M-[\M-*I0\0\^D\0@"\M-{\M^\\^N\^A\0\0\bn\rI\0\0\0\0"
 15403      1 pdnsd    fcntl(0x8, 0x2, 0x1)        = 0
       "\M^?\^Fbanner\nhosteur"
 15403      1 pdnsd    connect(0x8, 0xbbbc2fc0, 0x6a) = 0
       "ope\^Bde\^A\^A\^P\^N\0\0\M^]t\M-)I 
\0\^D\0P\M-m\M^@\M-(\f\^B\0\0At\M-GH\0\0\0\0"
 15403      1 pdnsd    sendto(0x8, 0xbfbfe018, 0x3c, 0, 0, 0) = 60
       
"\0V9\M-~t\^O\^A\0\0\M-E\^D\M-GH\0\0\0\0\M^?\M^?\^Cns4\arambler\^Bru\^A\^A\M^I\a"
 15403      1 pdnsd    close(0x8)                  = 0
       "dburner\^Ccom\^B\^D\nA\0"

/usr/pkg/etc/pdnsd.conf:
  global {
        run_as     = "pdnsd";
        server_ip  = 127.0.0.1;

        status_ctl = on;
  }

  server {
        label      = "dialup";
        file       = "/etc/ppp/resolv.conf";
        proxy_only = on;
  }

-- 
Best regards, Aleksey Cheusov.


Home | Main Index | Thread Index | Old Index