GNU bug report logs - #41295
Fix access to target_info global in default_target_compile (with patch)

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: dejagnu; Reported by: jcb62281@HIDDEN; Done: jcb62281@HIDDEN; Maintainer for dejagnu is bug-dejagnu@HIDDEN.
bug closed, send any further explanations to 41295 <at> debbugs.gnu.org and jcb62281@HIDDEN Request was from Jacob Bachmeyer <jcb62281@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 15 May 2020 22:51:22 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri May 15 18:51:22 2020
Received: from localhost ([127.0.0.1]:39091 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1jZjAo-0003gk-9n
	for submit <at> debbugs.gnu.org; Fri, 15 May 2020 18:51:22 -0400
Received: from lists.gnu.org ([209.51.188.17]:34552)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <jcb62281@HIDDEN>) id 1jZjAm-0003gc-7Q
 for submit <at> debbugs.gnu.org; Fri, 15 May 2020 18:51:21 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:54900)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <jcb62281@HIDDEN>)
 id 1jZjAl-0006AO-Te
 for bug-dejagnu@HIDDEN; Fri, 15 May 2020 18:51:19 -0400
Received: from mail-ot1-x32a.google.com ([2607:f8b0:4864:20::32a]:38826)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <jcb62281@HIDDEN>)
 id 1jZjAl-0007GT-0w
 for bug-dejagnu@HIDDEN; Fri, 15 May 2020 18:51:19 -0400
Received: by mail-ot1-x32a.google.com with SMTP id w22so3266669otp.5
 for <bug-dejagnu@HIDDEN>; Fri, 15 May 2020 15:51:18 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=message-id:date:from:reply-to:user-agent:mime-version:to:subject;
 bh=Nq2jHNAMGWGjyKT5vU/CkjaJds26L7FNzgzt6Tr8in0=;
 b=vTNb1rngCtwJLf7SudWUSv6KtzuFqNU/Zx6TFA7T8P/DLf4bowKKYAtplRpfPNhUeJ
 lXUfQXyCJbfrkHnOWAgGcWIRedlX463JXBEz62VsYe/zol4u/5gz2scrT/aUuC+4kEI6
 xCKjb9oCJVZKasj4MfUmvVDevcA71+7xb0jOPCon9DMlNNdwm6HMPN/FUQRDR4cDSk7I
 YS3LjWI46O4T6yqhSk7ky4Wv3894O0igzzYkRnUYEwZxVtGB/BRGzC15zHVoaHz2Apnd
 N8onewCi03oKZ6kzCPSpX2ESxmeOi4O63MTwdbzN4uMCISsW2p30ZjaceTc6fnwAaD8Q
 bsvA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:message-id:date:from:reply-to:user-agent
 :mime-version:to:subject;
 bh=Nq2jHNAMGWGjyKT5vU/CkjaJds26L7FNzgzt6Tr8in0=;
 b=omymGHLOZEB0zSlsRsw0hH+y5moRZgwO5fUnXmfjCZgibRL4x3rBQ6HXXlUX/cEXnW
 q1xjlbondUeiyxevFKK1z18DloH7MwfNvQrvNg9DhrE6+pz1QqUh2VmrleGro2m2O6kk
 p2tLWvszlPevtix/2wK3+iiBz/VgtnZn4VtL/pbc7KGjhFRxur2FhsWXcL1hcg5735H3
 VlCXk8uTZ35klBhq1zL8eYau4h5vdSF9I7J+nB9U57wjVzdw+/zER/RAmwFnoVM3wpXz
 zlpKKf4z2q9kuenzrrZfgfSwTEEqHGRhwzGL5dXdHOEMTlTWT/m3oNlToUsCAFlvyt11
 EE7w==
X-Gm-Message-State: AOAM532zFUnX7LlDC2QL06nus4rno8CW+2OaAaqajLlSaMwNrb+FulHb
 v7kuMPqxFF3izHxdBHirVE2oH3aI
X-Google-Smtp-Source: ABdhPJxOTHtKxfQvecK1cm7U1eK3IHLN9ceYoc9egUNksa0mGDjnV+OThSVIA+A0nlNZFjvBZP4cWw==
X-Received: by 2002:a05:6830:114f:: with SMTP id
 x15mr4189246otq.128.1589583077583; 
 Fri, 15 May 2020 15:51:17 -0700 (PDT)
Received: from [192.168.2.42] (adsl-70-133-146-38.dsl.ablntx.sbcglobal.net.
 [70.133.146.38])
 by smtp.gmail.com with ESMTPSA id j23sm915575otl.64.2020.05.15.15.51.16
 for <bug-dejagnu@HIDDEN>
 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128);
 Fri, 15 May 2020 15:51:16 -0700 (PDT)
