From patchwork Mon Dec 3 09:18:15 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Jelinek X-Patchwork-Id: 203300 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id C2C232C0082 for ; Mon, 3 Dec 2012 20:18:32 +1100 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1355131114; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Received:Received:Date:From:To:Cc:Subject:Message-ID:Reply-To: References:MIME-Version:Content-Type:Content-Disposition: In-Reply-To:User-Agent:Mailing-List:Precedence:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:Sender: Delivered-To; bh=FUKCXOoazTmTUeWWPld8ueIX9NY=; b=U7owqDcpx/CCVXe d79c98LFlJCwFQIYhOI7PqrCSTes+/aEvZOv/4Y1c6XH/0wgQfrTeD2Moyk1ldQZ JZPkofZKK5n93epMyoR59cjD+0KCqiy4WGJrU+SoSpSuoXhgjWK1HpwPrTVBtm0P QwfAcmn2rC/OVcjABMCItPumaWlw= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:Received:Received:Received:Date:From:To:Cc:Subject:Message-ID:Reply-To:References:MIME-Version:Content-Type:Content-Disposition:In-Reply-To:User-Agent:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=Ux0IZ7I0B43AznhfwsZHNyirDyIN//6JIBt9bwhd00EqK/wXonjfCIGABxgKW6 C+qnF72uTIzs1Zu6GhOeM9OOTyRECt3OC2kW1fTe5AigidBWnpW3oyReKqVjJWwW iGPwc6z9EwZ8g3bWRuBv1o7Inr4xa4Sm1yGzZCct4szBs=; Received: (qmail 24540 invoked by alias); 3 Dec 2012 09:18:29 -0000 Received: (qmail 24485 invoked by uid 22791); 3 Dec 2012 09:18:28 -0000 X-SWARE-Spam-Status: No, hits=-6.2 required=5.0 tests=AWL, BAYES_00, KHOP_RCVD_UNTRUST, KHOP_SPAMHAUS_DROP, RCVD_IN_DNSWL_HI, RCVD_IN_HOSTKARMA_W, RP_MATCHES_RCVD, SPF_HELO_PASS, TW_LV X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 03 Dec 2012 09:18:19 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id qB39II6q004705 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 3 Dec 2012 04:18:18 -0500 Received: from zalov.redhat.com (vpn1-5-203.ams2.redhat.com [10.36.5.203]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id qB39IG4g009184 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 3 Dec 2012 04:18:17 -0500 Received: from zalov.cz (localhost [127.0.0.1]) by zalov.redhat.com (8.14.5/8.14.5) with ESMTP id qB39IFYX009543; Mon, 3 Dec 2012 10:18:16 +0100 Received: (from jakub@localhost) by zalov.cz (8.14.5/8.14.5/Submit) id qB39IFaP009542; Mon, 3 Dec 2012 10:18:15 +0100 Date: Mon, 3 Dec 2012 10:18:15 +0100 From: Jakub Jelinek To: Konstantin Serebryany Cc: Ian Lance Taylor , Dodji Seketeli , gcc-patches@gcc.gnu.org Subject: Re: [PATCH] asan_test.cc from llvm Message-ID: <20121203091815.GP2315@tucnak.redhat.com> Reply-To: Jakub Jelinek References: <20121129204636.GC2315@tucnak.redhat.com> <20121130101420.GE2315@tucnak.redhat.com> <20121130144602.GF2315@tucnak.redhat.com> <20121130155932.GG2315@tucnak.redhat.com> <20121130162525.GH2315@tucnak.redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org On Mon, Dec 03, 2012 at 11:06:48AM +0400, Konstantin Serebryany wrote: > This patch copies the asan tests almost, but not quite, verbatim from upstream. > Since the patch is not in attachment (and gmail messes up with inlined > patches) I can't see the exact changes. Sending patches inline rather than as attachments is the preferred way for gcc-patches, you can always grab it from the gcc-patches ml archive: http://gcc.gnu.org/ml/gcc-patches/2012-11/msg02557.html (then click on Raw text). I'm attaching the diff for asan_test.cc from llvm anyway. > I see #ifdef ASAN_AVOID_EXPENSIVE_TESTS, which I don't really like > because I'd rather fix the test than disable it. The test isn't disabled, just by default limited to 30 threads instead of 1000, because that really will ruin testing for everybody with ulimit -u in 1024-ish range. Even 500 threads would be undesirable for that. > Can we commit the tests 100% verbatim, and then fix them as separate commits > (preferably, by fixing the tests upstream and doing the merge with > libsanitizer/merge.sh)? I'd prefer delay committing the patch over causing random testsuite failures elsewhere. Jakub --- /usr/src/llvm/projects/compiler-rt/lib/asan/tests/asan_test.cc 2012-11-30 14:23:48.525229790 +0100 +++ asan_test.cc 2012-12-03 10:12:14.503366704 +0100 @@ -1,7 +1,5 @@ //===-- asan_test.cc ------------------------------------------------------===// // -// The LLVM Compiler Infrastructure -// // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // @@ -481,10 +479,16 @@ void *ManyThreadsWorker(void *a) { } TEST(AddressSanitizer, ManyThreadsTest) { - const size_t kNumThreads = SANITIZER_WORDSIZE == 32 ? 30 : 1000; - pthread_t t[kNumThreads]; +#ifdef ASAN_AVOID_EXPENSIVE_TESTS + const size_t kMaxThreads = 30; +#else + const size_t kMaxThreads = SANITIZER_WORDSIZE == 32 ? 30 : 1000; +#endif + pthread_t t[kMaxThreads]; + size_t kNumThreads = kMaxThreads; for (size_t i = 0; i < kNumThreads; i++) { - pthread_create(&t[i], 0, (void* (*)(void *x))ManyThreadsWorker, (void*)i); + if (pthread_create(&t[i], 0, (void* (*)(void *x))ManyThreadsWorker, (void*)i)) + kNumThreads = i; } for (size_t i = 0; i < kNumThreads; i++) { pthread_join(t[i], 0);