From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32017 invoked by alias); 19 Mar 2012 09:43:08 -0000 Received: (qmail 31933 invoked by uid 22791); 19 Mar 2012 09:43:07 -0000 X-SWARE-Spam-Status: No, hits=-6.7 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,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 09:42:24 +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 q2J9gO0q003327 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 19 Mar 2012 05:42:24 -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 q2J9gIn4002321 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Mon, 19 Mar 2012 05:42:21 -0400 Date: Mon, 19 Mar 2012 09:43: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: <20120319094218.GB14010@host2.jankratochvil.net> References: <4F63613A.4080501@redhat.com> <20120317073755.GB25580@spoyarek.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20120317073755.GB25580@spoyarek.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/msg00696.txt.bz2 On Sat, 17 Mar 2012 08:37:58 +0100, Siddhesh Poyarekar wrote: > @@ -42,8 +42,19 @@ set coredir "${objdir}/${subdir}/coredir.[getpid]" > file mkdir $coredir > set core_works [expr [isnative] && ! [is_remote target]] > > -# Run GDB on the test program up to where it will dump core. > +global gdb_prompt Such "global" is not needed when it is at the file level. > +gdb_exit > +gdb_start > +send_gdb "shell ulimit -c\n" > +gdb_expect { > + -re "0\r\n$gdb_prompt $" { > + warning "ulimit -c is 0, disabling core tests" > + set core_works 0 > + } > +} Other testcases try to set 'ulimit -c 0' first, this only testcase does not. That should be fixed. Also dealing with ulimit should be limited to the case where $core_works - that means only for local native runs. In such case one could also just run 'ulimit' by TCL, not by GDB 'shell'. And as 'ulimit -c unlimited' in this case would be complicated - or at least ot well compatible across platforms, there should be IMO setrlimit in the .c file instead. It should be protected by #ifdef and the compilation should be tried with and without it, as I guess setrlimit is also not well compatible across platforms. > +# Run GDB on the test program up to where it will dump core. > gdb_exit > gdb_start > gdb_reinitialize_dir $srcdir/$subdir > @@ -51,11 +62,9 @@ gdb_load ${binfile} > gdb_test_no_output "set print sevenbit-strings" > gdb_test_no_output "set width 0" > > -if {$core_works} { > - if {[gdb_test "cd $coredir" ".*Working directory .*" \ > - "cd to temporary directory for core dumps"]} { > - set core_works 0 > - } > +if {[gdb_test "cd $coredir" ".*Working directory .*" \ > + "cd to temporary directory for core dumps"]} { > + set core_works 0 > } I do not see a reason for this change. > if { ![runto_main] } then { > @@ -154,7 +163,7 @@ if {$core_works} { > pass $test > } else { > set core_works 0 > - warning "can't generate a core file - core tests suppressed - check ulimit -c" > + warning "can't generate a core file - core tests suppressed" > fail $test With the suggested 'ulimit -c unlimited' change to match other testcases I think this change should be dropped. > } > } else { Thanks, Jan