Message-ID: <5EBF1CE3.8060804@HIDDEN>
Date: Fri, 15 May 2020 17:51:15 -0500
From: Jacob Bachmeyer <jcb62281@HIDDEN>
User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US;
 rv:1.8.1.22) Gecko/20090807 MultiZilla/1.8.3.4e SeaMonkey/1.1.17
 Mnenhy/0.7.6.0
MIME-Version: 1.0
To: bug-dejagnu@HIDDEN
Subject: Fix access to target_info global in default_target_compile (with
 patch)
Content-Type: multipart/mixed; boundary="------------010302090203030408060504"
Received-SPF: pass client-ip=2607:f8b0:4864:20::32a;
 envelope-from=jcb62281@HIDDEN; helo=mail-ot1-x32a.google.com
X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache.
 That's all we know.
X-Spam_score_int: -15
X-Spam_score: -1.6
X-Spam_bar: -
X-Spam_report: (-1.6 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
 FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001,
 FREEMAIL_REPLYTO_END_DIGIT=0.25, RCVD_IN_DNSWL_NONE=-0.0001,
 SPF_PASS=-0.001 autolearn=_AUTOLEARN
X-Spam_action: no action
X-Spam-Score: 1.2 (+)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 Content preview: This bug was uncovered while developing tests for
 default_target_compile.
 The procedure attempts to determine if a host is set using [info exists
 target_info(host, name)], but does not use the global t [...] 
 Content analysis details:   (1.2 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 0.0 FREEMAIL_FROM          Sender email is commonly abused enduser mail
 provider (jcb62281[at]gmail.com)
 0.2 FREEMAIL_REPLYTO_END_DIGIT Reply-To freemail username ends in
 digit (jcb62281[at]gmail.com)
 0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 1.0 SPF_SOFTFAIL           SPF: sender does not match SPF record (softfail)
 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends
 in digit (jcb62281[at]gmail.com)
 -2.3 RCVD_IN_DNSWL_MED      RBL: Sender listed at https://www.dnswl.org/,
 medium trust [209.51.188.17 listed in list.dnswl.org]
 2.0 SPOOFED_FREEMAIL       No description available.
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Reply-To: jcb62281@HIDDEN
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.8 (-)

This is a multi-part message in MIME format.
--------------010302090203030408060504
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

This bug was uncovered while developing tests for default_target_compile.  The procedure attempts to determine if a host is set using [info exists target_info(host,name)], but does not use the global target_info.  As a result, the configuration for "unix" is used unconditionally.  This is clearly a bug.

The only potential impact of this patch is that the cflags_for_target board_info parameter will now be correctly retrieved from the host board configuration instead of always from the "unix" board configuration.  It is clear that this was the intent of the original code and doubtful that any testsuites are depending on the current broken behavior.  (If anyone is working around this bug, we should have received complaints about default_target_compile ignoring the selected host.  Had such complaints been received, this bug would have been fixed long ago, therefore no tests will be broken by this patch.  I suspect that nearly all current use of DejaGnu is on "unix" hosts, thus camouflaging this bug very effectively.)


--------------010302090203030408060504
Content-Type: text/plain;
 name="0003-Fix-access-to-target_info-global-in-default_target_c.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename*0="0003-Fix-access-to-target_info-global-in-default_target_c.pa";
 filename*1="tch"

From 7cb6a9fcd198d11c5f969d867d24a17b47d3cdf4 Mon Sep 17 00:00:00 2001
From: Jacob Bachmeyer <jcb62281+dev@HIDDEN>
Date: Fri, 17 May 2019 17:53:54 -0500
Subject: [PATCH 3/9] Fix access to target_info global in default_target_compile

*ChangeLog entry:
	* lib/target.exp (default_target_compile): Use "host_info"
	procedure to probe for a host configuration, instead of checking a
	local empty target_info array due to lacking "global target_info".
---
 lib/target.exp |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/lib/target.exp b/lib/target.exp
index 2620e30..9cc262d 100644
--- a/lib/target.exp
+++ b/lib/target.exp
@@ -326,7 +326,7 @@ proc default_target_compile {source destfile type options} {
 	append ldflags " $LDFLAGS_FOR_TARGET"
     }
 
-    if {[info exists target_info(host,name)]} {
+    if {[host_info exists]} {
 	set host [host_info name]
     } else {
 	set host "unix"
-- 
1.7.4.1


--------------010302090203030408060504--




Acknowledgement sent to jcb62281@HIDDEN:
New bug report received and forwarded. Copy sent to bug-dejagnu@HIDDEN. Full text available.
Report forwarded to bug-dejagnu@HIDDEN:
bug#41295; Package dejagnu. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Tue, 26 May 2020 04:45:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.