NetBSD Problem Report #48952

From www@NetBSD.org  Wed Jun 25 20:41:02 2014
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [149.20.53.66])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "mail.netbsd.org", Issuer "Postmaster NetBSD.org" (verified OK))
	by mollari.NetBSD.org (Postfix) with ESMTPS id BE02FA650D
	for <gnats-bugs@gnats.NetBSD.org>; Wed, 25 Jun 2014 20:41:02 +0000 (UTC)
Message-Id: <20140625204101.55BA7A6547@mollari.NetBSD.org>
Date: Wed, 25 Jun 2014 20:41:01 +0000 (UTC)
From: yaneurabeya@gmail.com
Reply-To: yaneurabeya@gmail.com
To: gnats-bugs@NetBSD.org
Subject: Race in t_stat:stat_socket: test expects EINPROGRESS; got ECONNREFUSED once
X-Send-Pr-Version: www-1.0

>Number:         48952
>Category:       bin
>Synopsis:       Race in t_stat:stat_socket: test expects EINPROGRESS; got ECONNREFUSED once
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Jun 25 20:45:00 +0000 2014
>Originator:     Garrett Cooper
>Release:        n/a
>Organization:
EMC / Isilon Storage Division
>Environment:
FreeBSD freebsd-11-x64.localdomain 11.0-CURRENT FreeBSD 11.0-CURRENT #2 r267801+8b3cf1c(more-tools-regression-integration): Tue Jun 24 21:17:31 PDT 2014     root@freebsd-11-x64.localdomain:/usr/obj/usr/src/sys/GENERIC-DEBUG  amd64
>Description:
The code in src/tests/lib/libc/sys/t_stat tries to connect to 127.0.0.1:42 (dns), and is effectively racing against other errors like ECONNREFUSED, etc, depending on whether or not there's a DNS server running on the host, the load on the system, etc.

Using a Unix domain socket might be better.

# kyua report --action 95 | grep stat_socket
lib/libc/sys/t_stat:stat_socket  ->  failed: /usr/src/lib/libc/tests/sys/t_stat.c:354: Expected errno 36, got 61, in connect(fd, (struct sockaddr *)&addr, sizeof(struct sockaddr_in)) == -1  [0.008s]
# netstat -a
Active Internet connections (including servers)
Proto Recv-Q Send-Q Local Address          Foreign Address        (state)
tcp4       0      0 freebsd-11-x64.w.ssh   wkstn-gcooper.we.49990 ESTABLISHED
tcp4       0      0 xxxxplonamv1c.co.979   192.168.137.129.nfsd   CLOSED
tcp4       0      0 localhost.smtp         *.*                    LISTEN
tcp4       0      0 *.ssh                  *.*                    LISTEN
tcp6       0      0 *.ssh                  *.*                    LISTEN
udp4       0      0 localhost.ntp          *.*
udp6       0      0 fe80::1%lo0.ntp        *.*
udp6       0      0 localhost.ntp          *.*
udp4       0      0 xxxxplonamv1c.co.ntp   *.*
udp4       0      0 freebsd-11-x64.w.ntp   *.*
udp6       0      0 *.ntp                  *.*
udp4       0      0 *.ntp                  *.*
udp4       0      0 *.syslog               *.*
udp6       0      0 *.syslog               *.*
Active UNIX domain sockets
Address  Type   Recv-Q Send-Q    Inode     Conn     Refs  Nextref Addr
fffff800038943c0 stream      0      0        0 fffff800038a3d20        0        0
fffff800038a3d20 stream      0      0        0 fffff800038943c0        0        0
fffff80003894690 stream      0      0 fffff80003868000        0        0        0 /var/run/casper
fffff800038e4780 stream      0      0        0 fffff800038e4870        0        0
fffff800038e4870 stream      0      0        0 fffff800038e4780        0        0
fffff800038e4b40 stream      0      0 fffff800038631d8        0        0        0 /var/run/devd.pipe
fffff800038e42d0 dgram       0      0        0 fffff80003894780        0 fffff800038e43c0
fffff800038e43c0 dgram       0      0        0 fffff80003894780        0 fffff800038e44b0
fffff800038e44b0 dgram       0      0        0 fffff80003894780        0 fffff800038e45a0
fffff800038e45a0 dgram       0      0        0 fffff80003894780        0 fffff800038945a0
fffff800038944b0 dgram       0      0        0 fffff80003894870        0        0
fffff800038945a0 dgram       0      0        0 fffff80003894780        0 fffff800038e4690
fffff800038e4690 dgram       0      0        0 fffff80003894780        0 fffff800038e4960
fffff800038e4960 dgram       0      0        0 fffff80003894780        0        0
fffff80003894780 dgram       0      0 fffff80003bebb10        0 fffff800038e42d0        0 /var/run/logpriv
fffff80003894870 dgram       0      0 fffff80003bebce8        0 fffff800038944b0        0 /var/run/log
>How-To-Repeat:

>Fix:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.