gdb.base/siginfo-thread.exp: Increase timeout for 'gcore' command

Message ID 1488338603-107524-1-git-send-email-weimin.pan@oracle.com
State New, archived
Headers

Commit Message

Weimin Pan March 1, 2017, 3:23 a.m. UTC
  The following failed lines from running test case siginfo-thread:

FAIL: gdb.base/siginfo-thread.exp: save a core file (timeout)
FAIL: gdb.base/siginfo-thread.exp: extract si_addr
FAIL: gdb.base/siginfo-thread.exp: p ssi_addr

indicate the testsuite timed out when gdb was instructed to write the
core file. The patch below fixes the problem by simply increasing the
timeout by a factor of 2 to give gdb more time to generate core files.

Tested in sparc64-linux-gnu. No regressions.

gdb/testsuite/ChangeLog:
2017-02-22  Weimin Pan  <weimin.pan@oracle.com>

        * gdb.base/siginfo-thread.exp: Increase timeout by a factor of 2
        for the 'gcore command.
---
 gdb/testsuite/gdb.base/siginfo-thread.exp |   20 +++++++++++---------
 1 files changed, 11 insertions(+), 9 deletions(-)
  

Comments

Yao Qi March 16, 2017, 2:45 p.m. UTC | #1
Weimin Pan <weimin.pan@oracle.com> writes:

> The following failed lines from running test case siginfo-thread:
>
> FAIL: gdb.base/siginfo-thread.exp: save a core file (timeout)
> FAIL: gdb.base/siginfo-thread.exp: extract si_addr
> FAIL: gdb.base/siginfo-thread.exp: p ssi_addr
>
> indicate the testsuite timed out when gdb was instructed to write the
> core file. The patch below fixes the problem by simply increasing the
> timeout by a factor of 2 to give gdb more time to generate core files.
>
> Tested in sparc64-linux-gnu. No regressions.

Did you see timeout fails in all gcore related tests?  gdb_gcore_cmd is
used in many places in gdb testsuite.  Did you investigate why it is so
slow to generate coredump in gdb?
  
Weimin Pan March 16, 2017, 4 p.m. UTC | #2
Yao Qi wrote:
> Weimin Pan <weimin.pan@oracle.com> writes:
>
>   
>> The following failed lines from running test case siginfo-thread:
>>
>> FAIL: gdb.base/siginfo-thread.exp: save a core file (timeout)
>> FAIL: gdb.base/siginfo-thread.exp: extract si_addr
>> FAIL: gdb.base/siginfo-thread.exp: p ssi_addr
>>
>> indicate the testsuite timed out when gdb was instructed to write the
>> core file. The patch below fixes the problem by simply increasing the
>> timeout by a factor of 2 to give gdb more time to generate core files.
>>
>> Tested in sparc64-linux-gnu. No regressions.
>>     
>
> Did you see timeout fails in all gcore related tests?  gdb_gcore_cmd is
> used in many places in gdb testsuite.  Did you investigate why it is so
> slow to generate coredump in gdb?
>
>   
No, only this test failed with timeout and did so consistently. The 
generated core file was fine.
We suspect the slow disk performance was the culprit.

Thanks.
  
Pedro Alves March 16, 2017, 5:08 p.m. UTC | #3
On 03/16/2017 04:00 PM, Wei-min Pan wrote:
> Yao Qi wrote:

>> Did you see timeout fails in all gcore related tests?  gdb_gcore_cmd is
>> used in many places in gdb testsuite.  Did you investigate why it is so
>> slow to generate coredump in gdb?
>>
>>   
> No, only this test failed with timeout and did so consistently. The
> generated core file was fine.
> We suspect the slow disk performance was the culprit.

I agree with Yao, and I'm not convinced.  The generated core file is just
"8.6M" on my x86_64 Fedora 23 and the test runs in under 1s here.

$ time make check TESTS="*/siginfo-thread.exp"
...
real    0m0.781s
user    0m0.554s
sys     0m0.152s


What's the size of the core you get?  If you run the test manually,
do we notice any kind of slowness?

If you have a general slowness issue in your testing host, then
this should be affecting all gcore tests the same.  We have some
tests that generate big cores on purpose even.

Thanks,
Pedro Alves
  
Weimin Pan March 16, 2017, 6:27 p.m. UTC | #4
Pedro Alves wrote:
> On 03/16/2017 04:00 PM, Wei-min Pan wrote:
>   
>> Yao Qi wrote:
>>     
>
>   
>>> Did you see timeout fails in all gcore related tests?  gdb_gcore_cmd is
>>> used in many places in gdb testsuite.  Did you investigate why it is so
>>> slow to generate coredump in gdb?
>>>
>>>   
>>>       
>> No, only this test failed with timeout and did so consistently. The
>> generated core file was fine.
>> We suspect the slow disk performance was the culprit.
>>     
>
> I agree with Yao, and I'm not convinced.  The generated core file is just
> "8.6M" on my x86_64 Fedora 23 and the test runs in under 1s here.
>
> $ time make check TESTS="*/siginfo-thread.exp"
> ...
> real    0m0.781s
> user    0m0.554s
> sys     0m0.152s
>
>
> What's the size of the core you get?  If you run the test manually,
> do we notice any kind of slowness?
>   

