From patchwork Fri Mar 8 09:33:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom de Vries X-Patchwork-Id: 86965 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 56B30385C424 for ; Fri, 8 Mar 2024 10:30:39 +0000 (GMT) X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) by sourceware.org (Postfix) with ESMTPS id 249983858D38 for ; Fri, 8 Mar 2024 10:30:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 249983858D38 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 249983858D38 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=195.135.223.130 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1709893820; cv=none; b=NXYQG9P5dPqOEDriwY8HjExY4eJaFjdhLB6uqXnPWS6U5oPraY20xd1sBfufog9E10KcAPLlUHX9e/2FEbbcApBN1rbcQTT8VfeQE0+hP3lIK4czCT6VebwmsIwnhtyLpjdvly7rZFnjWmyVOr/tH1JrFMEaiMwPEJvyvnpu0iE= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1709893820; c=relaxed/simple; bh=R4i3eWGqTGySPR622oCpmiARc3sGQUGRaCxlML2T+nk=; h=DKIM-Signature:DKIM-Signature:DKIM-Signature:DKIM-Signature:From: To:Subject:Date:Message-Id:MIME-Version; b=JevoxVhm+KfcwoOkL445wydYeUExh+umFOLarQvfPkEaDBQEeyeoIqx8VKzqwf8hhlAp4f3lIjHFB3tyM5Zj6u9lS+fZ4zhYqPAD57oQxE7OrRwJMeej1FwXQm++GK0R0R84h/HmOTLiFsmod0wjIIi8JfeTiWlPAPiQo5gVXmo= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 34BA017158 for ; Fri, 8 Mar 2024 09:33:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1709890386; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=xXhNy1SQOl8MgjMuihXwGU2rTiJNcHeP/7fNwIPvqFs=; b=vKzS84J9bpsJGf13gLVBrR+leB+PPGYfKU+wMZBMh3N3XvMF/L/mc6H6qLvjuHEJ2Kcfwo KkQtBkY/xyph+wzD2RFDfz0Ot8Jygxvc3TrP4TPGEjy+PpYPsrJpd6NZLZKO7L505AZZrw RCIHUgTJBDOsQAcL+cWanEpe0tzbyHg= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1709890386; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=xXhNy1SQOl8MgjMuihXwGU2rTiJNcHeP/7fNwIPvqFs=; b=1WONzbuFZViSxiuZtUa32NLOiI+VfP7UHx9CSCpOF/JsSGKKADjHLFfRh4OkbQpJkI4i3T EAL1/pMbDUAlE9AQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1709890386; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=xXhNy1SQOl8MgjMuihXwGU2rTiJNcHeP/7fNwIPvqFs=; b=vKzS84J9bpsJGf13gLVBrR+leB+PPGYfKU+wMZBMh3N3XvMF/L/mc6H6qLvjuHEJ2Kcfwo KkQtBkY/xyph+wzD2RFDfz0Ot8Jygxvc3TrP4TPGEjy+PpYPsrJpd6NZLZKO7L505AZZrw RCIHUgTJBDOsQAcL+cWanEpe0tzbyHg= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1709890386; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=xXhNy1SQOl8MgjMuihXwGU2rTiJNcHeP/7fNwIPvqFs=; b=1WONzbuFZViSxiuZtUa32NLOiI+VfP7UHx9CSCpOF/JsSGKKADjHLFfRh4OkbQpJkI4i3T EAL1/pMbDUAlE9AQ== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 1964913786 for ; Fri, 8 Mar 2024 09:33:05 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id 0KAHBVHb6mWLYAAAD6G6ig (envelope-from ) for ; Fri, 08 Mar 2024 09:33:05 +0000 From: Tom de Vries To: gdb-patches@sourceware.org Subject: [PATCH v4 1/6] gdb/testsuite: Reduce indentation in gdb.threads/threadcrash.exp Date: Fri, 8 Mar 2024 10:33:37 +0100 Message-Id: <20240308093342.26745-2-tdevries@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20240308093342.26745-1-tdevries@suse.de> References: <20240308093342.26745-1-tdevries@suse.de> MIME-Version: 1.0 Authentication-Results: smtp-out1.suse.de; none X-Spam-Score: 3.52 X-Spamd-Result: default: False [3.52 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; R_MISSING_CHARSET(2.50)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[gdb-patches@sourceware.org]; BROKEN_CONTENT_TYPE(1.50)[]; RCPT_COUNT_ONE(0.00)[1]; NEURAL_HAM_LONG(-1.00)[-1.000]; RCVD_COUNT_THREE(0.00)[3]; TO_DN_NONE(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MID_CONTAINS_FROM(1.00)[]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_ALL(0.00)[]; BAYES_HAM(-0.18)[70.49%] X-Spam-Status: No, score=-12.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org In test-case gdb.threads/threadcrash.exp we have an unnecessarily indented gdb_test_multiple: ... gdb_test_multiple "thread apply all backtrace" \ "Get thread information" -lbl { -re "#\[0-9\]+\\\?\\\?\[^\n\]*" { ... Fix this by moving the command into a variable, allowing the "gdb_test_multiple ... {" to fit on a single 80 chars line. Tested on arm-linux and x86_64-linux. --- gdb/testsuite/gdb.threads/threadcrash.exp | 116 +++++++++++----------- 1 file changed, 58 insertions(+), 58 deletions(-) diff --git a/gdb/testsuite/gdb.threads/threadcrash.exp b/gdb/testsuite/gdb.threads/threadcrash.exp index 996e020d1e8..3d269ec88c5 100644 --- a/gdb/testsuite/gdb.threads/threadcrash.exp +++ b/gdb/testsuite/gdb.threads/threadcrash.exp @@ -53,64 +53,64 @@ proc thread_apply_all {} { set unwind_fail false - gdb_test_multiple "thread apply all backtrace" \ - "Get thread information" -lbl { - -re "#\[0-9\]+\\\?\\\?\[^\n\]*" { - set unwind_fail true - exp_continue - } - -re "\[^\n\]*syscall_task .location=SIGNAL_ALT_STACK\[^\n\]*" { - lappend test_list [multi_line ".*sleep.*" \ - ".*do_syscall_task .location=SIGNAL_ALT_STACK.*" \ - ".*signal_handler.*" \ - ".*signal handler called.*" \ - ".*pthread_kill.*" \ - ".*thread_function.*"] - exp_continue - } - -re "\[^\n\]*syscall_task .location=SIGNAL_HANDLER\[^\n\]*" { - lappend test_list [multi_line ".*sleep.*" \ - ".*do_syscall_task .location=SIGNAL_HANDLER.*" \ - ".*signal_handler.*" \ - ".*signal handler called.*" \ - ".*pthread_kill.*" \ - ".*thread_function.*"] - exp_continue - } - -re "\[^\n\]*syscall_task .location=NORMAL\[^\n\]*" { - lappend test_list [multi_line ".*sleep.*" \ - ".*do_syscall_task .location=NORMAL.*" \ - ".*thread_function.*"] - exp_continue - } - -re "\[^\n\]*spin_task .location=SIGNAL_ALT_STACK\[^\n\]*" { - lappend test_list [multi_line ".*do_spin_task .location=SIGNAL_ALT_STACK.*" \ - ".*signal_handler.*" \ - ".*signal handler called.*" \ - ".*pthread_kill.*" \ - ".*thread_function.*"] - exp_continue - } - -re "\[^\n\]*spin_task .location=SIGNAL_HANDLER\[^\n\]*" { - lappend test_list [multi_line ".*do_spin_task .location=SIGNAL_HANDLER.*" \ - ".*signal_handler.*" \ - ".*signal handler called.*" \ - ".*pthread_kill.*" \ - ".*thread_function.*"] - exp_continue - } - -re "\[^\n\]*spin_task .location=NORMAL\[^\n\]*" { - lappend test_list [multi_line ".*do_spin_task .location=NORMAL..*" \ - ".*thread_function.*"] - exp_continue - } - -re "\[^\n\]*main\[^\n\]*" { - lappend test_list ".*main.*" - exp_continue - } - -re "$::gdb_prompt " { - pass $gdb_test_name - } + set cmd "thread apply all backtrace" + gdb_test_multiple $cmd "Get thread information" -lbl { + -re "#\[0-9\]+\\\?\\\?\[^\n\]*" { + set unwind_fail true + exp_continue + } + -re "\[^\n\]*syscall_task .location=SIGNAL_ALT_STACK\[^\n\]*" { + lappend test_list [multi_line ".*sleep.*" \ + ".*do_syscall_task .location=SIGNAL_ALT_STACK.*" \ + ".*signal_handler.*" \ + ".*signal handler called.*" \ + ".*pthread_kill.*" \ + ".*thread_function.*"] + exp_continue + } + -re "\[^\n\]*syscall_task .location=SIGNAL_HANDLER\[^\n\]*" { + lappend test_list [multi_line ".*sleep.*" \ + ".*do_syscall_task .location=SIGNAL_HANDLER.*" \ + ".*signal_handler.*" \ + ".*signal handler called.*" \ + ".*pthread_kill.*" \ + ".*thread_function.*"] + exp_continue + } + -re "\[^\n\]*syscall_task .location=NORMAL\[^\n\]*" { + lappend test_list [multi_line ".*sleep.*" \ + ".*do_syscall_task .location=NORMAL.*" \ + ".*thread_function.*"] + exp_continue + } + -re "\[^\n\]*spin_task .location=SIGNAL_ALT_STACK\[^\n\]*" { + lappend test_list [multi_line ".*do_spin_task .location=SIGNAL_ALT_STACK.*" \ + ".*signal_handler.*" \ + ".*signal handler called.*" \ + ".*pthread_kill.*" \ + ".*thread_function.*"] + exp_continue + } + -re "\[^\n\]*spin_task .location=SIGNAL_HANDLER\[^\n\]*" { + lappend test_list [multi_line ".*do_spin_task .location=SIGNAL_HANDLER.*" \ + ".*signal_handler.*" \ + ".*signal handler called.*" \ + ".*pthread_kill.*" \ + ".*thread_function.*"] + exp_continue + } + -re "\[^\n\]*spin_task .location=NORMAL\[^\n\]*" { + lappend test_list [multi_line ".*do_spin_task .location=NORMAL..*" \ + ".*thread_function.*"] + exp_continue + } + -re "\[^\n\]*main\[^\n\]*" { + lappend test_list ".*main.*" + exp_continue + } + -re "$::gdb_prompt " { + pass $gdb_test_name + } } gdb_assert {$unwind_fail == false} From patchwork Fri Mar 8 09:33:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom de Vries X-Patchwork-Id: 86970 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id C72A6385DC06 for ; Fri, 8 Mar 2024 12:06:25 +0000 (GMT) X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2a07:de40:b251:101:10:150:64:1]) by sourceware.org (Postfix) with ESMTPS id 4AA8D3858D38 for ; Fri, 8 Mar 2024 12:06:00 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 4AA8D3858D38 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 4AA8D3858D38 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a07:de40:b251:101:10:150:64:1 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1709899562; cv=none; b=NIwpqqtaz3on5HcYJc4YGf7YvEdQ0CFNl03ENoAw57ajlWn0UxjtkqV2UTYcL7/SpTgEpEp7FZbf0Zyf25dX+R+s+xige74Mf+ljNWdCuw6YbRdPv4Exbs37xxEpFKonhTGC/8Og5mH8MLfcgZRiwJ+YsWrVu0TKmEmtzyMYEnM= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1709899562; c=relaxed/simple; bh=xruwDQc9YTNLL8kosJ1V8Em+fS3O+DxPS/P/Kn6G8E4=; h=DKIM-Signature:DKIM-Signature:DKIM-Signature:DKIM-Signature:From: To:Subject:Date:Message-Id:MIME-Version; b=q3ZliI7Pcs5H7e+NOvogANq1BQzkqe89NnGfQ+hUllEBWbM68fAdncPvPkRtp4pDJ9ujFzujNqmisa1OnNdrluoDvc06/8fxOWA8ckUD/JHjPI6bfs5I4IgyLAFafH3Kjh/srJje/RcN83ERWx+5daStlw9in6PP1km3TyPz4Eg= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 59A991715A for ; Fri, 8 Mar 2024 09:33:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1709890386; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=MqZoqKqloAGayzfNCARmH5VrZtWXyH0aQCZ7ZvMrGfo=; b=My6Y3uod/3t11qjFWHGIBbz66VDPyisT949V4n/QHgadPffHns53syAW8wzknk+dn2stKE D9j0ltHic7Gk7M3+e3GXCBLGmZqvG6PS5q0i2lyDjK2BI51XE2KBjwDoDtprl9JG9Pnd9G AX38zL0VfmJGNVOBt450VtfNjdnYX6E= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1709890386; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=MqZoqKqloAGayzfNCARmH5VrZtWXyH0aQCZ7ZvMrGfo=; b=XY2P6h5es0QA2SFRIc2znPLajC3iy22/i+jQC09gVBf67KVec/iojKiTZSKHpRG4b+tAcU NeGtqh4vHTpp53AQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1709890386; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=MqZoqKqloAGayzfNCARmH5VrZtWXyH0aQCZ7ZvMrGfo=; b=My6Y3uod/3t11qjFWHGIBbz66VDPyisT949V4n/QHgadPffHns53syAW8wzknk+dn2stKE D9j0ltHic7Gk7M3+e3GXCBLGmZqvG6PS5q0i2lyDjK2BI51XE2KBjwDoDtprl9JG9Pnd9G AX38zL0VfmJGNVOBt450VtfNjdnYX6E= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1709890386; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=MqZoqKqloAGayzfNCARmH5VrZtWXyH0aQCZ7ZvMrGfo=; b=XY2P6h5es0QA2SFRIc2znPLajC3iy22/i+jQC09gVBf67KVec/iojKiTZSKHpRG4b+tAcU NeGtqh4vHTpp53AQ== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 32AC71378C for ; Fri, 8 Mar 2024 09:33:05 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id UOc1C1Hb6mWLYAAAD6G6ig (envelope-from ) for ; Fri, 08 Mar 2024 09:33:05 +0000 From: Tom de Vries To: gdb-patches@sourceware.org Subject: [PATCH v4 2/6] gdb/testsuite: Fix gdb.threads/threadcrash.exp with check-readmore Date: Fri, 8 Mar 2024 10:33:38 +0100 Message-Id: <20240308093342.26745-3-tdevries@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20240308093342.26745-1-tdevries@suse.de> References: <20240308093342.26745-1-tdevries@suse.de> MIME-Version: 1.0 X-Spam-Level: Authentication-Results: smtp-out1.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=My6Y3uod; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=XY2P6h5e X-Rspamd-Server: rspamd2.dmz-prg2.suse.org X-Spamd-Result: default: False [-1.51 / 50.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:106:10:150:64:167:received]; R_MISSING_CHARSET(2.50)[]; TO_DN_NONE(0.00)[]; BROKEN_CONTENT_TYPE(1.50)[]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[suse.de:+]; MX_GOOD(-0.01)[]; NEURAL_HAM_SHORT(-0.20)[-1.000]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; BAYES_HAM(-3.00)[100.00%]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; FROM_HAS_DN(0.00)[]; DWL_DNSWL_MED(-2.00)[suse.de:dkim]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[gdb-patches@sourceware.org]; RCPT_COUNT_ONE(0.00)[1]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; MID_CONTAINS_FROM(1.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:dkim]; FUZZY_BLOCKED(0.00)[rspamd.com]; RCVD_TLS_ALL(0.00)[] X-Spam-Score: -1.51 X-Rspamd-Queue-Id: 59A991715A X-Spam-Status: No, score=-12.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org With check-readmore, I run into: ... FAIL: gdb.threads/threadcrash.exp: test_corefile: \ $thread_count == [llength $test_list] ... The problem is that the clauses in the gdb_test_multiple for "thread apply all backtrace" intent to match one line, but actually can match more than one line, and consequently a match for one type of thread can consume a line that was supposed to match another thread. For instance, there's this regexp: ... -re "\[^\n\]*syscall_task .location=SIGNAL_ALT_STACK\[^\n\]*" { ... It's limited at the end by \[^\n\]*, meaning the match stops at the end of the line. But it doesn't start with a ^, and consequently can match more than one line. The "\[^\n\]*" at the start doesn't prevent this, there's an implicit .* at the start of each pattern, unless it's anchored using a ^. Fix this by rewriting the regexps in a "^\r\n$hs$regexp$hs$eol" style, where: - hs is: \[^\n\]* (horizontal space), and - eol is (?=\r\n) (look-ahead end-of-line). It also turned out to be necessary to drop the -lbl switch, and introduce a corresponding explicit clause. The -lbl clause is placed ALAP, and consequently allowed the default fail clause to trigger. Tested on arm-linux and x86_64-linux. --- gdb/testsuite/gdb.threads/threadcrash.exp | 29 +++++++++++++++-------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/gdb/testsuite/gdb.threads/threadcrash.exp b/gdb/testsuite/gdb.threads/threadcrash.exp index 3d269ec88c5..592098b9c38 100644 --- a/gdb/testsuite/gdb.threads/threadcrash.exp +++ b/gdb/testsuite/gdb.threads/threadcrash.exp @@ -53,13 +53,19 @@ proc thread_apply_all {} { set unwind_fail false + set eol "(?=\r\n)" + set hs "\[^\r\n\]*" + set cmd "thread apply all backtrace" - gdb_test_multiple $cmd "Get thread information" -lbl { - -re "#\[0-9\]+\\\?\\\?\[^\n\]*" { + gdb_test_multiple $cmd "Get thread information" { + -re "^$cmd$eol" { + exp_continue + } + -re "^\r\n#$::decimal\\\?\\\?$hs$eol" { set unwind_fail true exp_continue } - -re "\[^\n\]*syscall_task .location=SIGNAL_ALT_STACK\[^\n\]*" { + -re "^\r\n${hs}syscall_task .location=SIGNAL_ALT_STACK$hs$eol" { lappend test_list [multi_line ".*sleep.*" \ ".*do_syscall_task .location=SIGNAL_ALT_STACK.*" \ ".*signal_handler.*" \ @@ -68,7 +74,7 @@ proc thread_apply_all {} { ".*thread_function.*"] exp_continue } - -re "\[^\n\]*syscall_task .location=SIGNAL_HANDLER\[^\n\]*" { + -re "^\r\n${hs}syscall_task .location=SIGNAL_HANDLER$hs$eol" { lappend test_list [multi_line ".*sleep.*" \ ".*do_syscall_task .location=SIGNAL_HANDLER.*" \ ".*signal_handler.*" \ @@ -77,13 +83,13 @@ proc thread_apply_all {} { ".*thread_function.*"] exp_continue } - -re "\[^\n\]*syscall_task .location=NORMAL\[^\n\]*" { + -re "^\r\n${hs}syscall_task .location=NORMAL$hs$eol" { lappend test_list [multi_line ".*sleep.*" \ ".*do_syscall_task .location=NORMAL.*" \ ".*thread_function.*"] exp_continue } - -re "\[^\n\]*spin_task .location=SIGNAL_ALT_STACK\[^\n\]*" { + -re "^\r\n${hs}spin_task .location=SIGNAL_ALT_STACK$hs$eol" { lappend test_list [multi_line ".*do_spin_task .location=SIGNAL_ALT_STACK.*" \ ".*signal_handler.*" \ ".*signal handler called.*" \ @@ -91,7 +97,7 @@ proc thread_apply_all {} { ".*thread_function.*"] exp_continue } - -re "\[^\n\]*spin_task .location=SIGNAL_HANDLER\[^\n\]*" { + -re "^\r\n${hs}spin_task .location=SIGNAL_HANDLER$hs$eol" { lappend test_list [multi_line ".*do_spin_task .location=SIGNAL_HANDLER.*" \ ".*signal_handler.*" \ ".*signal handler called.*" \ @@ -99,16 +105,19 @@ proc thread_apply_all {} { ".*thread_function.*"] exp_continue } - -re "\[^\n\]*spin_task .location=NORMAL\[^\n\]*" { + -re "^\r\n${hs}spin_task .location=NORMAL$hs$eol" { lappend test_list [multi_line ".*do_spin_task .location=NORMAL..*" \ ".*thread_function.*"] exp_continue } - -re "\[^\n\]*main\[^\n\]*" { + -re "^\r\n${hs}main$hs$eol" { lappend test_list ".*main.*" exp_continue } - -re "$::gdb_prompt " { + -re "^\r\n$hs$eol" { + exp_continue + } + -re "^\r\n$::gdb_prompt $" { pass $gdb_test_name } } From patchwork Fri Mar 8 09:33:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom de Vries X-Patchwork-Id: 86962 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 81C5B385DC0A for ; Fri, 8 Mar 2024 09:54:38 +0000 (GMT) X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) by sourceware.org (Postfix) with ESMTPS id 90EC23858D35 for ; Fri, 8 Mar 2024 09:54:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 90EC23858D35 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 90EC23858D35 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=195.135.223.130 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1709891654; cv=none; b=faKNYKLJy1jwehD4iKtHLRXPjdddnDyQ2DVSY3OafcX7EU9174VAO1mDS8H90DJsSOvtMTFcLwvb1EPerccBsrjBxPWktGD7TpPfLs8XQpGGwlWDXJ+NPnJ6VNaKNWFqI79fiZBy4/iPYUnPKCclLvymj/4uGPfMnddfhn/6Ly4= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1709891654; c=relaxed/simple; bh=njgutfkh/e9pnQs7yRv1bmEuh6TTzw4G+CMX4wVhYtc=; h=DKIM-Signature:DKIM-Signature:DKIM-Signature:DKIM-Signature:From: To:Subject:Date:Message-Id:MIME-Version; b=xJScAgp1xWbLXE2pf7xKtSsjBYpTrkhLVocuWy/kVo8dbbyzypHqVyUJvNi4H8dZFd+he/G2FbMpgJIK+Ls0s4eEk1L8F1UU7NyDNnIyNGwbV9jIYqWVo2+z9iX3DiyBwFqNdTB2J9JL/mhqkIOkPVcJttNOOUu3PeonYtPlsA4= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 68F3B1715B for ; Fri, 8 Mar 2024 09:33:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1709890386; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=J7HtjsTrc1sdbgz7/pa7QmX8daW6eIfOQIqOtZqE+J4=; b=cQWp4c62U3aZ7aTVfXZ3ui0uZHXFigVtfkKKthTtNWeMfc6lLsEmpMI8cieBmAtmQgZks6 MoQ4lwm8tiRotAKSVu4cJN1JzZ2YufC5/ImTpls/SaPBwtnHbzdbD4UgUzfltEYYbM4Aq5 Y5VkBySlsVxcNogdwFQnBRAZPxnzQZk= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1709890386; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=J7HtjsTrc1sdbgz7/pa7QmX8daW6eIfOQIqOtZqE+J4=; b=88azIiGI3VVHmtu6GYyKmtvTB48hXvPpAEbrQh4/CcJa9J3tgiAbEs9l62yTU2EQNAoBVr 5pX+u4LMnxzdIfDQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1709890386; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=J7HtjsTrc1sdbgz7/pa7QmX8daW6eIfOQIqOtZqE+J4=; b=cQWp4c62U3aZ7aTVfXZ3ui0uZHXFigVtfkKKthTtNWeMfc6lLsEmpMI8cieBmAtmQgZks6 MoQ4lwm8tiRotAKSVu4cJN1JzZ2YufC5/ImTpls/SaPBwtnHbzdbD4UgUzfltEYYbM4Aq5 Y5VkBySlsVxcNogdwFQnBRAZPxnzQZk= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1709890386; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=J7HtjsTrc1sdbgz7/pa7QmX8daW6eIfOQIqOtZqE+J4=; b=88azIiGI3VVHmtu6GYyKmtvTB48hXvPpAEbrQh4/CcJa9J3tgiAbEs9l62yTU2EQNAoBVr 5pX+u4LMnxzdIfDQ== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 4B93A13795 for ; Fri, 8 Mar 2024 09:33:05 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id 0I4/EVHb6mWLYAAAD6G6ig (envelope-from ) for ; Fri, 08 Mar 2024 09:33:05 +0000 From: Tom de Vries To: gdb-patches@sourceware.org Subject: [PATCH v4 3/6] gdb/testsuite: Use _inferior_thread_count in gdb.threads/threadcrash.exp Date: Fri, 8 Mar 2024 10:33:39 +0100 Message-Id: <20240308093342.26745-4-tdevries@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20240308093342.26745-1-tdevries@suse.de> References: <20240308093342.26745-1-tdevries@suse.de> MIME-Version: 1.0 X-Spamd-Bar: ++++ Authentication-Results: smtp-out1.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=cQWp4c62; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=88azIiGI X-Spamd-Result: default: False [4.39 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; FROM_HAS_DN(0.00)[]; RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:106:10:150:64:167:received]; R_MISSING_CHARSET(2.50)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[gdb-patches@sourceware.org]; BROKEN_CONTENT_TYPE(1.50)[]; RCPT_COUNT_ONE(0.00)[1]; RCVD_COUNT_THREE(0.00)[3]; TO_DN_NONE(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; DKIM_TRACE(0.00)[suse.de:+]; MX_GOOD(-0.01)[]; MID_CONTAINS_FROM(1.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[amd.com:email,suse.de:dkim]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_ALL(0.00)[]; BAYES_HAM(-0.30)[75.01%] X-Spam-Score: 4.39 X-Rspamd-Queue-Id: 68F3B1715B X-Rspamd-Server: rspamd1.dmz-prg2.suse.org X-Spam-Status: No, score=-12.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org From: Guinevere Larsen A linaro PR [1] reports that the gdb.threads/threadcrash.exp test-case fails to cout the number of threads in the inferior: ... FAIL: gdb.threads/threadcrash.exp: test_gcore: $thread_count == 7 FAIL: gdb.threads/threadcrash.exp: test_gcore: $thread_count == [llength $test_list] ... Fix this by getting the convenience variable _inferior_thread_count as opposed to calculating it based on the output of "info threads". Tested on arm-linux and x86_64-linux. Reviewed-By: Lancelot Six [1] https://linaro.atlassian.net/browse/GNU-1120 --- gdb/testsuite/gdb.threads/threadcrash.exp | 23 ++--------------------- 1 file changed, 2 insertions(+), 21 deletions(-) diff --git a/gdb/testsuite/gdb.threads/threadcrash.exp b/gdb/testsuite/gdb.threads/threadcrash.exp index 592098b9c38..966708acd96 100644 --- a/gdb/testsuite/gdb.threads/threadcrash.exp +++ b/gdb/testsuite/gdb.threads/threadcrash.exp @@ -20,26 +20,6 @@ # a gcore. -# Check that the inferior has 7 threads, and return the number of threads (7). -# We return the thread count so that, even if there is some error in the test, -# the final log doesn't get flooded with failures. - -proc test_thread_count {} { - set thread_count 0 - - gdb_test_multiple "info threads" "getting thread count" -lbl { - -re "Thread" { - incr thread_count - exp_continue - } - -re "$::gdb_prompt " { - gdb_assert {$thread_count == 7} - } - } - - return $thread_count -} - # Use 'thread apply all backtrace' to check if all expected threads # are present, and stopped in the expected locations. Set the global # TEST_LIST to be the a list of regexps expected to match all the @@ -132,7 +112,8 @@ proc thread_apply_all {} { proc do_full_test {} { global test_list - set thread_count [test_thread_count] + set thread_count [get_valueof "" "\$_inferior_thread_count" 0] + gdb_assert {$thread_count == 7} thread_apply_all From patchwork Fri Mar 8 09:33:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom de Vries X-Patchwork-Id: 86969 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id ECE9E3860006 for ; Fri, 8 Mar 2024 12:00:28 +0000 (GMT) X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) by sourceware.org (Postfix) with ESMTPS id 2D8573858415 for ; Fri, 8 Mar 2024 11:59:58 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 2D8573858415 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 2D8573858415 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=195.135.223.130 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1709899200; cv=none; b=ERvctlrQQklT4Vft3qbHEhYfFEDbQhjvGBdVBmugTuFwVUKfZ0mQZKElgymtTbXe+4s+gZOtbPV0q7iKDVEmzVibDEYZhSH56jBicjuTIXkhuXKQ8qF/66zdUY+84kJflnvCtY6RLjT2VLhpK6W9lNGjhwTqcRNUF/staciLQzQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1709899200; c=relaxed/simple; bh=A7I9xAjus1WidNkwBCm0SU5F2fzLW7Eyr5zbPa+vh/I=; h=DKIM-Signature:DKIM-Signature:DKIM-Signature:DKIM-Signature:From: To:Subject:Date:Message-Id:MIME-Version; b=az7TUsSMFDknXympKH8v+bRjpDkiwSdm/oRLVzkpLuuWuh2oz/co68/sMXMdvc9OWO/pjmzhtAwpC35zf7sKnGUFauqClqey9himPB+uuSgDyAXlGM7cOoH2GzW0LSvrRG+5qDwlJsZnmRh0mcNrKZpzMNSbEUhbdmTlhij2/ck= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 822AE1715E for ; Fri, 8 Mar 2024 09:33:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1709890386; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=YCv4q0qj8HyLqA2DWYVepJ3d47RgSLc9r2cxlnTxCug=; b=c47KGVbIj2upGGosr/NOaA/xBG4PF/5hSX5LNrFFmDfeVPfWL46R/3fg3Ry3Hi9gC31e/d Jv6xMO18eGZ4l+YTO2R8lE8aZ205eOW8SrIJZrVbNM4EfSmLTaHlO2afuYvMqf9ictCvz3 /on15OOOkW4AKtcii1JAa7RHCGJMJjw= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1709890386; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=YCv4q0qj8HyLqA2DWYVepJ3d47RgSLc9r2cxlnTxCug=; b=gLOnuxiSam4EvI0nIPCwL53vqfMCK8Np4I7ytxXE7SujGNGmB4hbvnHn4nFqx3tXsAnxt/ GKHEiRi+N4tbw3DA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1709890386; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=YCv4q0qj8HyLqA2DWYVepJ3d47RgSLc9r2cxlnTxCug=; b=c47KGVbIj2upGGosr/NOaA/xBG4PF/5hSX5LNrFFmDfeVPfWL46R/3fg3Ry3Hi9gC31e/d Jv6xMO18eGZ4l+YTO2R8lE8aZ205eOW8SrIJZrVbNM4EfSmLTaHlO2afuYvMqf9ictCvz3 /on15OOOkW4AKtcii1JAa7RHCGJMJjw= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1709890386; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=YCv4q0qj8HyLqA2DWYVepJ3d47RgSLc9r2cxlnTxCug=; b=gLOnuxiSam4EvI0nIPCwL53vqfMCK8Np4I7ytxXE7SujGNGmB4hbvnHn4nFqx3tXsAnxt/ GKHEiRi+N4tbw3DA== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 653571379A for ; Fri, 8 Mar 2024 09:33:05 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id EOV6F1Hb6mWLYAAAD6G6ig (envelope-from ) for ; Fri, 08 Mar 2024 09:33:05 +0000 From: Tom de Vries To: gdb-patches@sourceware.org Subject: [PATCH v4 4/6] gdb/testsuite: Simplify gdb.threads/threadcrash.exp Date: Fri, 8 Mar 2024 10:33:40 +0100 Message-Id: <20240308093342.26745-5-tdevries@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20240308093342.26745-1-tdevries@suse.de> References: <20240308093342.26745-1-tdevries@suse.de> MIME-Version: 1.0 X-Spamd-Bar: +++ Authentication-Results: smtp-out1.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=c47KGVbI; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=gLOnuxiS X-Spamd-Result: default: False [3.77 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; URIBL_BLOCKED(0.00)[suse.de:dkim]; FROM_HAS_DN(0.00)[]; RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:106:10:150:64:167:received]; R_MISSING_CHARSET(2.50)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[gdb-patches@sourceware.org]; BROKEN_CONTENT_TYPE(1.50)[]; RCPT_COUNT_ONE(0.00)[1]; RCVD_COUNT_THREE(0.00)[3]; TO_DN_NONE(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; DKIM_TRACE(0.00)[suse.de:+]; MX_GOOD(-0.01)[]; MID_CONTAINS_FROM(1.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:dkim]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_ALL(0.00)[]; BAYES_HAM(-0.92)[86.21%] X-Spam-Score: 3.77 X-Rspamd-Queue-Id: 822AE1715E X-Rspamd-Server: rspamd1.dmz-prg2.suse.org X-Spam-Status: No, score=-12.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org I noticed in gdb.threads/threadcrash.exp that the usage of test_list is somewhat convoluted. Simplify the test-case by storing a classification instead of a pattern in test_list. Tested on arm-linux and x86_64-linux. --- gdb/testsuite/gdb.threads/threadcrash.exp | 89 +++++++++++++++-------- 1 file changed, 60 insertions(+), 29 deletions(-) diff --git a/gdb/testsuite/gdb.threads/threadcrash.exp b/gdb/testsuite/gdb.threads/threadcrash.exp index 966708acd96..16fd7eb4e23 100644 --- a/gdb/testsuite/gdb.threads/threadcrash.exp +++ b/gdb/testsuite/gdb.threads/threadcrash.exp @@ -46,52 +46,31 @@ proc thread_apply_all {} { exp_continue } -re "^\r\n${hs}syscall_task .location=SIGNAL_ALT_STACK$hs$eol" { - lappend test_list [multi_line ".*sleep.*" \ - ".*do_syscall_task .location=SIGNAL_ALT_STACK.*" \ - ".*signal_handler.*" \ - ".*signal handler called.*" \ - ".*pthread_kill.*" \ - ".*thread_function.*"] + lappend test_list 1 exp_continue } -re "^\r\n${hs}syscall_task .location=SIGNAL_HANDLER$hs$eol" { - lappend test_list [multi_line ".*sleep.*" \ - ".*do_syscall_task .location=SIGNAL_HANDLER.*" \ - ".*signal_handler.*" \ - ".*signal handler called.*" \ - ".*pthread_kill.*" \ - ".*thread_function.*"] + lappend test_list 2 exp_continue } -re "^\r\n${hs}syscall_task .location=NORMAL$hs$eol" { - lappend test_list [multi_line ".*sleep.*" \ - ".*do_syscall_task .location=NORMAL.*" \ - ".*thread_function.*"] + lappend test_list 3 exp_continue } -re "^\r\n${hs}spin_task .location=SIGNAL_ALT_STACK$hs$eol" { - lappend test_list [multi_line ".*do_spin_task .location=SIGNAL_ALT_STACK.*" \ - ".*signal_handler.*" \ - ".*signal handler called.*" \ - ".*pthread_kill.*" \ - ".*thread_function.*"] + lappend test_list 4 exp_continue } -re "^\r\n${hs}spin_task .location=SIGNAL_HANDLER$hs$eol" { - lappend test_list [multi_line ".*do_spin_task .location=SIGNAL_HANDLER.*" \ - ".*signal_handler.*" \ - ".*signal handler called.*" \ - ".*pthread_kill.*" \ - ".*thread_function.*"] + lappend test_list 5 exp_continue } -re "^\r\n${hs}spin_task .location=NORMAL$hs$eol" { - lappend test_list [multi_line ".*do_spin_task .location=NORMAL..*" \ - ".*thread_function.*"] + lappend test_list 6 exp_continue } -re "^\r\n${hs}main$hs$eol" { - lappend test_list ".*main.*" + lappend test_list 7 exp_continue } -re "^\r\n$hs$eol" { @@ -122,7 +101,59 @@ proc do_full_test {} { for {set i 0} {$i < $thread_count } {incr i} { set thread_num [expr [llength $test_list] - $i] - gdb_test "thread apply $thread_num backtrace" [lindex $test_list $i] + set type [lindex $test_list $i] + if { $type == 1 } { + set re \ + [multi_line \ + ".sleep.*" \ + ".*do_syscall_task .location=SIGNAL_ALT_STACK.*" \ + ".*signal_handler.*" \ + ".*signal handler called.*" \ + ".*pthread_kill.*" \ + ".*thread_function.*"] + } elseif { $type == 2 } { + set re \ + [multi_line \ + ".*sleep.*" \ + ".*do_syscall_task .location=SIGNAL_HANDLER.*" \ + ".*signal_handler.*" \ + ".*signal handler called.*" \ + ".*pthread_kill.*" \ + ".*thread_function.*"] + } elseif { $type == 3 } { + set re \ + [multi_line \ + ".*sleep.*" \ + ".*do_syscall_task .location=NORMAL.*" \ + ".*thread_function.*"] + } elseif { $type == 4 } { + set re \ + [multi_line \ + ".*do_spin_task .location=SIGNAL_ALT_STACK.*" \ + ".*signal_handler.*" \ + ".*signal handler called.*" \ + ".*pthread_kill.*" \ + ".*thread_function.*"] + } elseif { $type == 5 } { + set re \ + [multi_line \ + ".*do_spin_task .location=SIGNAL_HANDLER.*" \ + ".*signal_handler.*" \ + ".*signal handler called.*" \ + ".*pthread_kill.*" \ + ".*thread_function.*"] + } elseif { $type == 6 } { + set re \ + [multi_line \ + ".*do_spin_task .location=NORMAL..*" \ + ".*thread_function.*"] + } elseif { $type == 7 } { + set re ".*main.*" + } else { + error "invalid type: $type" + } + + gdb_test "thread apply $thread_num backtrace" $re } } From patchwork Fri Mar 8 09:33:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom de Vries X-Patchwork-Id: 86961 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 92DFC3857736 for ; Fri, 8 Mar 2024 09:36:16 +0000 (GMT) X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2a07:de40:b251:101:10:150:64:2]) by sourceware.org (Postfix) with ESMTPS id 6AE633858D35 for ; Fri, 8 Mar 2024 09:35:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 6AE633858D35 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 6AE633858D35 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a07:de40:b251:101:10:150:64:2 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1709890553; cv=none; b=aY5dOq6Sx1mNpdx5tbMk3aRwj6Ix2efl5nucfYcmaSrv6UN1ghZWjSOS9qtvGMcYgdg1FxnHyMiGfplGt+rn16TTrqIPQfzLvmvnKd8Rsc5KcCxQgG2j/CmzAqfjJ8JUVGeWZsQvIyxW6LQaeQSGxlmfV/dzSNUp3AxzVSdkjwE= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1709890553; c=relaxed/simple; bh=2TTDivlMXHvVWiQQ64psTSWnZO3824MaRXPzBz0zr9E=; h=DKIM-Signature:DKIM-Signature:DKIM-Signature:DKIM-Signature:From: To:Subject:Date:Message-Id:MIME-Version; b=G2RdpB722qm+ZxzPElUtmWWhA2GHK/qsp5UQ0n0WfBIT6f03bg1qfZF3fT+kJHvQBzNfUV8pNpfhxxiM1AeYq8egNVn2iLB1scE/bxRdxQRuXUZ/gKSX6Xu/svvAXeRaii8g2rlT+iq36jKUCcjA2MVl7oOnMbBh7j1qpasEQJU= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 5DD8175A95 for ; Fri, 8 Mar 2024 09:33:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1709890386; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=kxuNR5Hu4ooEBzhWe83CkNnC6lHqMbyKynIjuWxcRr0=; b=jC/z1ZLXNfGDempGVs1q9SGN+9lUPXz1oA69pNLYvLUIpk5QxgD165FC7CKmNoi17MAOki lvlpxRFnsU+VbFxFP4+GGh5ZQKMvbSgamH3852yN8+sIHqvoSAT1Fhk+5idUnty0KNs17Y dbzZ1//q0q6wBN+zW12UZNWMS57g0mI= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1709890386; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=kxuNR5Hu4ooEBzhWe83CkNnC6lHqMbyKynIjuWxcRr0=; b=XbXfjSe5AGNUlF0N2/SWGFD3PVHAyI3bIKYH7QC1krNfPGphFPAeAAl2B64dVUKPGkJoMc 2outcqpIAQaM8bCg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1709890386; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=kxuNR5Hu4ooEBzhWe83CkNnC6lHqMbyKynIjuWxcRr0=; b=jC/z1ZLXNfGDempGVs1q9SGN+9lUPXz1oA69pNLYvLUIpk5QxgD165FC7CKmNoi17MAOki lvlpxRFnsU+VbFxFP4+GGh5ZQKMvbSgamH3852yN8+sIHqvoSAT1Fhk+5idUnty0KNs17Y dbzZ1//q0q6wBN+zW12UZNWMS57g0mI= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1709890386; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=kxuNR5Hu4ooEBzhWe83CkNnC6lHqMbyKynIjuWxcRr0=; b=XbXfjSe5AGNUlF0N2/SWGFD3PVHAyI3bIKYH7QC1krNfPGphFPAeAAl2B64dVUKPGkJoMc 2outcqpIAQaM8bCg== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 7E4AC137AC for ; Fri, 8 Mar 2024 09:33:05 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id +P2RHVHb6mWLYAAAD6G6ig (envelope-from ) for ; Fri, 08 Mar 2024 09:33:05 +0000 From: Tom de Vries To: gdb-patches@sourceware.org Subject: [PATCH v4 5/6] gdb/testsuite: Reduce gdb.threads/threadcrash.exp reliance on libc symbols Date: Fri, 8 Mar 2024 10:33:41 +0100 Message-Id: <20240308093342.26745-6-tdevries@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20240308093342.26745-1-tdevries@suse.de> References: <20240308093342.26745-1-tdevries@suse.de> MIME-Version: 1.0 X-Spamd-Bar: + Authentication-Results: smtp-out2.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b="jC/z1ZLX"; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=XbXfjSe5 X-Rspamd-Server: rspamd2.dmz-prg2.suse.org X-Spamd-Result: default: False [1.49 / 50.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:106:10:150:64:167:received]; R_MISSING_CHARSET(2.50)[]; TO_DN_NONE(0.00)[]; BROKEN_CONTENT_TYPE(1.50)[]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[suse.de:+]; MX_GOOD(-0.01)[]; NEURAL_HAM_SHORT(-0.20)[-1.000]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; BAYES_HAM(-0.00)[26.57%]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; FROM_HAS_DN(0.00)[]; DWL_DNSWL_MED(-2.00)[suse.de:dkim]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[gdb-patches@sourceware.org]; RCPT_COUNT_ONE(0.00)[1]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; MID_CONTAINS_FROM(1.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:dkim]; FUZZY_BLOCKED(0.00)[rspamd.com]; RCVD_TLS_ALL(0.00)[] X-Spam-Score: 1.49 X-Rspamd-Queue-Id: 5DD8175A95 X-Spam-Status: No, score=-12.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org From: Guinevere Larsen The test gdb.threads/threadcrash.exp demanded GDB to fully unwind and print the names of all functions. However, some of the functions are from the libc library, and so the test implicitly demanded libc symbols to be available, and would fail otherwise, as was raised in PR gdb/31293. This commit changes it so we only explicitly check for functions that are not provided by threadcrash.c if they are indeed available. Tested on arm-linux and x86_64-linux. Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31293 --- gdb/testsuite/gdb.threads/threadcrash.exp | 48 +++++++++++++++++++---- 1 file changed, 41 insertions(+), 7 deletions(-) diff --git a/gdb/testsuite/gdb.threads/threadcrash.exp b/gdb/testsuite/gdb.threads/threadcrash.exp index 16fd7eb4e23..c72ce73fd6d 100644 --- a/gdb/testsuite/gdb.threads/threadcrash.exp +++ b/gdb/testsuite/gdb.threads/threadcrash.exp @@ -20,6 +20,9 @@ # a gcore. +set have_sleep -1 +set have_pthread_kill -1 + # Use 'thread apply all backtrace' to check if all expected threads # are present, and stopped in the expected locations. Set the global # TEST_LIST to be the a list of regexps expected to match all the @@ -27,6 +30,8 @@ # GDB sees the threads. proc thread_apply_all {} { + global have_sleep + global have_pthread_kill global test_list set test_list { } @@ -73,6 +78,14 @@ proc thread_apply_all {} { lappend test_list 7 exp_continue } + -re "^\r\n${hs} in sleep $hs$eol" { + set have_sleep 1 + exp_continue + } + -re "^\r\n${hs} in pthread_kill $hs$eol" { + set have_pthread_kill 1 + exp_continue + } -re "^\r\n$hs$eol" { exp_continue } @@ -82,6 +95,13 @@ proc thread_apply_all {} { } gdb_assert {$unwind_fail == false} + + if { $have_sleep == -1 } { + set have_sleep 0 + } + if { $have_pthread_kill == -1 } { + set have_pthread_kill 0 + } } # Perform all the tests we're interested in. They are: @@ -90,6 +110,8 @@ proc thread_apply_all {} { # * testing if GDB recreated the full backtrace we expect for all threads proc do_full_test {} { + global have_sleep + global have_pthread_kill global test_list set thread_count [get_valueof "" "\$_inferior_thread_count" 0] gdb_assert {$thread_count == 7} @@ -98,6 +120,18 @@ proc do_full_test {} { gdb_assert {$thread_count == [llength $test_list]} + if { $have_sleep } { + set sleep ".*sleep.*" + } else { + set sleep ".*" + } + + if { $have_pthread_kill } { + set pthread_kill ".*pthread_kill.*" + } else { + set pthread_kill ".*" + } + for {set i 0} {$i < $thread_count } {incr i} { set thread_num [expr [llength $test_list] - $i] @@ -105,25 +139,25 @@ proc do_full_test {} { if { $type == 1 } { set re \ [multi_line \ - ".sleep.*" \ + $sleep \ ".*do_syscall_task .location=SIGNAL_ALT_STACK.*" \ ".*signal_handler.*" \ ".*signal handler called.*" \ - ".*pthread_kill.*" \ + $pthread_kill \ ".*thread_function.*"] } elseif { $type == 2 } { set re \ [multi_line \ - ".*sleep.*" \ + $sleep \ ".*do_syscall_task .location=SIGNAL_HANDLER.*" \ ".*signal_handler.*" \ ".*signal handler called.*" \ - ".*pthread_kill.*" \ + $pthread_kill \ ".*thread_function.*"] } elseif { $type == 3 } { set re \ [multi_line \ - ".*sleep.*" \ + $sleep \ ".*do_syscall_task .location=NORMAL.*" \ ".*thread_function.*"] } elseif { $type == 4 } { @@ -132,7 +166,7 @@ proc do_full_test {} { ".*do_spin_task .location=SIGNAL_ALT_STACK.*" \ ".*signal_handler.*" \ ".*signal handler called.*" \ - ".*pthread_kill.*" \ + $pthread_kill \ ".*thread_function.*"] } elseif { $type == 5 } { set re \ @@ -140,7 +174,7 @@ proc do_full_test {} { ".*do_spin_task .location=SIGNAL_HANDLER.*" \ ".*signal_handler.*" \ ".*signal handler called.*" \ - ".*pthread_kill.*" \ + $pthread_kill \ ".*thread_function.*"] } elseif { $type == 6 } { set re \ From patchwork Fri Mar 8 09:33:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom de Vries X-Patchwork-Id: 86963 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D20C13858427 for ; Fri, 8 Mar 2024 10:16:13 +0000 (GMT) X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2a07:de40:b251:101:10:150:64:1]) by sourceware.org (Postfix) with ESMTPS id CDD523858D35 for ; Fri, 8 Mar 2024 10:15:48 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org CDD523858D35 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de ARC-Filter: OpenARC Filter v1.0.0 sourceware.org CDD523858D35 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a07:de40:b251:101:10:150:64:1 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1709892950; cv=none; b=A7UVZtnYNUd070iTx5UPGBaZrkdvfv8hH5L06BT7LhtwIJh4Z1fNKr8jDwINmwFbMYohVZ01LcuUJubF2ZUorooE3UuVW1DwoABr8QFl5DY2SgRZg1ZpMu7guapL05XN//Tj8mevrXGZP0xpmaPlUJUzvzUPYPfGxXMuH0HCy8Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1709892950; c=relaxed/simple; bh=pNk3LroLZRmxz8HvMlQ2/q0eQ/j6SHuS6kbRRQt2w10=; h=DKIM-Signature:DKIM-Signature:DKIM-Signature:DKIM-Signature:From: To:Subject:Date:Message-Id:MIME-Version; b=icTMl3npbvvewW3nYrEccKK0IaQAq5AutaOgY8bZn2XPbOz0Fy0EgAJlA9DgMEhJiyR14kMGA3IXf4KuhXyOGOjaa5s9EIOhIdmIGQxOsgd3GkRQ2ILI6Mv7V/TP0UmvbHjpCMNtaSmef0Y8uq0OFsETHlGDE9wqlrl/TqvVb9k= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 5526D6AE28 for ; Fri, 8 Mar 2024 09:33:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1709890387; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=9hz74CIhmsIVixqPX3sgNfSRedo4xjp7mv3iE/o9mQk=; b=Lm4E5LI9r3f3sZmELE2PijN54hsu+DccZqwEyrf/qCWs2TQrEjbck8SYEUP5TWPZcPMw7s 13xV2su+vZXyQ2Y5GCuh4X5O5WxRbFsbcyc5o1UfN/muMw3xE+PORTclw5351/t93V/2qb jKlkPF45seRmRFZUQxFSfvBvVYCtZ1k= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1709890387; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=9hz74CIhmsIVixqPX3sgNfSRedo4xjp7mv3iE/o9mQk=; b=Rgsp4rHfc3Tk2EjWyqols4yUIaQsR2q6X1CKRtzk6nYpUGrfkB8y7l9Y7PYL0efjXr/D/+ iB88Zip15ezZPaCQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1709890387; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=9hz74CIhmsIVixqPX3sgNfSRedo4xjp7mv3iE/o9mQk=; b=Lm4E5LI9r3f3sZmELE2PijN54hsu+DccZqwEyrf/qCWs2TQrEjbck8SYEUP5TWPZcPMw7s 13xV2su+vZXyQ2Y5GCuh4X5O5WxRbFsbcyc5o1UfN/muMw3xE+PORTclw5351/t93V/2qb jKlkPF45seRmRFZUQxFSfvBvVYCtZ1k= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1709890387; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=9hz74CIhmsIVixqPX3sgNfSRedo4xjp7mv3iE/o9mQk=; b=Rgsp4rHfc3Tk2EjWyqols4yUIaQsR2q6X1CKRtzk6nYpUGrfkB8y7l9Y7PYL0efjXr/D/+ iB88Zip15ezZPaCQ== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 9820B137C3 for ; Fri, 8 Mar 2024 09:33:05 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id +D71I1Hb6mWLYAAAD6G6ig (envelope-from ) for ; Fri, 08 Mar 2024 09:33:05 +0000 From: Tom de Vries To: gdb-patches@sourceware.org Subject: [PATCH v4 6/6] gdb/testsuite: Add kfail in gdb.threads/threadcrash.exp on 32-bit arm targets Date: Fri, 8 Mar 2024 10:33:42 +0100 Message-Id: <20240308093342.26745-7-tdevries@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20240308093342.26745-1-tdevries@suse.de> References: <20240308093342.26745-1-tdevries@suse.de> MIME-Version: 1.0 X-Spamd-Bar: + Authentication-Results: smtp-out1.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=Lm4E5LI9; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=Rgsp4rHf X-Rspamd-Server: rspamd2.dmz-prg2.suse.org X-Spamd-Result: default: False [1.49 / 50.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:106:10:150:64:167:received]; R_MISSING_CHARSET(2.50)[]; TO_DN_NONE(0.00)[]; BROKEN_CONTENT_TYPE(1.50)[]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[suse.de:+]; MX_GOOD(-0.01)[]; NEURAL_HAM_SHORT(-0.20)[-1.000]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; BAYES_HAM(-0.00)[41.44%]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; FROM_HAS_DN(0.00)[]; DWL_DNSWL_MED(-2.00)[suse.de:dkim]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[gdb-patches@sourceware.org]; RCPT_COUNT_ONE(0.00)[1]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; MID_CONTAINS_FROM(1.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:dkim]; FUZZY_BLOCKED(0.00)[rspamd.com]; RCVD_TLS_ALL(0.00)[] X-Spam-Score: 1.49 X-Rspamd-Queue-Id: 5526D6AE28 X-Spam-Status: No, score=-12.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org There is an issue with the test gdb.threads/threadcrash.exp on arm targets, relating to how the targets handles gcores. The issue is that GDB can't properly backtrace from a gcore. Add a kfail referring back to PR corefiles/31294, which tracks the issues with gcores in 32-bit arm targets. I cannot reproduce the problem, so this is a best effort based on the logs in the PR. Tested on arm-linux and x86_64-linux. Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31294 --- gdb/testsuite/gdb.threads/threadcrash.exp | 27 +++++++++++++++-------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/gdb/testsuite/gdb.threads/threadcrash.exp b/gdb/testsuite/gdb.threads/threadcrash.exp index c72ce73fd6d..7839f5c358e 100644 --- a/gdb/testsuite/gdb.threads/threadcrash.exp +++ b/gdb/testsuite/gdb.threads/threadcrash.exp @@ -94,14 +94,14 @@ proc thread_apply_all {} { } } - gdb_assert {$unwind_fail == false} - if { $have_sleep == -1 } { set have_sleep 0 } if { $have_pthread_kill == -1 } { set have_pthread_kill 0 } + + return [expr !$unwind_fail] } # Perform all the tests we're interested in. They are: @@ -109,16 +109,25 @@ proc thread_apply_all {} { # * Creating the list of backtraces for all threads seen # * testing if GDB recreated the full backtrace we expect for all threads -proc do_full_test {} { +proc do_full_test { phase } { global have_sleep global have_pthread_kill global test_list set thread_count [get_valueof "" "\$_inferior_thread_count" 0] gdb_assert {$thread_count == 7} - thread_apply_all - - gdb_assert {$thread_count == [llength $test_list]} + set test thread_apply_all + set res [$test] + if { $res && $thread_count == [llength $test_list] } { + pass $test + } else { + set have_kfail [expr [string equal $phase gcore] && [is_aarch32_target]] + if { $have_kfail } { + kfail $test + } else { + fail $test + } + } if { $have_sleep } { set sleep ".*sleep.*" @@ -209,7 +218,7 @@ proc_with_prefix test_live_inferior {} { gdb_breakpoint "breakpt" gdb_continue_to_breakpoint "running to breakpoint" ".*" - do_full_test + do_full_test live_inferior } # Do all preparation steps for running the corefile tests, then @@ -229,7 +238,7 @@ proc_with_prefix test_corefile {} { "A program is being debugged already\\\. Kill it\\\? \\\(y or n\\\) " \ "y" - do_full_test + do_full_test corefile } # Do all preparation steps for running the gcore tests, then @@ -267,7 +276,7 @@ proc_with_prefix test_gcore {} { "A program is being debugged already\\\. Kill it\\\? \\\(y or n\\\) " \ "y" - do_full_test + do_full_test gcore } standard_testfile