From patchwork Wed Feb 14 09:17:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guinevere Larsen X-Patchwork-Id: 85705 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 47FD6385AC1D for ; Wed, 14 Feb 2024 09:19:38 +0000 (GMT) X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id E9D9B3857356 for ; Wed, 14 Feb 2024 09:19:03 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E9D9B3857356 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org E9D9B3857356 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1707902346; cv=none; b=qjnORbr+7Lhxiw+f4gKa9Em0EkSVqrFOmrcH4L4/xX3bjOmXkx1Zmc6SjdoFg6zbYZG9wngDobA1+9PzYKuIzLUkAYzFgALQvBfski6axTVGOafna6f51582fsnT6gMzblHnNsf5dRrZIvC/JM7xrB6Ouv5UZtEXgsOPRoZ2hr4= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1707902346; c=relaxed/simple; bh=pPk/qC/pRfrXw2UYuNvr+nEOeDFeKOgUazuHXlzR2JY=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=giYkegv9LOatdN8w8Fdsry4MGJw+F+ynwswD/cVYW714bO6EfKnVPgaotYBLXKjQljHK+zSsUv19o+GTYWKl60x7of+oQkxKlzti2KhtIKZQHjZT4ua4px3BJQfQJ819NhyOY7pXf4qyJ3lvJj+wJoCCct40tHDnzcs5KhnNh/o= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1707902343; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=gnINWl/Prmg0Fv9hhuvLB74BN6UQzeDu4U5fU1CUCkY=; b=VBq1BjlW9/rgdbnEkrMq1UA1UsVC/f0kxqQbMB5yuorgzLqKPw3ftOTEhQH5qoS+U8oeAK SPlNRLcNB98fJdsdEiLBYzIHVCgpOLyrI12UVSqQcgMMZVEuIA25zkGdiz2ZvaM36AXPW6 PpreAYdNyWqn6ky3uknEPcNghYUgLgo= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-397-viArMSbINPaYDmmBLYuhYg-1; Wed, 14 Feb 2024 04:19:01 -0500 X-MC-Unique: viArMSbINPaYDmmBLYuhYg-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 95069185A785 for ; Wed, 14 Feb 2024 09:19:01 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.45.226.35]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1DBC52166B36; Wed, 14 Feb 2024 09:19:01 +0000 (UTC) From: Guinevere Larsen To: gdb-patches@sourceware.org Cc: Guinevere Larsen Subject: [PATCH v3 1/2] gdb/testsuite: fix gdb.threads/threadcrash.exp on 32-bit arm targets Date: Wed, 14 Feb 2024 10:17:12 +0100 Message-ID: <20240214091712.223928-3-blarsen@redhat.com> In-Reply-To: <20240214091712.223928-2-blarsen@redhat.com> References: <20240214091712.223928-2-blarsen@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.6 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-11.7 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NONE, 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 are 2 issues with the test gdb.threads/threadcrash.exp on arm targets, both relating to issues in how the targets handles gcores. The first is that the test fails to cout the number of threads in the inferior and the second is that GDB can't properly backtrace from a gcore. The first error is fixed on this commit by getting the convenience variable _inferior_thread_count as opposed to calculating it based on the output of "info threads" For the second, this test just emits a single xfail referring back to PR corefiles/31294, which tracks the issues with gcores in 32-bit arm targets. Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31294 Reviewed-By: Lancelot Six --- gdb/testsuite/gdb.threads/threadcrash.exp | 29 ++++++----------------- 1 file changed, 7 insertions(+), 22 deletions(-) diff --git a/gdb/testsuite/gdb.threads/threadcrash.exp b/gdb/testsuite/gdb.threads/threadcrash.exp index 996e020d1e8..bf4534179e2 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 @@ -123,7 +103,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 @@ -230,4 +211,8 @@ test_live_inferior test_corefile -test_gcore +if { [is_aarch32_target] } { + kfail "gcore tests fail on 32-bit arm, see PR corefiles/31294" +} else { + test_gcore +} From patchwork Wed Feb 14 09:17:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guinevere Larsen X-Patchwork-Id: 85704 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 10283385C6EE for ; Wed, 14 Feb 2024 09:19:38 +0000 (GMT) X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id CEE5A3857340 for ; Wed, 14 Feb 2024 09:19:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org CEE5A3857340 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org CEE5A3857340 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1707902346; cv=none; b=vH+HKAwG2Pv/gHTUq8PFDAp2mHlXPH9irfcHZvc7/t2gw9mTmrl3VmOWoVYYSRT8pLhMrsTVFGES0EwJeiwueh50GR295jAzCTkEE0VL/1U6t+43s5+FUmDj8Lp9hHSlGVuXQRMmj26EJsuxQZCJK/aIn7RFTKszJM7kR6BvRbY= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1707902346; c=relaxed/simple; bh=H4r6Equ2ERohiG8djW4Chf/WbtXdmVSE/AU6Nuvpwic=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=YjTUrxJA8p/pgvFhlxhjYvXtmLaQoJ/SkJ+xb6cDGenDddhdluXFrekEiW3ZRSPci6gOtre5nZLBG2bEns1qdtFvuBIhCe4ufQD7KSi0T4vAQeUjEqw2l+fM16cCAFbsCwfyWFSODhquCpUJIGbUj9ZMIdsUnPBXA0FofIq2afA= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1707902344; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Q5GYIsusndaEI9HBDG+DjdOCDIuqrDQFqvPHGBQOlNk=; b=OB3SEv9L+EFve4lBtqT4DquEXIlUZWyBNPXzeN9AUfLt2nh1TlFlnYrBRR93rO51YsnaZl zjefGh1Oq/5y4DoVCn+xUqdT/03IpnFs+Dzb24auDSd80CwrLW6AZpbYx1FcdPzcU/W23A 2jPbP8AeY0nzgLbJx1gBEA+U2JxU/Ck= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-158-Tvwix7xKNXuFjfGWrSc2Iw-1; Wed, 14 Feb 2024 04:19:02 -0500 X-MC-Unique: Tvwix7xKNXuFjfGWrSc2Iw-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 4EFCE3C025B0 for ; Wed, 14 Feb 2024 09:19:02 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.45.226.35]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CC03D2166B36; Wed, 14 Feb 2024 09:19:01 +0000 (UTC) From: Guinevere Larsen To: gdb-patches@sourceware.org Cc: Guinevere Larsen Subject: [PATCH v3 2/2] gdb/testsuite: reduce gdb.threads/threadcrash.exp reliance on libc symbols Date: Wed, 14 Feb 2024 10:17:13 +0100 Message-ID: <20240214091712.223928-4-blarsen@redhat.com> In-Reply-To: <20240214091712.223928-2-blarsen@redhat.com> References: <20240214091712.223928-2-blarsen@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.6 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-12.0 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, 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 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 provided by threadcrash.c to fix that Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31293 --- gdb/testsuite/gdb.threads/threadcrash.exp | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/gdb/testsuite/gdb.threads/threadcrash.exp b/gdb/testsuite/gdb.threads/threadcrash.exp index bf4534179e2..2bbedcce58e 100644 --- a/gdb/testsuite/gdb.threads/threadcrash.exp +++ b/gdb/testsuite/gdb.threads/threadcrash.exp @@ -40,26 +40,23 @@ proc thread_apply_all {} { exp_continue } -re "\[^\n\]*syscall_task .location=SIGNAL_ALT_STACK\[^\n\]*" { - lappend test_list [multi_line ".*sleep.*" \ - ".*do_syscall_task .location=SIGNAL_ALT_STACK.*" \ + lappend test_list [multi_line ".*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.*" \ + lappend test_list [multi_line ".*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.*" \ + lappend test_list [multi_line ".*do_syscall_task .location=NORMAL.*" \ ".*thread_function.*"] exp_continue } @@ -67,7 +64,7 @@ proc thread_apply_all {} { lappend test_list [multi_line ".*do_spin_task .location=SIGNAL_ALT_STACK.*" \ ".*signal_handler.*" \ ".*signal handler called.*" \ - ".*pthread_kill.*" \ + ".*" \ ".*thread_function.*"] exp_continue } @@ -75,7 +72,7 @@ proc thread_apply_all {} { lappend test_list [multi_line ".*do_spin_task .location=SIGNAL_HANDLER.*" \ ".*signal_handler.*" \ ".*signal handler called.*" \ - ".*pthread_kill.*" \ + ".*" \ ".*thread_function.*"] exp_continue }