From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15954 invoked by alias); 19 Mar 2012 16:13:55 -0000 Received: (qmail 15848 invoked by uid 22791); 19 Mar 2012 16:13:52 -0000 X-SWARE-Spam-Status: No, hits=-6.6 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,TW_FN,T_RP_MATCHES_RCVD 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, 19 Mar 2012 16:13:30 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q2JGDTsb007910 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 19 Mar 2012 12:13:29 -0400 Received: from host2.jankratochvil.net (ovpn-116-28.ams2.redhat.com [10.36.116.28]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q2JGDOEV001162 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Mon, 19 Mar 2012 12:13:27 -0400 Date: Mon, 19 Mar 2012 16:13:00 -0000 From: Jan Kratochvil To: Siddhesh Poyarekar Cc: gdb-patches@sourceware.org Subject: Re: [PATCH] Fix core dump test case failure with a ulimit check in gdb.base/auxv.exp Message-ID: <20120319161324.GA25524@host2.jankratochvil.net> References: <4F63613A.4080501@redhat.com> <20120317073755.GB25580@spoyarek.redhat.com> <20120319094218.GB14010@host2.jankratochvil.net> <20120319155729.GC26662@spoyarek.pnq.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20120319155729.GC26662@spoyarek.pnq.redhat.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-IsSubscribed: yes 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: 2012-03/txt/msg00710.txt.bz2 On Mon, 19 Mar 2012 16:57:31 +0100, Siddhesh Poyarekar wrote: > To check whether setrlimit and sys/resource.h exist, I added an auto-header > feature to the testsuite configure script Sorry but there are IIRC rather plans to remove the testsuite configure script at all. I also find your solution too heavyweight. I hope you find this simplified patch sufficient enough. Thanks, Jan 2012-03-19 Jan Kratochvil Siddhesh Poyarekar * gdb.base/auxv.c (func2): setrlimit to infinity to enable core dumps. * gdb.base/auxv.exp: Try to compile it with -DUSE_RLIMIT first. (generate native core dump): Make the test unsupported if core cannot be generated. --- a/gdb/testsuite/gdb.base/auxv.c +++ b/gdb/testsuite/gdb.base/auxv.c @@ -35,6 +35,13 @@ #define ABORT {char *invalid = 0; *invalid = 0xFF;} #endif +#ifdef USE_RLIMIT +# include +# ifndef RLIM_INFINITY +# define RLIM_INFINITY -1 +# endif +#endif /* USE_RLIMIT */ + /* Don't make these automatic vars or we will have to walk back up the stack to access them. */ @@ -53,6 +60,14 @@ func2 (int x) int i; static int y; +#ifdef USE_RLIMIT + { + struct rlimit rlim = { RLIM_INFINITY, RLIM_INFINITY }; + + setrlimit (RLIMIT_CORE, &rlim); + } +#endif + /* Make sure that coremaker_local doesn't get optimized away. */ for (i = 0; i < 5; i++) coremaker_local[i] = i; --- a/gdb/testsuite/gdb.base/auxv.exp +++ b/gdb/testsuite/gdb.base/auxv.exp @@ -31,7 +31,10 @@ set binfile ${objdir}/${subdir}/${testfile} set corefile ${objdir}/${subdir}/${testfile}.corefile set gcorefile ${objdir}/${subdir}/${testfile}.gcore -if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } { +if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable \ + {debug additional_flags=-DUSE_RLIMIT}] != "" + && [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable \ + {debug}] != "" } { untested "couldn't compile ${srcdir}/${subdir}/${srcfile}" return -1 } @@ -155,7 +158,7 @@ if {$core_works} { } else { set core_works 0 warning "can't generate a core file - core tests suppressed - check ulimit -c" - fail $test + unsupported $test } } else { unsupported $test