This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Fix core dump test case failure with a ulimit check in gdb.base/auxv.exp


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]