From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 88gXFvXdT2rpwQAAWB0awg (envelope-from ) for ; Thu, 09 Jul 2026 13:44:21 -0400 Received: by simark.ca (Postfix, from userid 112) id 49AA21E070; Thu, 09 Jul 2026 13:44:21 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-5.3 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=4.0.1 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 9C6FD1E070 for ; Thu, 09 Jul 2026 13:44:20 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 05A6C4BA23CE for ; Thu, 9 Jul 2026 17:44:20 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 05A6C4BA23CE Received: from mail-wm1-f49.google.com (mail-wm1-f49.google.com [209.85.128.49]) by sourceware.org (Postfix) with ESMTPS id F34304BA2E07 for ; Thu, 9 Jul 2026 17:43:55 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org F34304BA2E07 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=palves.net Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org F34304BA2E07 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=209.85.128.49 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1783619036; cv=none; b=hKeEJ0TsAoGzdXQLTuEma4jPfFyiVynge0M1ezNqZ4MdeXs8Hw1J7ZDtCtJwQ/Scc4KN5DIWARLTPJxmp1VsYEGnGw9/0XpmaY2tBBHRp/VWKbZCMYoRPrHDRUg0tnRBSq1W+NDOd6NzrfL93w6suB7nY5dTZhWPpzRHoqL+Blk= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1783619036; c=relaxed/simple; bh=RfK7liOsUmL5Ps8FebTMEKOwKDMvgcjS00r51HiwxiM=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=EE6mTDgfNiaMgv9GtkspV3zH+c3CPq9VMVXxsMxWcthYcVluTOiaFS8DurcWaNekSgRahLWaE6Taqo3XY6ypIZbOcWg7eIXaLAW/jr4pXfBYAWEerW9kJuMdfDMWsDM9anxinpsio8Dgqu5ppw+rDox36UR6XreBhKxA/RcLkmg= ARC-Authentication-Results: i=1; sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org F34304BA2E07 Received: by mail-wm1-f49.google.com with SMTP id 5b1f17b1804b1-493e4ccccc2so522485e9.2 for ; Thu, 09 Jul 2026 10:43:55 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783619035; x=1784223835; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to:content-type; bh=dA0NIYuf0CuEXnPlF69V3yEAozj/9WvRwHCmUS4V3KY=; b=edDgUf74wUtZqgN3M6LRWjGoiA7+61aUkOqJLI/1NOikHsiIlv8+SAugBGGjIO/X7G w4yNZFWRLY18zzk31sBSxjmDvZh0b0GvKIwAOfFxIdYvsQfLJ7UgmD8i8JZhKmp6KOdy reL6kZrTp2gbO1hJE3UXDhhYJNJ3TyU/kwX9G9CPLL6wTaL7HZ26qwVp2+oCdvM1v8O4 E2ELUNC4J0VAop2MzzYzQzOZNOx037jALxLLe6HF8QMSLD1OXPfbHOZOg2gHqteK9qCM A6Kx0bvUYF3RAYqIyiX88FEJVXOYDY/rGdBQYO3AyWUHF+yyrkKsaCs6q1NmSb+oIESi JbiQ== X-Gm-Message-State: AOJu0YwtzhAJwNgVzaFSFt1paw3CGIexTyXrF/37ujYMHvTIc5rMZPbn O0OG+f6tGM51K7Ps+VpAP+y2UyeVj9CJVWC/sGMp2SV0nw8RpNlPu9FaKe5CxEkd X-Gm-Gg: AfdE7cmRliYydTrcCBa73iaOF4pBeZm8YUDzzEv3yNjLuoZhyBr3RO1eDBYSQkB2BYV i6jy7i52Se+PC+Vluc8FJ4mIkpqeVskmQLBbKAArwgexmBx6pAENzzv6TGxv3qX3WsqNz4TPa05 xoKAc2g6q327RsTCRe0sZtsGuVLVpETRfV2MjUr2aPovH2Wr01YoLZyEqGAE2gKYg+VcA4QoncB 8B1kJ9rO2IOtkUeIceA8/Yb9o4efrB35XC/coNjpEYv4TkwBqj8rNRe/lfXN65l1bTXLvK+QCvC 8KnoC0BqrEoBuen50GBVN/8lkktdZaMvDCrv4ogYVqqU5VvarVZv/gcOvbY6dB7ijf6bZpEtojn NWyVs6k6nuQlptYSifWicMYFPGmZoEXaDrG4BSjUWjGikJ4ubM++GZhYKD7evz34qMAfQqC5N0a nsLvRmslS5zqbUE9lWqbbu X-Received: by 2002:a05:600c:5394:b0:493:e365:ace9 with SMTP id 5b1f17b1804b1-493e68bca9fmr82750335e9.11.1783619034599; Thu, 09 Jul 2026 10:43:54 -0700 (PDT) Received: from localhost ([2001:8a0:fae3:3700:fc87:ea6:fb9f:13e3]) by smtp.gmail.com with UTF8SMTPSA id 5b1f17b1804b1-493eb6ccdbbsm78850935e9.3.2026.07.09.10.43.53 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 09 Jul 2026 10:43:53 -0700 (PDT) From: Pedro Alves To: gdb-patches@sourceware.org Subject: [PATCH] gdb/Windows testsuite: Avoid "bad" words in exe names Date: Thu, 9 Jul 2026 18:43:51 +0100 Message-ID: <20260709174351.431907-1-pedro@palves.net> X-Mailer: git-send-email 2.54.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 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. 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. Change-Id: I93c7d733fb8870b4ec6ff97ca59013211b362061 --- gdb/testsuite/lib/gdb.exp | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index 8eeaf2fc8e6..1201b615ee6 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -4130,6 +4130,12 @@ proc is_aarch64_target {} { return [expr {![is_aarch32_target]}] } +# Return true if the target is Windows-based. + +proc is_windows_based_target {} { + return [expr {[istarget *-*-cygwin*] || [istarget *-*-mingw*]}] +} + # Return 1 if displaced stepping is supported on target, otherwise, return 0. proc support_displaced_stepping {} { @@ -8414,7 +8420,23 @@ proc standard_testfile {args} { global testfile binfile set testfile $gdb_test_file_name - set binfile [standard_output_file ${testfile}] + + 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}] if {[llength $args] == 0} { set args .c base-commit: 4c4e1dd5a02c1a03e7eb408987404ffd1adfd1e4 -- 2.54.0