The core size is a little over 9.0M but it took much longer to run this 
individual test:

% time make check TESTS="*/siginfo-thread.exp"
...
real    0m11.743s
user    0m3.892s
sys     0m7.572s

And I didn't notice any slowness if the test was run by hand.

> If you have a general slowness issue in your testing host, then
> this should be affecting all gcore tests the same.  We have some
> tests that generate big cores on purpose even.
>   

Like I said, only this test consistently failed and the core file 
generated was not that big.

Thanks.

> Thanks,
> Pedro Alves
>
>
  
Pedro Alves March 16, 2017, 6:34 p.m. UTC | #5
On 03/16/2017 06:27 PM, Wei-min Pan wrote:
> Pedro Alves wrote:
>> On 03/16/2017 04:00 PM, Wei-min Pan wrote:
>>  
>>> Yao Qi wrote:
>>>     
>>
>>  
>>>> Did you see timeout fails in all gcore related tests?  gdb_gcore_cmd is
>>>> used in many places in gdb testsuite.  Did you investigate why it is so
>>>> slow to generate coredump in gdb?
>>>>
>>>>         
>>> No, only this test failed with timeout and did so consistently. The
>>> generated core file was fine.
>>> We suspect the slow disk performance was the culprit.
>>>     
>>
>> I agree with Yao, and I'm not convinced.  The generated core file is just
>> "8.6M" on my x86_64 Fedora 23 and the test runs in under 1s here.
>>
>> $ time make check TESTS="*/siginfo-thread.exp"
>> ...
>> real    0m0.781s
>> user    0m0.554s
>> sys     0m0.152s
>>
>>
>> What's the size of the core you get?  If you run the test manually,
>> do we notice any kind of slowness?
>>   
> 
> The core size is a little over 9.0M but it took much longer to run this
> individual test:
> 
> % time make check TESTS="*/siginfo-thread.exp"
> ...
> real    0m11.743s
> user    0m3.892s
> sys     0m7.572s
> 
> And I didn't notice any slowness if the test was run by hand.

You mean that by hand it went faster than that?
So what is GDB doing differently when run via make check
that makes it slower than running by hand?

>> If you have a general slowness issue in your testing host, then
>> this should be affecting all gcore tests the same.  We have some
>> tests that generate big cores on purpose even.
>>   
> 
> Like I said, only this test consistently failed and the core file
> generated was not that big.

Which suggests bumping the timeout is not the right thing to do.

Thanks,
Pedro Alves
  
Weimin Pan March 16, 2017, 7:10 p.m. UTC | #6
Pedro Alves wrote:
> On 03/16/2017 06:27 PM, Wei-min Pan wrote:
>   
>> Pedro Alves wrote:
>>     
>>> On 03/16/2017 04:00 PM, Wei-min Pan wrote:
>>>  
>>>       
>>>> Yao Qi wrote:
>>>>     
>>>>         
>>>  
>>>       
>>>>> Did you see timeout fails in all gcore related tests?  gdb_gcore_cmd is
>>>>> used in many places in gdb testsuite.  Did you investigate why it is so
>>>>> slow to generate coredump in gdb?
>>>>>
>>>>>         
>>>>>           
>>>> No, only this test failed with timeout and did so consistently. The
>>>> generated core file was fine.
>>>> We suspect the slow disk performance was the culprit.
>>>>     
>>>>         
>>> I agree with Yao, and I'm not convinced.  The generated core file is just
>>> "8.6M" on my x86_64 Fedora 23 and the test runs in under 1s here.
>>>
>>> $ time make check TESTS="*/siginfo-thread.exp"
>>> ...
>>> real    0m0.781s
>>> user    0m0.554s
>>> sys     0m0.152s
>>>
>>>
>>> What's the size of the core you get?  If you run the test manually,
>>> do we notice any kind of slowness?
>>>   
>>>       
>> The core size is a little over 9.0M but it took much longer to run this
>> individual test:
>>
>> % time make check TESTS="*/siginfo-thread.exp"
>> ...
>> real    0m11.743s
>> user    0m3.892s
>> sys     0m7.572s
>>
>> And I didn't notice any slowness if the test was run by hand.
>>     
>
> You mean that by hand it went faster than that?
> So what is GDB doing differently when run via make check
> that makes it slower than running by hand?
>   

Yes, but not by much faster:

% cat in
run
gcore tmp.gcore
quit

