public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "ubizjak at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug go/59506] net FAILs (timeout) on alpha
Date: Thu, 19 Dec 2013 19:09:00 -0000	[thread overview]
Message-ID: <bug-59506-4-fOGK1gXTbL@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-59506-4@http.gcc.gnu.org/bugzilla/>

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="UTF-8", Size: 3996 bytes --]

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59506

--- Comment #2 from Uroš Bizjak <ubizjak at gmail dot com> ---
This is the TestSelfConnect testcase (from net/dial_test.go) problem:

--cut here--
    // Try to connect to that address repeatedly.
    n := 100000
    if testing.Short() {
        n = 1000
    }
    switch runtime.GOOS {
    case "darwin", "dragonfly", "freebsd", "netbsd", "openbsd", "plan9",
"solaris", "windows":
        // Non-Linux systems take a long time to figure
        // out that there is nothing listening on localhost.
        n = 100
    }
    for i := 0; i < n; i++ {
        c, err := Dial("tcp", addr)
        if err == nil {
            c.Close()
            t.Errorf("#%d: Dial %q succeeded", i, addr)
        }
    }
--cut here--

The Dial takes approx a second to timeout on alpha (kernel 3.12.2, glibc 2.15),
so the test with 100000 connections timeouts. Changing the number of
repetitions to 100 "fixes" the test, while trying with 1000 still timeouts.

However, I would like to propose following patch to change Dial to DialTimeout
with a millisecond deterministic timeout:

--cut here--
Index: go/net/dial_test.go
===================================================================
--- go/net/dial_test.go (revision 206123)
+++ go/net/dial_test.go (working copy)
@@ -147,7 +147,7 @@
                n = 100
        }
        for i := 0; i < n; i++ {
-               c, err := Dial("tcp", addr)
+               c, err := DialTimeout("tcp", addr, time.Millisecond)
                if err == nil {
                        c.Close()
                        t.Errorf("#%d: Dial %q succeeded", i, addr)
--cut here--

Patched test succeeds without problems (and would probably succeed for other
special-cased OSes too), while I believe it still correctly tests for
selfconnect misfeature [1],[2].

[1] http://golang.org/issue/2690
[2] http://stackoverflow.com/questions/4949858/
>From gcc-bugs-return-438230-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Thu Dec 19 19:43:37 2013
Return-Path: <gcc-bugs-return-438230-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 9620 invoked by alias); 19 Dec 2013 19:43:36 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 9601 invoked by uid 48); 19 Dec 2013 19:43:33 -0000
From: "egor_suvorov at mail dot ru" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c/59564] False positive array -Warray-bounds check with -O2
Date: Thu, 19 Dec 2013 19:43:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: c
X-Bugzilla-Version: unknown
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: egor_suvorov at mail dot ru
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: attachments.created
Message-ID: <bug-59564-4-gKGvwmgzkp@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-59564-4@http.gcc.gnu.org/bugzilla/>
References: <bug-59564-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2013-12/txt/msg01885.txt.bz2
Content-length: 239

http://gcc.gnu.org/bugzilla/show_bug.cgi?idY564

--- Comment #1 from Egor Suvorov <egor_suvorov at mail dot ru> ---
Created attachment 31483
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id1483&actioníit
Preprocessed source file


  parent reply	other threads:[~2013-12-19 19:09 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-14 11:20 [Bug go/59506] New: " ubizjak at gmail dot com
2013-12-14 11:30 ` [Bug go/59506] " ubizjak at gmail dot com
2013-12-19 19:09 ` ubizjak at gmail dot com [this message]
2013-12-27 14:53 ` ian at airs dot com
2013-12-27 21:44 ` ian at airs dot com

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-59506-4-fOGK1gXTbL@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).