From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3600 invoked by alias); 31 Jan 2011 19:07:02 -0000 Received: (qmail 3590 invoked by uid 22791); 31 Jan 2011 19:07:01 -0000 X-SWARE-Spam-Status: No, hits=-1.3 required=5.0 tests=AWL,BAYES_00,MSGID_FROM_MTA_HEADER,SPF_SOFTFAIL,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mtagate7.uk.ibm.com (HELO mtagate7.uk.ibm.com) (194.196.100.167) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 31 Jan 2011 19:06:52 +0000 Received: from d06nrmr1806.portsmouth.uk.ibm.com (d06nrmr1806.portsmouth.uk.ibm.com [9.149.39.193]) by mtagate7.uk.ibm.com (8.13.1/8.13.1) with ESMTP id p0VJ6n4t021008 for ; Mon, 31 Jan 2011 19:06:49 GMT Received: from d06av02.portsmouth.uk.ibm.com (d06av02.portsmouth.uk.ibm.com [9.149.37.228]) by d06nrmr1806.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p0VJ6qOF2031774 for ; Mon, 31 Jan 2011 19:06:52 GMT Received: from d06av02.portsmouth.uk.ibm.com (loopback [127.0.0.1]) by d06av02.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p0VJ6n4I006623 for ; Mon, 31 Jan 2011 12:06:49 -0700 Received: from tuxmaker.boeblingen.de.ibm.com (tuxmaker.boeblingen.de.ibm.com [9.152.85.9]) by d06av02.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with SMTP id p0VJ6lQS006271; Mon, 31 Jan 2011 12:06:47 -0700 Message-Id: <201101311906.p0VJ6lQS006271@d06av02.portsmouth.uk.ibm.com> Received: by tuxmaker.boeblingen.de.ibm.com (sSMTP sendmail emulation); Mon, 31 Jan 2011 20:06:47 +0100 Subject: [commit] Fix test suite race (Re: [patch] Changes to the OpenCL testsuite) To: ken@linux.vnet.ibm.com (Ken Werner) Date: Mon, 31 Jan 2011 19:45:00 -0000 From: "Ulrich Weigand" Cc: yao@codesourcery.com (Yao Qi), gdb-patches@sourceware.org In-Reply-To: <201101251716.20266.ken@linux.vnet.ibm.com> from "Ken Werner" at Jan 25, 2011 05:16:20 PM MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2011-01/txt/msg00592.txt.bz2 Ken Werner wrote: > * gdb.opencl/convs_casts.cl: Move program scope variables into the > OpenCL kernel function. Add a comment as marker. Add address space > qualifiers for the remaining program scope variables. > * gdb.opencl/datatypes.cl: Likewise. > * gdb.opencl/operators.cl: Likewise. > * gdb.opencl/vec_comps.cl: Likewise. > * gdb.opencl/convs_casts.exp: Replace gdb_test_multiple by gdb_test. > Add breakpoint at the marker comment. > * gdb.opencl/datatypes.exp: Likewise. > * gdb.opencl/operators.exp: Likewise. > * gdb.opencl/vec_comps.exp: Likewise. This patch exposed a race condition if the kernel runs multi-threaded: after the inital breakpoint on "testkernel" is hit, GDB now attempts to proceed to "marker" -- but we might instead hit "testkernel" in another thread. This patch fixes the race by using "tbreak" to make sure only one thread will ever stop at "testkernel". Tested on powerpc64-linux. Committed to mainline. ChangeLog: * gdb.opencl/convs_casts.exp: Use tbreak instead of break to proceed to initial kernel entry point. * gdb.opencl/datatypes.exp: Likewise. * gdb.opencl/operators.exp: Likewise. * gdb.opencl/vec_comps.exp: Likewise. Index: gdb/testsuite/gdb.opencl/convs_casts.exp =================================================================== RCS file: /cvs/src/src/gdb/testsuite/gdb.opencl/convs_casts.exp,v retrieving revision 1.3 diff -u -p -r1.3 convs_casts.exp --- gdb/testsuite/gdb.opencl/convs_casts.exp 25 Jan 2011 16:10:28 -0000 1.3 +++ gdb/testsuite/gdb.opencl/convs_casts.exp 31 Jan 2011 18:59:33 -0000 @@ -40,14 +40,14 @@ if { [gdb_compile_opencl_hostapp "${clpr clean_restart ${testfile} # Set breakpoint at the OpenCL kernel -gdb_test "break testkernel" \ +gdb_test "tbreak testkernel" \ "" \ "Set pending breakpoint" \ ".*Function \"testkernel\" not defined.*Make breakpoint pending.*y or \\\[n\\\]. $" \ "y" gdb_run_cmd -gdb_test "" ".*Breakpoint.*1.*testkernel.*" "run" +gdb_test "" ".*reakpoint.*1.*testkernel.*" "run" # Continue to the marker gdb_breakpoint [gdb_get_line_number "marker" "${clprogram}"] Index: gdb/testsuite/gdb.opencl/datatypes.exp =================================================================== RCS file: /cvs/src/src/gdb/testsuite/gdb.opencl/datatypes.exp,v retrieving revision 1.3 diff -u -p -r1.3 datatypes.exp --- gdb/testsuite/gdb.opencl/datatypes.exp 25 Jan 2011 16:10:28 -0000 1.3 +++ gdb/testsuite/gdb.opencl/datatypes.exp 31 Jan 2011 18:59:33 -0000 @@ -206,14 +206,14 @@ gdb_reinitialize_dir $srcdir/$subdir gdb_load ${objdir}/${subdir}/${testfile} # Set breakpoint at the OpenCL kernel -gdb_test "break testkernel" \ +gdb_test "tbreak testkernel" \ "" \ "Set pending breakpoint" \ ".*Function \"testkernel\" not defined.*Make breakpoint pending.*y or \\\[n\\\]. $" \ "y" gdb_run_cmd -gdb_test "" ".*Breakpoint.*1.*testkernel.*" "run" +gdb_test "" ".*reakpoint.*1.*testkernel.*" "run" # Continue to the marker gdb_breakpoint [gdb_get_line_number "marker" "${clprogram}"] Index: gdb/testsuite/gdb.opencl/operators.exp =================================================================== RCS file: /cvs/src/src/gdb/testsuite/gdb.opencl/operators.exp,v retrieving revision 1.3 diff -u -p -r1.3 operators.exp --- gdb/testsuite/gdb.opencl/operators.exp 25 Jan 2011 16:10:28 -0000 1.3 +++ gdb/testsuite/gdb.opencl/operators.exp 31 Jan 2011 18:59:33 -0000 @@ -40,14 +40,14 @@ if { [gdb_compile_opencl_hostapp "${clpr clean_restart ${testfile} # Set breakpoint at the OpenCL kernel -gdb_test "break testkernel" \ +gdb_test "tbreak testkernel" \ "" \ "Set pending breakpoint" \ ".*Function \"testkernel\" not defined.*Make breakpoint pending.*y or \\\[n\\\]. $" \ "y" gdb_run_cmd -gdb_test "" ".*Breakpoint.*1.*testkernel.*" "run" +gdb_test "" ".*reakpoint.*1.*testkernel.*" "run" # Continue to the marker gdb_breakpoint [gdb_get_line_number "marker" "${clprogram}"] Index: gdb/testsuite/gdb.opencl/vec_comps.exp =================================================================== RCS file: /cvs/src/src/gdb/testsuite/gdb.opencl/vec_comps.exp,v retrieving revision 1.3 diff -u -p -r1.3 vec_comps.exp --- gdb/testsuite/gdb.opencl/vec_comps.exp 25 Jan 2011 16:10:28 -0000 1.3 +++ gdb/testsuite/gdb.opencl/vec_comps.exp 31 Jan 2011 18:59:33 -0000 @@ -40,14 +40,14 @@ if { [gdb_compile_opencl_hostapp "${clpr clean_restart ${testfile} # Set breakpoint at the OpenCL kernel -gdb_test "break testkernel" \ +gdb_test "tbreak testkernel" \ "" \ "Set pending breakpoint" \ ".*Function \"testkernel\" not defined.*Make breakpoint pending.*y or \\\[n\\\]. $" \ "y" gdb_run_cmd -gdb_test "" ".*Breakpoint.*1.*testkernel.*" "run" +gdb_test "" ".*reakpoint.*1.*testkernel.*" "run" # Continue to the marker gdb_breakpoint [gdb_get_line_number "marker" "${clprogram}"] -- Dr. Ulrich Weigand GNU Toolchain for Linux on System z and Cell BE Ulrich.Weigand@de.ibm.com