From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id teL6CbuAUGp1TQEAWB0awg (envelope-from ) for ; Fri, 10 Jul 2026 01:18:51 -0400 Authentication-Results: simark.ca; dkim=pass (2048-bit key; unprotected) header.d=gnu.org header.i=@gnu.org header.a=rsa-sha256 header.s=fencepost-gnu-org header.b=nf0/70E/; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 1A6571E0A3; Fri, 10 Jul 2026 01:18:51 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-6.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [IPv6:2620:52:6:3111::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 672501E04F for ; Fri, 10 Jul 2026 01:18:49 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 77F814BA2E24 for ; Fri, 10 Jul 2026 05:18:47 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 77F814BA2E24 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=gnu.org header.i=@gnu.org header.a=rsa-sha256 header.s=fencepost-gnu-org header.b=nf0/70E/ Received: from eggs.gnu.org (eggs.gnu.org [IPv6:2001:470:142:3::10]) by sourceware.org (Postfix) with ESMTPS id 42A024BA2E12 for ; Fri, 10 Jul 2026 05:18:20 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 42A024BA2E12 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gnu.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gnu.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 42A024BA2E12 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=2001:470:142:3::10 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1783660700; cv=none; b=EydhYWxdRr5iTw5ohfFpWXUHIKWZsRzgZAtFy2r4Pj2uoK1EeIkqprMpZzdWuS4dl7i+rz59Skh6wQ9CtG3/gvPAXFUnOChgbFfr2FYHM317fWVU0TGdl0KmJ/jtgdcE3johyGCxzQricfmxtJDxy3a5nMj4xGPCl/XFpGyz+Ts= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1783660700; c=relaxed/simple; bh=KTHfITo6+R2y49hqx+yEdf5NpdxrjCcV9iPeG10gWFA=; h=DKIM-Signature:Date:Message-Id:From:To:Subject; b=OLzZ4Ohb85qNFxj8wOSBcGrTfHTO5KDiBdW+FXqQldHFBRxQE+ckMdbSqxHn/M+UVgmkXsNu67BPZ8X/+mlHGpgdIKSb4UPWd5VyWT/uhwJ3lG4rs3QbcPhzTx+eQwxlx8DpLPYfP13UaAcJRFrmK2jQR8cAp7Hh0lE8nKiFYI4= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=gnu.org header.i=@gnu.org header.a=rsa-sha256 header.s=fencepost-gnu-org header.b=nf0/70E/ DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 42A024BA2E12 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wi3cx-0002wE-8F; Fri, 10 Jul 2026 01:18:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=zJ0ocKbFJBLDhA+hUUOMArdhNQtyqPEuajo5OYUejB8=; b=nf0/70E/jjso H+3drrNoFobrJOjB3EBjCounAZPbz/h+qDEHN/cVuLTaFzGLShnB6P0yqnkEYRuq/1FXYYpn0I14o rw3Y5JY1+tWqtSX1+4pImeOi/2XhTAdeQEBLrJJ4fkN0zPvW5HOjvCEGV7GyfIAFrac+wIx0Nr8Vn hwcTFhMGSqQM21v7YUs9nxewEHo6eGa91sx5CqGx7I6sSpTqTTSqnIP8zGdt7Yvjrq/bwdyVqXyRV RjOrJuIVW+ZSofNSYgg5/QSMuOwzUXl4iRKvMKkcDht3EvKRnUbYOdErzEQa417d9SlqZ1PwpCOla A8/o7vtE0SdlLU7v2XdWmQ==; Date: Fri, 10 Jul 2026 08:18:04 +0300 Message-Id: <86zezzjucz.fsf@gnu.org> From: Eli Zaretskii To: Pedro Alves Cc: gdb-patches@sourceware.org In-Reply-To: <20260709174351.431907-1-pedro@palves.net> (message from Pedro Alves on Thu, 9 Jul 2026 18:43:51 +0100) Subject: Re: [PATCH] gdb/Windows testsuite: Avoid "bad" words in exe names References: <20260709174351.431907-1-pedro@palves.net> 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 > From: Pedro Alves > Date: Thu, 9 Jul 2026 18:43:51 +0100 > > Running gdb.base/execl-update-breakpoints.exp on Windows 11 shows this > FAIL: > > (gdb) run > Starting program: .../gdb.base/execl-update-breakpoints/execl-update-breakpoints1.exe > Error creating process .../gdb.base/execl-update-breakpoints/execl-update-breakpoints1.exe (error 740): The requested operation requires elevation. > (gdb) FAIL: gdb.base/execl-update-breakpoints.exp: runto: run to main > > Error 740 is ERROR_ELEVATION_REQUIRED. > > Turns out that Windows has an "installer detection" heuristic that > refuses to launch executables whose filename contains keywords like > "update", "setup", and "install" without elevation (admin rights), > unless the PE embeds a manifest declaring > requestedExecutionLevel="asInvoker". > > I found some older Microsoft documentation claiming that the heuristic > only applies to 32-bit binaries, but what I observe is that: > > - It triggers with 64-bit PEs on current Windows. > > And also: > > - Matches the word (e.g. "update") as a substring anywhere in the > filename (not just as a prefix). > > - Is not drive-dependent. I thought moving the process to a dev > drive might suppress the check, but it does not. Yes, this happens on 64-bit Windows as well. > I saw this problem first in a downstream ROCgdb testcase, and there I > fixed it by adjusting the name of that particular testcase. > > Since this is the second case I'm seeing this already, I thought I'd > fix it in a more general way this time, one that avoids adding the > same explanatory comment to several testcases. > > Fix it by making standard_testfile tweak the resulting "binfile" > output variable to avoid the "bad" words, on Windows. This way, in > theory we only need to handle this once, in a central place. Note that IME, not only programs literally called "install.exe", "update.exe" etc. are blocked, but also programs whose name begins with these words. For example, I had problems with the Texinfo's install-info.exe. > + if {[is_windows_based_target]} { > + # Windows' installer detection heuristic refuses to launch > + # executables whose name contains the following words without > + # elevation, failing with ERROR_ELEVATION_REQUIRED (740). > + # > + # Map of WORD => REPLACEMENT. > + set word_map { > + "update" "up_date" > + "setup" "set_up" > + "install" "inst_all" > + } > + set binfile_basename [string map $word_map $testfile] > + } else { > + set binfile_basename $testfile > + } > + set binfile [standard_output_file ${binfile_basename}] FTR, another way of overcoming this is by providing a manifest file. Below is an example of such a manifest I use for patch.exe. The manifest must be named PROGRAM.exe.manifest and should be in the same directory as the executable.