[gdb/testsuite] Add PR26286 kfail in gdb.threads/attach-many-short-lived-threads.exp

Message ID 20240523154743.24154-1-tdevries@suse.de
State Committed
Headers
Series [gdb/testsuite] Add PR26286 kfail in gdb.threads/attach-many-short-lived-threads.exp |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_gdb_build--master-aarch64 success Testing passed
linaro-tcwg-bot/tcwg_gdb_build--master-arm success Testing passed
linaro-tcwg-bot/tcwg_gdb_check--master-arm success Testing passed
linaro-tcwg-bot/tcwg_gdb_check--master-aarch64 success Testing passed

Commit Message

Tom de Vries May 23, 2024, 3:47 p.m. UTC
  When running test-case gdb.threads/attach-many-short-lived-threads.exp, I run
regularly into PR26286:
...
(gdb) continue^M
Continuing.^M
[LWP ... exited]^M
  ...
[LWP ... exited]^M
^M
Program terminated with signal SIGTRAP, Trace/breakpoint trap.^M
The program no longer exists.^M
(gdb) FAIL: gdb.threads/attach-many-short-lived-threads.exp: iter 9: \
  break at break_fn: 1
...

Add a kfail for this, such that we have:
...
(gdb) KFAIL: gdb.threads/attach-many-short-lived-threads.exp: iter 9: \
  break at break_fn: 1 (PRMS: threads/26286)
...

Tested on x86_64-linux.
---
 .../attach-many-short-lived-threads.exp       | 25 ++++++++++++++++++-
 1 file changed, 24 insertions(+), 1 deletion(-)


base-commit: d3daf5a2ba551707c74813e80be2b53d63a73a25
  

Comments

Thiago Jung Bauermann May 24, 2024, 1:57 a.m. UTC | #1
Hello Tom,

Tom de Vries <tdevries@suse.de> writes:

> When running test-case gdb.threads/attach-many-short-lived-threads.exp, I run
> regularly into PR26286:
> ...
> (gdb) continue^M
> Continuing.^M
> [LWP ... exited]^M
>   ...
> [LWP ... exited]^M
> ^M
> Program terminated with signal SIGTRAP, Trace/breakpoint trap.^M
> The program no longer exists.^M
> (gdb) FAIL: gdb.threads/attach-many-short-lived-threads.exp: iter 9: \
>   break at break_fn: 1
> ...
>
> Add a kfail for this, such that we have:
> ...
> (gdb) KFAIL: gdb.threads/attach-many-short-lived-threads.exp: iter 9: \
>   break at break_fn: 1 (PRMS: threads/26286)
> ...
>
> Tested on x86_64-linux.

Good idea. Looks good to me.

Reviewed-by: Thiago Jung Bauermann <thiago.bauermann@linaro.org>
  
Tom de Vries May 24, 2024, 7:38 a.m. UTC | #2
On 5/24/24 03:57, Thiago Jung Bauermann wrote:
> Hello Tom,
> 
> Tom de Vries <tdevries@suse.de> writes:
> 
>> When running test-case gdb.threads/attach-many-short-lived-threads.exp, I run
>> regularly into PR26286:
>> ...
>> (gdb) continue^M
>> Continuing.^M
>> [LWP ... exited]^M
>>    ...
>> [LWP ... exited]^M
>> ^M
>> Program terminated with signal SIGTRAP, Trace/breakpoint trap.^M
>> The program no longer exists.^M
>> (gdb) FAIL: gdb.threads/attach-many-short-lived-threads.exp: iter 9: \
>>    break at break_fn: 1
>> ...
>>
>> Add a kfail for this, such that we have:
>> ...
>> (gdb) KFAIL: gdb.threads/attach-many-short-lived-threads.exp: iter 9: \
>>    break at break_fn: 1 (PRMS: threads/26286)
>> ...
>>
>> Tested on x86_64-linux.
> 
> Good idea. Looks good to me.
> 
> Reviewed-by: Thiago Jung Bauermann <thiago.bauermann@linaro.org>
> 

Thanks for the review, pushed.

Thanks,
- Tom
  

Patch

diff --git a/gdb/testsuite/gdb.threads/attach-many-short-lived-threads.exp b/gdb/testsuite/gdb.threads/attach-many-short-lived-threads.exp
index 6bee0ad2e2c..88834850042 100644
--- a/gdb/testsuite/gdb.threads/attach-many-short-lived-threads.exp
+++ b/gdb/testsuite/gdb.threads/attach-many-short-lived-threads.exp
@@ -141,9 +141,32 @@  proc test {} {
 	    # attach.
 	    sleep 2
 
+	    set re_pr26286 \
+		[multi_line \
+		     [string_to_regexp \
+			  "Program terminated with signal SIGTRAP, Trace/breakpoint trap."] \
+		     [string_to_regexp \
+			  "The program no longer exists."]]
+
 	    set bps 3
+	    set exited 0
 	    for {set bp 1} { $bp <= $bps } { incr bp } {
-		gdb_test "continue" "Breakpoint.*" "break at break_fn: $bp"
+		gdb_test_multiple "continue" "break at break_fn: $bp" {
+		    -re -wrap "$re_pr26286" {
+			kfail threads/26286 $gdb_test_name
+			set exited 1
+		    }
+		    -re -wrap "Breakpoint.*" {
+			pass $gdb_test_name
+		    }
+		}
+		if { $exited } {
+		    break
+		}
+	    }
+
+	    if { $exited } {
+		return
 	    }
 
 	    if {$attempt < $attempts} {