public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jakub Jelinek <jakub@redhat.com>
To: Konstantin Serebryany <konstantin.s.serebryany@gmail.com>
Cc: Ian Lance Taylor <iant@google.com>,
	Dodji Seketeli <dseketel@redhat.com>,
	       gcc-patches@gcc.gnu.org
Subject: Re: [PATCH] asan_test.cc from llvm
Date: Mon, 03 Dec 2012 09:18:00 -0000	[thread overview]
Message-ID: <20121203091815.GP2315@tucnak.redhat.com> (raw)
In-Reply-To: <CAGQ9bdx8UhtPc3OoYTdx+-VoJxQ5JLdBVWMUv72J4Tf_EpSrmA@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1163 bytes --]

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

[-- Attachment #2: X --]
[-- Type: text/plain, Size: 1172 bytes --]

--- /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);

  reply	other threads:[~2012-12-03  9:18 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-28  9:15 [PATCH] asan unit tests from llvm lit-test Wei Mi
2012-11-28 10:10 ` Konstantin Serebryany
2012-11-28 10:25   ` Jakub Jelinek
2012-11-28 10:41     ` Konstantin Serebryany
2012-11-28 11:03       ` Jakub Jelinek
2012-11-28 11:14         ` Konstantin Serebryany
2012-11-29 20:59           ` [PATCH] asan_test.cc from llvm Jakub Jelinek
2012-11-30  9:35             ` Konstantin Serebryany
2012-11-30 10:22               ` Jakub Jelinek
2012-11-30 10:55                 ` Konstantin Serebryany
2012-11-30 14:52                   ` Jakub Jelinek
2012-11-30 16:06                     ` Jakub Jelinek
     [not found]                       ` <CAKOQZ8y70goUL91pQJt_S=8W+Dn5VTZ5oRphvGuFwMMh41mkLg@mail.gmail.com>
2012-11-30 16:34                         ` Jakub Jelinek
2012-12-03  7:07                           ` Konstantin Serebryany
2012-12-03  9:18                             ` Jakub Jelinek [this message]
2012-12-03  9:52                               ` Konstantin Serebryany
2012-12-03 11:05                                 ` Jakub Jelinek
2012-12-03 11:42                                   ` Konstantin Serebryany
2012-11-28 11:25         ` [PATCH] asan unit tests from llvm lit-test Jakub Jelinek
2012-11-28 11:39           ` Konstantin Serebryany
2012-11-28 10:14 ` Jakub Jelinek
2012-11-30 21:05   ` Wei Mi
2012-12-03  7:16     ` Konstantin Serebryany
2012-12-03 11:01     ` Jakub Jelinek
2012-12-03 18:33       ` Wei Mi
2012-12-03 18:49         ` Konstantin Serebryany
2012-12-03 19:44         ` Jakub Jelinek
2012-12-03 19:09       ` Mike Stump
2012-12-03 19:37         ` Jakub Jelinek
2012-12-03 19:50           ` Mike Stump
     [not found]             ` <CAN=P9pgjjq66KS2DVkuOSeH2ejQPDcyKhwz5MdKyE3RB64E=xw@mail.gmail.com>
2012-12-04  7:34               ` Jakub Jelinek
2012-12-04 18:01       ` Wei Mi
2012-12-05 12:29         ` [PATCH] asan unit tests from llvm lit-test incremental changes Jakub Jelinek
2012-12-12 21:32           ` Dodji Seketeli
2012-12-12 21:31             ` Jakub Jelinek
2012-12-13  7:44               ` Konstantin Serebryany
2012-12-13  8:37                 ` Jakub Jelinek
2012-12-13 10:23                   ` Konstantin Serebryany
2012-12-13 15:22                     ` Jakub Jelinek
2012-12-05 23:29         ` [asan] Fix up dg-set-target-env-var Jakub Jelinek
2012-12-06  0:23           ` Mike Stump

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=20121203091815.GP2315@tucnak.redhat.com \
    --to=jakub@redhat.com \
    --cc=dseketel@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=iant@google.com \
    --cc=konstantin.s.serebryany@gmail.com \
    /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).