Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 13 May 2011 19:17:54 GMT
From:      Aragon Gouveia <aragon@phat.za.net>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   misc/157013: Bizarre file descriptor race condition
Message-ID:  <201105131917.p4DJHsWV027213@red.freebsd.org>
Resent-Message-ID: <201105131920.p4DJKALe038231@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>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:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201105131917.p4DJHsWV027213>