From owner-freebsd-stable@FreeBSD.ORG Tue May 31 17:40:03 2005 Return-Path: X-Original-To: freebsd-stable@freebsd.org Delivered-To: freebsd-stable@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 26D4116A41C; Tue, 31 May 2005 17:40:03 +0000 (GMT) (envelope-from avg@icyb.net.ua) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0087343D1F; Tue, 31 May 2005 17:40:00 +0000 (GMT) (envelope-from avg@icyb.net.ua) Received: from [212.40.38.87] (oddity-e.topspin.kiev.ua [212.40.38.87]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id UAA13164; Tue, 31 May 2005 20:39:47 +0300 (EEST) (envelope-from avg@icyb.net.ua) Message-ID: <429CA163.70608@icyb.net.ua> Date: Tue, 31 May 2005 20:39:47 +0300 From: Andriy Gapon User-Agent: Mozilla Thunderbird 1.0.2 (X11/20050328) X-Accept-Language: en-us, en MIME-Version: 1.0 To: freebsd-stable@freebsd.org Content-Type: text/plain; charset=KOI8-U Content-Transfer-Encoding: 7bit Cc: torfinn.ingolfsen@broadpark.no, freebsd-ports@freebsd.org Subject: xffm - xfsamba4 broken in 5-stable? X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 May 2005 17:40:03 -0000 I've had the same problem and I think everybody using recent FreeBSD has it. The culprit seems to be the following line in tubo.c: if (kill(PID,SIGCONT) == 0) return TRUE; I am not sure about other OS's and what POSIX mandates in this case, but FreeBSD 5.4 allows to send signals to child processes that have exited but have not been reaped by parent. They show up in ps like this: 5320 pd Z+ 0:00,05 Because of the quoted line of code nmblookup processes are never reaped and xfsamba4 goes into infinite loop. Probably FreeBSD 5.1 had problems with respect to the described situation (it was an experimental release after all) and that line was a work-around for some FreeBSD bug, but now it actually breaks things. Removing that line fixed xfsamba4 for me, but I encountered another problem after that, my PDC (NT4) doesn't respond to the following request (Samba3 client): nmblookup -A so instead I had to use nmblookup -M -S -- - and this made xfsamba4 perfectly well. P.S. just found the following about POSIX, kill, and defunct child processes: http://www.opengroup.org/onlinepubs/009695399/functions/kill.html Existing implementations vary on the result of a kill() with pid indicating an inactive process (a terminated process that has not been waited for by its parent). Some indicate success on such a call (subject to permission checking), while others give an error of [ESRCH]. Since the definition of process lifetime in this volume of IEEE Std 1003.1-2001 covers inactive processes, the [ESRCH] error as described is inappropriate in this case. In particular, this means that an application cannot have a parent process check for termination of a particular child with kill(). (Usually this is done with the null signal; this can be done reliably with waitpid().) -- Andriy Gapon