Boot hangs starting postfix

YONETANI Tomokazu qhwt+dragonfly-bugs at les.ath.cx
Fri Jun 11 02:44:13 PDT 2004


On Fri, Jun 11, 2004 at 09:20:08AM +0200, Joerg Sonnenberger wrote:
> On Fri, Jun 11, 2004 at 01:22:14PM +0900, YONETANI Tomokazu wrote:
> > DDB> ps
> > 			:
> > cpu 0 tdrunqmask 10000440 curthread 0xc0389f24 reqflags 0032
> >      INCOMMING IPIQS:
> > tdq      thread  pid  pri(act)         sp  wmesg comm
> >   6  0xca85bce0 7104    70( 6) 0xcf8dfbc8 select local
> >  10  0xca85c4c0 7108    42(10) 0xcfadc9e4      - bounce
> >    TOKENS: 0xcfadcb64[tok=0xc038e580,held]
> >  10  0xca85c760 7105   106(10) 0xcfad2a64  lockf bounce
> >    TOKENS: 0xcfadcb64[tok=0xc038e580,held]
> 
> Is this token hold by any other thread?

Should I look for lines containing "TOKENS" from ps command?
No, there's always two processes holding the same token.

> >  28  0xc0389f24   -1    92(28) 0xcddd5d28      - ithread 1
> > 			:
> > 
> > tsleep(c15e1ee0,100,c0305da9,0,ffffffff) at tsleep+0x1d3
> 
> Can you try to lookup (tsleep+0x1d3) ? E.g. viar
> 	nm kernel.debug | grep tsleep
> adding 0x1d3 and using addr2line.

Sure.

$ nm /kernel | grep -e ' tsleep' -e ' lf_setlock'
c01ef648 t lf_setlock
c01fc751 T tsleep
$ printf 'print/x 0xc01ef648+0x194\nprint/x 0xc01fc751+0x1d3\n' |gdb -q
(gdb) $1 = 0xc01ef7dc
(gdb) $2 = 0xc01fc924
$ addr2line -e kernel.debug 0xc01ef7dc 0xc01fc924
/home/source/dragonfly/src/sys/kern/kern_lockf.c:317
/home/source/dragonfly/src/sys/kern/kern_synch.c:403

(lf_setlock+0x194)
$ cat -n /sys/kern/kern_lockf.c | sed -n '307,327p'

   307			error = tsleep(brange, PCATCH, "lockf", 0);
   308	
   309			/*
   310			 * We may have been awaked by a signal and/or by a
   311			 * debugger continuing us (in which case we must remove
   312			 * ourselves from the blocked list) and/or by another
   313			 * process releasing/downgrading a lock (in which case
   314			 * we have already been removed from the blocked list
   315			 * and our lf_flags field is 1).
   316			 */
*  317			if (brange->lf_flags == 0)
   318				TAILQ_REMOVE(&lock->lf_blocked, brange, lf_link);
   319			lf_destroy_range(brange, 0);
   320	
   321			if (error)
   322				goto do_cleanup;
   323			goto restart;
   324		}
   325	
   326		if (first_match == NULL) {
   327			if (flags & F_POSIX) {

(tsleep+0x1d3)
$ cat -n /sys/kern/kern_synch.c | sed -n -e '403s/^./*/' -e '393,413p'
   393			 */
   394			KASSERT(p->p_stat == SRUN, ("PSTAT NOT SRUN %d %d", p->p_pid, p->p_stat));
   395			/*
   396			 * If this is the current 'user' process schedule another one.
   397			 */
   398			clrrunnable(p, SSLEEP);
   399			p->p_stats->p_ru.ru_nvcsw++;
   400			mi_switch(p);
   401			KASSERT(p->p_stat == SRUN, ("tsleep: stat not srun"));
   402		} else {
*  403			lwkt_switch();
   404		}
   405	resume:
   406		if (p)
   407			p->p_flag &= ~P_SINTR;
   408		crit_exit_quick(td);
   409		td->td_flags &= ~TDF_NORESCHED;
   410		if (td->td_flags & TDF_TIMEOUT) {
   411			td->td_flags &= ~TDF_TIMEOUT;
   412			if (sig == 0)
   413				return (EWOULDBLOCK);





More information about the Bugs mailing list