From owner-freebsd-bugs@FreeBSD.ORG Fri May 13 19:20:10 2011 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9BA12106566B for ; Fri, 13 May 2011 19:20:10 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 60EE28FC0C for ; Fri, 13 May 2011 19:20:10 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id p4DJKAJi038232 for ; Fri, 13 May 2011 19:20:10 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id p4DJKALe038231; Fri, 13 May 2011 19:20:10 GMT (envelope-from gnats) Resent-Date: Fri, 13 May 2011 19:20:10 GMT Resent-Message-Id: <201105131920.p4DJKALe038231@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Aragon Gouveia Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AACBB1065670 for ; Fri, 13 May 2011 19:17:54 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22]) by mx1.freebsd.org (Postfix) with ESMTP id 9C5B08FC0C for ; Fri, 13 May 2011 19:17:54 +0000 (UTC) Received: from red.freebsd.org (localhost [127.0.0.1]) by red.freebsd.org (8.14.4/8.14.4) with ESMTP id p4DJHsBf027214 for ; Fri, 13 May 2011 19:17:54 GMT (envelope-from nobody@red.freebsd.org) Received: (from nobody@localhost) by red.freebsd.org (8.14.4/8.14.4/Submit) id p4DJHsWV027213; Fri, 13 May 2011 19:17:54 GMT (envelope-from nobody) Message-Id: <201105131917.p4DJHsWV027213@red.freebsd.org> Date: Fri, 13 May 2011 19:17:54 GMT From: Aragon Gouveia To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: misc/157013: Bizarre file descriptor race condition X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 May 2011 19:20:10 -0000 >Number: 157013 >Category: misc >Synopsis: Bizarre file descriptor race condition >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Fri May 13 19:20:10 UTC 2011 >Closed-Date: >Last-Modified: >Originator: Aragon Gouveia >Release: 8.2-STABLE >Organization: >Environment: FreeBSD igor.geek.sh 8.2-STABLE FreeBSD 8.2-STABLE #2: Thu May 5 14:52:46 SAST 2011 toor@igor.geek.sh:/usr/obj/usr/src-RELENG_8/sys/IGOR amd64 >Description: Please see the script pasted in the repeat field. When it is run, the while loop exits after the first iteration. However, if the ssh command is commented, the loop executes two iterations. Stranger still, on some of my FreeBSD systems the script works correctly _sometimes_, but mostly not. >How-To-Repeat: #!/bin/sh DFRTMP=$(mktemp -d /tmp/dfr.XXXXXX) [ $? -eq 0 ] || exit 1 cat >${DFRTMP}/hosts <<"_EOF" 1 saturn.geek.sh 2 null _EOF while read hostid hostname; do echo ${hostid}:${hostname} ssh ${hostname} 'df -k' done <${DFRTMP}/hosts rm -rf ${DFRTMP} >Fix: >Release-Note: >Audit-Trail: >Unformatted: