In the last episode (Sep 08), Martin Nilsson (Opera Mini - AFK!) @ Pike (-) 
developers forum said:
> Someone knows anything about this problem on a solaris machine?
> 
> Wait thread: waitpid returned error: 0
> 
> The output is from signal_handler.c, and there is an issue reported
> on FreeBSD for this.
> http://community.roxen.com/crunch/show_bug.cgi?id=3917

I haven't seen the error on FreeBSD in ages.  If you're running Solaris
10, try running the attached dtrace script in the background and see if
it ever prints anything.  It will trace any wait* syscall that ends up
failing with an errno other than ECHILD (which is the only errno I ever
see)

-- 
        Dan Nelson
        [EMAIL PROTECTED]
#! /usr/sbin/dtrace -CFs

/* allow 32 simultaneous speculations; raise if you have more CPUs */
#pragma D option nspec=32

#include <sys/wait.h>
#include <sys/errno.h>

/* Entering the wait syscall: enable speculation, then print arguments
   and user stack */
syscall::waitsys:entry 
{
	idtype = 
		(arg0 == P_PID ? "P_PID" :
		(arg0 == P_PGID ? "P_PGID" :
		(arg0 == P_ALL ? "P_ALL" : (string)arg0
		)));
	options = 
		strjoin(arg3 & WCONTINUED ? "WCONTINUED|" : "",
		strjoin(arg3 & WEXITED ? "WEXITED|" : "",
		strjoin(arg3 & WNOHANG ? "WNOHANG|" : "",
		strjoin(arg3 & WNOWAIT ? "WNOWAIT|" : "",
		strjoin(arg3 & WSTOPPED ? "WSTOPPED|" : "",
		arg3 & WTRAPPED ? "WTRAPPED|" : ""
		)))));
	self->spec = speculation();
	speculate(self->spec);
	printf("%s[%d] wait(%s, %d, %p, %s)", execname, pid, idtype, arg1, arg2, options);
	ustack();
}

/* If speculation has been started on this thread, log all kernel function
   calls and returns */
fbt:::
/ self->spec /
{
	/* A speculate() with no other actions speculates the default
	 action: tracing the EPID.  */
	speculate(self->spec);
}

/* log return code and errno just before returning to userland */
syscall::waitsys:return 
/ self->spec /
{
	speculate(self->spec);
	printf("rv=%d, errno=%d", arg0, errno);
}

/* If the syscall fails with an error other than ECHILD, commit the
   speculation buffer */
syscall::waitsys:return 
/ self->spec && (arg0 == -1 && errno != ECHILD) /
{ 
	commit(self->spec);
	self->spec = 0;
}

/* If we're still speculating, we weren't interested in the syscall so
   discard the speculation buffer. */
syscall::waitsys:return
/ self->spec /
{
	discard(self->spec);
	self->spec = 0;
}
  • errno 0 Martin Nilsson (Opera Mini - AFK!) @ Pike (-) developers forum
    • Re: er... Dan Nelson

Reply via email to