From patchwork Thu Feb 1 15:58: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: 85206 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 345D438582BC for ; Fri, 2 Feb 2024 09:19:14 +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 B3A61385801E for ; Fri, 2 Feb 2024 09:18:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B3A61385801E 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 B3A61385801E 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=1706865520; cv=none; b=KyhbmM/qGvbMmmG3J2h1t6EcORu1ouGwhDtCjpDGADSN60pOy4dm2ELCapFxAll7SCKgCaQMnsxMnNtuZ6Ak+eMnxrsR22zNlZ4VoYBhVP2JvytIIOaL89eM87sVi0f6761gjtCssEYlVnF2h2Og4gP7R49nwo+AQqix6FOUJEk= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1706865520; c=relaxed/simple; bh=OprlwvXHqP2sIJ6NBUura2kedw8Tn3P26EzTeJpiStw=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=nsobD5hQYCtjCljpYOhbAOcDv1mGJgusTD/m73/D8+8QvTZZOv0sK9F9rFEJpVFxrZ/LHBjnPvYU+UkeOCaCl+JONVGh2fSPSFZ/5Y17nhxNIJI5lJtpasoTKbXQwPTwuF8ZMzE+XrNKdEFHa+xvWK0fbCrhsc6CndPiX0fBwfw= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1706865517; 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=8yXTtkdHwucaG8hNdMWb+ZZrQZ/6irOghgDTDs5yloA=; b=QLfHhCXCIpiaBhcp7H5Dy2SgBQBi7PZf6GTYlwVeYTtbanP/gbv5emrKVUjCscVqNu82mB 6ebBWXNxU23HTWDfUPOYGAAcQhM1TjU3bvcn9H7r0Hv60fZr8x2lhgGzO2zbBF1AuSEHZm Wij6Fht8nJUte6A++ls9RIUsHg56lE8= 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-607-Ub7l2NBeOpyBl6MeEKOGdw-1; Fri, 02 Feb 2024 04:18:36 -0500 X-MC-Unique: Ub7l2NBeOpyBl6MeEKOGdw-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (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 E65DA1C06908 for ; Fri, 2 Feb 2024 09:18:35 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.45.226.55]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6F23C400D784; Fri, 2 Feb 2024 09:18:35 +0000 (UTC) From: Guinevere Larsen To: gdb-patches@sourceware.org Cc: Guinevere Larsen Subject: [PATCH 1/2] gdb/testsuite: fix gdb.threads/threadcrash.exp on 32-bit arm targets Date: Thu, 1 Feb 2024 16:58:12 +0100 Message-ID: <20240201155812.1189388-3-blarsen@redhat.com> In-Reply-To: <20240201155812.1189388-2-blarsen@redhat.com> References: <20240201155812.1189388-2-blarsen@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.2 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-12.2 required=5.0 tests=BAYES_00, DATE_IN_PAST_12_24, 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 --- gdb/testsuite/gdb.threads/threadcrash.exp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/gdb/testsuite/gdb.threads/threadcrash.exp b/gdb/testsuite/gdb.threads/threadcrash.exp index d3e3494cbea..362c4c5879d 100644 --- a/gdb/testsuite/gdb.threads/threadcrash.exp +++ b/gdb/testsuite/gdb.threads/threadcrash.exp @@ -27,12 +27,9 @@ proc test_thread_count {} { set thread_count 0 - gdb_test_multiple "info threads" "getting thread count" -lbl { - -re "\(Thread\|LWP\)" { - incr thread_count - exp_continue - } - -re "$::gdb_prompt " { + gdb_test_multiple "print \$_inferior_thread_count" "getting thread count" { + -re ".* = (\[0-9]+).*" { + set thread_count $expect_out(1,string) gdb_assert {$thread_count == 7} } } @@ -230,4 +227,8 @@ test_live_inferior test_corefile -test_gcore +if { [is_aarch32_target] } { + xfail "gcore tests fail on 32-bit arm, see PR corefiles/31294" +} else { + test_gcore +} From patchwork Thu Feb 1 15:58: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: 85207 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 6E82A385800D for ; Fri, 2 Feb 2024 09:19:34 +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 677F3385801D for ; Fri, 2 Feb 2024 09:18:38 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 677F3385801D 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 677F3385801D 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=1706865521; cv=none; b=nlPQgmUJdsW6oIvRZ/xwvU5NXwzmen+qAFnG4tDV0MCsnB2rq890+/wYgKjk7O6y6SYGF9MRPb8aJWdLSHD5toilm6LhZzpkvdoyDlujUY4NyYIcAFhVF/jxsh9azyZNA1H5EGFU5OhYc241DM8Ty0McaDIjnzddihA314H0kOc= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1706865521; c=relaxed/simple; bh=XFgj/B8/myPtprWysDx/vqQS2Zc3hbNukpCXXmkMc5Q=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=JjeFzvgKeDEm5JmsHzbQlx8NQSMxMoXL+WYWr2+ozv6TB4NfcDJpUB8uwcgYCuxfnaOKs5o+JO0TOOU8F0mcZ/4SO3JstJy/wVzdt3hN/f5BrfkvqQjWnk9eo6cwBrBJkRMbtu6zxdTW0x3g+17Fm8ouqUJ8BgDQcTg8Zrf/fWM= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1706865518; 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=K0FZSKB3+PWD4EkasRNfsbcwk0QIUHO1VlJtoTA3wNk=; b=DYLiBTfoUscrTM8kgg0ypmbxtXAgZiC9/4tMoEqrR4s/xRefN3I91YVGFyFLCtiflFbMWQ D0H4I3Q5T+TrG+qUU7lafrGe48mfx7uHSgPlayGMeaRvKRcIuCde31efnz5UXLk+jV64BQ fEmynVbMIlE9Og0l4HGT7r0yT1XYsyo= 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-646-eSXV-WhPNlqGqwW8k188Uw-1; Fri, 02 Feb 2024 04:18:36 -0500 X-MC-Unique: eSXV-WhPNlqGqwW8k188Uw-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (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 A0EE03816D84 for ; Fri, 2 Feb 2024 09:18:36 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.45.226.55]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 29E8B40C9444; Fri, 2 Feb 2024 09:18:36 +0000 (UTC) From: Guinevere Larsen To: gdb-patches@sourceware.org Cc: Guinevere Larsen Subject: [PATCH 2/2] gdb/testsuite: reduce gdb.threads/threadcrash.exp reliance on libc symbols Date: Thu, 1 Feb 2024 16:58:13 +0100 Message-ID: <20240201155812.1189388-4-blarsen@redhat.com> In-Reply-To: <20240201155812.1189388-2-blarsen@redhat.com> References: <20240201155812.1189388-2-blarsen@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.2 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-12.2 required=5.0 tests=BAYES_00, DATE_IN_PAST_12_24, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H5, 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 362c4c5879d..337135f812a 100644 --- a/gdb/testsuite/gdb.threads/threadcrash.exp +++ b/gdb/testsuite/gdb.threads/threadcrash.exp @@ -57,26 +57,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 } @@ -84,7 +81,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 } @@ -92,7 +89,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 }