% time my_gdb siginfo-thread -x in
...
real    0m13.327s
user    0m3.504s
sys     0m7.572s

Thanks.
>   
>>> If you have a general slowness issue in your testing host, then
>>> this should be affecting all gcore tests the same.  We have some
>>> tests that generate big cores on purpose even.
>>>   
>>>       
>> Like I said, only this test consistently failed and the core file
>> generated was not that big.
>>     
>
> Which suggests bumping the timeout is not the right thing to do.
>
> Thanks,
> Pedro Alves
>
>
  
Pedro Alves March 16, 2017, 7:21 p.m. UTC | #7
On 03/16/2017 07:10 PM, Wei-min Pan wrote:

>> You mean that by hand it went faster than that?
>> So what is GDB doing differently when run via make check
>> that makes it slower than running by hand?
>>   
> 
> Yes, but not by much faster:
> 
> % cat in
> run
> gcore tmp.gcore
> quit
> 
> % time my_gdb siginfo-thread -x in
> ...
> real    0m13.327s
> user    0m3.504s
> sys     0m7.572s

Either I'm missing something, or that was _slower_ than then
number you shown of running via the testsuite, not faster...

So WDT is GDB doing that takes that long?  Is that writing
the core to a slow NFS mount or something?

Here that takes:

 real    0m0.120s
 user    0m0.090s
 sys     0m0.033s

and this is not a state-of-the-art machine.

Can you guess the next question?

Pick any other core test in the testsuite, do the
same and compare the numbers.

And if they're different, the next question would
then be, "what's different in this test, why's
it slower?".

If they're similar, then, well, the same question.  :-)

Thanks,
Pedro Alves
  
Weimin Pan March 16, 2017, 7:50 p.m. UTC | #8
Pedro Alves wrote:
> On 03/16/2017 07:10 PM, Wei-min Pan wrote:
>
>   
>>> You mean that by hand it went faster than that?
>>> So what is GDB doing differently when run via make check
>>> that makes it slower than running by hand?
>>>   
>>>       
>> Yes, but not by much faster:
>>
>> % cat in
>> run
>> gcore tmp.gcore
>> quit
>>
>> % time my_gdb siginfo-thread -x in
>> ...
>> real    0m13.327s
>> user    0m3.504s
>> sys     0m7.572s
>>     
>
> Either I'm missing something, or that was _slower_ than then
> number you shown of running via the testsuite, not faster...
>   

Sorry, you didn't miss anything. I misspoke :)
> So WDT is GDB doing that takes that long?  Is that writing
> the core to a slow NFS mount or something?
>
> Here that takes:
>
>  real    0m0.120s
>  user    0m0.090s
>  sys     0m0.033s
>
> and this is not a state-of-the-art machine.
>
> Can you guess the next question?
>
> Pick any other core test in the testsuite, do the
> same and compare the numbers.
>
> And if they're different, the next question would
> then be, "what's different in this test, why's
> it slower?".
>   
OK, just tried a different test which is similar to siginfo-thread:

% time make check TESTS="*/siginfo-obj.exp"
...
real    0m1.282s
user    0m0.736s
sys     0m0.400s

Looks like the slowness had something to do with the pthread libs.
Will investigate. Thanks.
> If they're similar, then, well, the same question.  :-)
>
> Thanks,
> Pedro Alves
>
>
  

Patch

diff --git a/gdb/testsuite/gdb.base/siginfo-thread.exp b/gdb/testsuite/gdb.base/siginfo-thread.exp
index 825a0d2..872780b 100644
--- a/gdb/testsuite/gdb.base/siginfo-thread.exp
+++ b/gdb/testsuite/gdb.base/siginfo-thread.exp
@@ -44,15 +44,17 @@  if { ![runto_main] } then {
 gdb_test "continue" "Thread .* received signal SIGSEGV.*" "continue to signal"
 
 # Try to generate a core file, for a later test.
-set gcorefile [standard_output_file $testfile.gcore]
-set gcore_created [gdb_gcore_cmd $gcorefile "save a core file"]
-
-set ssi_addr ""
-set test "extract si_addr"
-gdb_test_multiple "p \$_siginfo" "$test" {
-    -re "si_addr = ($hex).*$gdb_prompt $" {
-	set ssi_addr $expect_out(1,string)
-	pass "$test"
+with_timeout_factor 2 {
+    set gcorefile [standard_output_file $testfile.gcore]
+    set gcore_created [gdb_gcore_cmd $gcorefile "save a core file"]
+
+    set ssi_addr ""
+    set test "extract si_addr"
+    gdb_test_multiple "p \$_siginfo" "$test" {
+    	-re "si_addr = ($hex).*$gdb_prompt $" {
+	    set ssi_addr $expect_out(1,string)
+	    pass "$test"
+    	}
     }
 }