From patchwork Wed Nov 27 21:29:23 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Burgess X-Patchwork-Id: 36327 Received: (qmail 73027 invoked by alias); 27 Nov 2019 21:29:29 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 73012 invoked by uid 89); 27 Nov 2019 21:29:28 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy=H*r:sk:host109, H*RU:sk:host109, HX-Spam-Relays-External:sk:host109 X-HELO: mail-wm1-f43.google.com Received: from mail-wm1-f43.google.com (HELO mail-wm1-f43.google.com) (209.85.128.43) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 27 Nov 2019 21:29:27 +0000 Received: by mail-wm1-f43.google.com with SMTP id a131so4403577wme.5 for ; Wed, 27 Nov 2019 13:29:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=embecosm.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=lYxq1eQkbp70G32FBxFMbOWxPFPfLGdvDXps2+hEISI=; b=e2IE4JBJwqTV07/P+wMIywJCnLVAt9k5WBLjwcbixiohlpNaV1l5xce1rtudAELoTu 56sHPNwMNE3I1a13AGm/4KsiPNSqBHaogAakQuVhTOvSuV+tohy+hlP5Z6+T5eVqjEWj KNMKIT8gnkIUvDNpoajThozYC1lnGpDVzJDaj33LJMcRzfX6Vmz0f/LU9AfpnvG0La3C FKpZqhkIrvQ9RQHZAhcDCBLy6Sp4SRhe43WCaii4arnHX/LdGFS5MiFuLoEdN18ygrLh VD/GnQRRg9IJ1nMdf+et/TyHlb3NHIYx+UMy2B69B5Pq/HDNbPv/hZz6NH5Lid4/PEGH sqiw== Return-Path: Received: from localhost (host109-151-46-117.range109-151.btcentralplus.com. [109.151.46.117]) by smtp.gmail.com with ESMTPSA id u3sm6424955wmm.45.2019.11.27.13.29.24 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 27 Nov 2019 13:29:24 -0800 (PST) Date: Wed, 27 Nov 2019 21:29:23 +0000 From: Andrew Burgess To: Tom de Vries Cc: gdb-patches Subject: Re: [PATCHv2 4/4] gdb: Add new commands to list module variables and functions Message-ID: <20191127212923.GC3410@embecosm.com> References: <2572574a445f9f32b4cca9a6f767d8495f4503c1.1570101531.git.andrew.burgess@embecosm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Fortune: Yow! I want to mail a bronzed artichoke to Nicaragua! X-Editor: GNU Emacs [ http://www.gnu.org/software/emacs ] User-Agent: Mutt/1.9.2 (2017-12-15) X-IsSubscribed: yes * Tom de Vries [2019-11-22 13:44:09 +0100]: > On 03-10-2019 13:29, Andrew Burgess wrote: > > * gdb.fortran/info-modules.exp: Update expected results, and add > > additional tests for 'info module functinos', and 'info module > > variables'. > > * gdb.fortran/info-types.exp: Update expected results. > > * gdb.fortran/info-types.f90: Extend testcase with additional > > module variables and functions. > > Hi, > > This test-case fails to compile for me: > ... > $ cd build/gdb; make check RUNTESTFLAGS="gdb.fortran/info-modules.exp" > gdb compile failed, src/gdb/testsuite/gdb.fortran/info-types.f90:39:6: > > use mod2 > 1 > Fatal Error: Can't open module file 'mod2.mod' for reading at (1): No > such file or directory > compilation terminated. > > === gdb Summary === > > # of untested testcases 1 > ... > > Interestingly, if I first run: > ... > $ cd build/gdb; make check RUNTESTFLAGS="gdb.fortran/module.exp" > Running src/gdb/testsuite/gdb.fortran/module.exp ... > > === gdb Summary === > > # of expected passes 27 > ... > which produces: > ... > $ ls -la build/gdb/testsuite/mod2.mod > -rw-r--r-- 1 vries users 208 22 nov 13:35 build/gdb/testsuite/mod2.mod > ... > then the test-case passes: > ... > $ cd build/gdb; make check RUNTESTFLAGS="gdb.fortran/info-modules.exp" > Running src/gdb/testsuite/gdb.fortran/info-modules.exp ... > > === gdb Summary === > > # of expected passes 12 > ... > > Removing mod2.mod brings the failure back: > ... > $ rm -f build/gdb/testsuite/mod2.mod > $ cd build/gdb; make check > RUNTESTFLAGS="gdb.fortran/info-modules.exp" > gdb compile failed, src/gdb/testsuite/gdb.fortran/info-types.f90:39:6: > > use mod2 > 1 > Fatal Error: Can't open module file 'mod2.mod' for reading at (1): No > such file or directory > compilation terminated. > > === gdb Summary === > > # of untested testcases 1 > ... > > So, I think that in a parallel test run this may succeed, but in a > sequential testrun this should fail. Tom, Thanks for finding this issue. Sorry that I didn't spot this feedback until after I'd pushed this patch. I've committed the fix below to address this issue. Thanks, Andrew --- From 640ab94712483457b99bd1039b52821c510b28a7 Mon Sep 17 00:00:00 2001 From: Andrew Burgess Date: Wed, 27 Nov 2019 21:18:38 +0000 Subject: [PATCH] gdb/testsuite: Fix race condition compiling fortran test The Fortran test gdb.fortran/info-modules compiles the files info-types.f90 and info-types-2.f90 in that order. Unfortunately info-types.f90 makes use of a module defined in info-types-2.f90. This currently doesn't cause a problem if you run all of the Fortran tests as the info-types.exp test already compiles info-types-2.f90 and so the module description file 'mod2.mod' will be created, and can then be found by info-modules.exp during its compile. If however you try to run just info-modules.exp in a clean build directory, the test will fail to compile. Fix this by compiling the source files in the reverse order so that the module is compiled first, then the test program that uses the module. gdb/testsuite/ChangeLog: * gdb.fortran/info-modules.exp: Compile source files in correct order. Change-Id: Ic3a1eded0486f6264ebe3066cf1beafbd2534a91 --- gdb/testsuite/ChangeLog | 5 +++++ gdb/testsuite/gdb.fortran/info-modules.exp | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/gdb/testsuite/gdb.fortran/info-modules.exp b/gdb/testsuite/gdb.fortran/info-modules.exp index 43570066d2f..c57ac3ff569 100644 --- a/gdb/testsuite/gdb.fortran/info-modules.exp +++ b/gdb/testsuite/gdb.fortran/info-modules.exp @@ -23,7 +23,7 @@ if { [skip_fortran_tests] } { continue } standard_testfile info-types.f90 info-types-2.f90 if { [prepare_for_testing "failed to prepare" $testfile \ - [list $srcfile $srcfile2] {debug f90}] } { + [list $srcfile2 $srcfile] {debug f90}] } { return -1 }