From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id igeUCsKC3mlORBcAWB0awg (envelope-from ) for ; Tue, 14 Apr 2026 14:09:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=simark.ca; s=mail; t=1776190146; bh=X8CuQtsv7vKG1heC0JdZ7+HiUoweUODBE8FR/gwesGI=; h=Date:Subject:To:References:From:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=hoTNyu8NozcZxnA6TjCH+QZwmRpALTa0A+qMCeOMv8ttRPsTWuvzkKk6x/CrIHSVN Og6YJWJobWjgFiCDuGvxobPDoYr3DXF5N+LB2aJyaU9nJE9y/M5/AGuZL0IXr7/F1Q I2Rvuh7lQSCwH1ChXmJe1c+IYyvczesp3VVf6uK8= Received: by simark.ca (Postfix, from userid 112) id 1AFDF1E0C3; Tue, 14 Apr 2026 14:09:06 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,RCVD_IN_VALIDITY_CERTIFIED_BLOCKED, RCVD_IN_VALIDITY_RPBL_BLOCKED,RCVD_IN_VALIDITY_SAFE_BLOCKED autolearn=ham autolearn_force=no version=4.0.1 Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=simark.ca header.i=@simark.ca header.a=rsa-sha256 header.s=mail header.b=sfYQmG9v; dkim-atps=neutral Received: from vm01.sourceware.org (vm01.sourceware.org [38.145.34.32]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 59B841E04F for ; Tue, 14 Apr 2026 14:09:05 -0400 (EDT) Received: from vm01.sourceware.org (localhost [127.0.0.1]) by sourceware.org (Postfix) with ESMTP id D9EE94BA2E32 for ; Tue, 14 Apr 2026 18:09:04 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D9EE94BA2E32 Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=simark.ca header.i=@simark.ca header.a=rsa-sha256 header.s=mail header.b=sfYQmG9v Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id 7D7E14BA2E10 for ; Tue, 14 Apr 2026 18:08:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 7D7E14BA2E10 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=simark.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=simark.ca ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 7D7E14BA2E10 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=158.69.221.121 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1776190120; cv=none; b=YcwhX8KX6F0fOSutiPLcwDeWhbecPBwjkelnQjokQUbEPD1icykiPP9e6+EVRtzou3BKPbG5xdPKJYfp6f9RwfPoeyKmz8QHibCfE9RxfiRc+puNuqzguTCr8GsbwjFkzZtlpFDdH7tVkcYrgjTs9fT15uI402euygnBjv/EYdQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1776190120; c=relaxed/simple; bh=X8CuQtsv7vKG1heC0JdZ7+HiUoweUODBE8FR/gwesGI=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=ZevBDte1PwE8mqI+y4XDorAs+ZXBSSrnI4LG9c4qoCXv4qY0dLI26uu7+ab2zKP66pF6w3OEzuxJYKiUG1Q956qJrdb6ImlAsl9EnrZGrpYxCJdk6bV9XWjv2prtshWE07gYpHph++I7r/lIFXdwzj8ogPWehcB1R8gw6+S7/+I= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7D7E14BA2E10 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=simark.ca; s=mail; t=1776190119; bh=X8CuQtsv7vKG1heC0JdZ7+HiUoweUODBE8FR/gwesGI=; h=Date:Subject:To:References:From:In-Reply-To:From; b=sfYQmG9vkmdol60R1knu3DidS7EK60MluZm0z1lg3swqIKvJBlTktHJy9WA+llE6g 2LEyPRBjqyMu8FqTKCPQWLd2H/Dd08vHGAJlAMXHkPGVyKIo5wO6jLhFrNgIPYcFK7 MoO6TRxvMmsRdIMHO+D3Zz3cD1dMYP3BebTf9ruA= Received: by simark.ca (Postfix) id 4C6261E04F; Tue, 14 Apr 2026 14:08:39 -0400 (EDT) Message-ID: <0370b073-7bc9-4405-b5a2-c81b9f76e579@simark.ca> Date: Tue, 14 Apr 2026 14:08:39 -0400 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] gdb/testsuite: fix dw2-entry-pc.exp with ASLR To: Bratislav Filipovic , gdb-patches@sourceware.org References: <20260414164814.564571-1-bfilipov@amd.com> Content-Language: en-US From: Simon Marchi In-Reply-To: <20260414164814.564571-1-bfilipov@amd.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit 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~public-inbox=simark.ca@sourceware.org On 2026-04-14 12:48, Bratislav Filipovic wrote: > Following Simon Marchi's fix for dw2-empty-inline-ranges.exp [1], this > test exhibits the same failure pattern when running in an environment > where GDB can't disable address space randomization (such as in a > container where that capability is removed) with a toolchain generating > position-independent executables. > > The test does a first run to grab addresses of labels and function > boundaries (foo_middle, foo_start, foo_end, and range labels). It then > crafts DWARF using these addresses across multiple test iterations. > When the executable is PIE and ASLR is active, the addresses in each > subsequent run don't match the addresses from the initial run. > > The failure manifests in the 'maint info blocks' output comparisons, > where the expected addresses (from the first run) don't match the > actual addresses in the test runs. > > The simplest fix, following Simon's approach, is to use "nopie" when > building the binaries. This doesn't affect the effectiveness of the > test, which is exercising different ways DW_AT_entry_pc can be > expressed in DWARF. > > Also, with a non-PIE executable, it is no longer necessary to run the > inferior before grabbing the addresses in the initial run, as they are > stable. So remove that runto_main call. > > [1] https://inbox.sourceware.org/gdb-patches/20260205204257.422150-1-simon.marchi@efficios.com/ > --- > gdb/testsuite/gdb.dwarf2/dw2-entry-pc.exp | 8 ++------ > 1 file changed, 2 insertions(+), 6 deletions(-) > > diff --git a/gdb/testsuite/gdb.dwarf2/dw2-entry-pc.exp b/gdb/testsuite/gdb.dwarf2/dw2-entry-pc.exp > index 441aa0fde1d..f7cc7f7c067 100644 > --- a/gdb/testsuite/gdb.dwarf2/dw2-entry-pc.exp > +++ b/gdb/testsuite/gdb.dwarf2/dw2-entry-pc.exp > @@ -28,11 +28,7 @@ standard_testfile > get_func_info foo > > if { [prepare_for_testing "failed to prepare" ${testfile} \ > - [list ${srcfile}]] } { > - return -1 > -} > - > -if {![runto_main]} { > + [list ${srcfile}] {debug nopie}]} { > return -1 > } > > @@ -83,7 +79,7 @@ proc get_next_suffix {} { > > proc build_and_runto_main { suffix asm_file } { > if {[prepare_for_testing "failed to prepare" "${::testfile}-${suffix}" \ > - [list $::srcfile $asm_file] {nodebug}]} { > + [list $::srcfile $asm_file] {nodebug nopie}]} { > return false > } > Thanks, LGTM. Approved-By: Simon Marchi Simon