From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gateway24.websitewelcome.com (gateway24.websitewelcome.com [192.185.51.209]) by sourceware.org (Postfix) with ESMTPS id 98D423870860 for ; Thu, 18 Jun 2020 14:14:20 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 98D423870860 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=tromey.com Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=tom@tromey.com Received: from cm13.websitewelcome.com (cm13.websitewelcome.com [100.42.49.6]) by gateway24.websitewelcome.com (Postfix) with ESMTP id 1FC1B8786 for ; Thu, 18 Jun 2020 09:14:20 -0500 (CDT) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id lvJ6jYuIxwgQAlvJ6j6SC3; Thu, 18 Jun 2020 09:14:20 -0500 X-Authority-Reason: nr=8 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=dD/1Jf9ZWEZ5v59ldp/Q+Kd0Hqf8GnTCCma/1D7TY/o=; b=s1x7HyrF2Xz2ejKwBcdsY1HI2P xKixP7zO+5ulaJX1eDNxTdKEHrftHSrwW3KP4vzxcqwTLDqQoVFlELqnzo38+vz5yvIcLjFPuynyT mExsF2u+s3kz1N7qvSOAa5G2V; Received: from 174-16-104-48.hlrn.qwest.net ([174.16.104.48]:53594 helo=murgatroyd) by box5379.bluehost.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1jlvJ5-000OIb-P9; Thu, 18 Jun 2020 08:14:19 -0600 From: Tom Tromey To: Eli Zaretskii Cc: Tom Tromey , gdb-patches@sourceware.org, Pedro Alves Subject: Re: [PATCH 2/3] Consistently use BFD's time References: <20200114210956.25115-1-tromey@adacore.com> <20200114210956.25115-3-tromey@adacore.com> <83wo9s4sac.fsf@gnu.org> X-Attribution: Tom Date: Thu, 18 Jun 2020 08:14:18 -0600 In-Reply-To: <83wo9s4sac.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 15 Jan 2020 18:07:39 +0200") Message-ID: <87k1044g1x.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - box5379.bluehost.com X-AntiAbuse: Original Domain - sourceware.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tromey.com X-BWhitelist: no X-Source-IP: 174.16.104.48 X-Source-L: No X-Exim-ID: 1jlvJ5-000OIb-P9 X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 174-16-104-48.hlrn.qwest.net (murgatroyd) [174.16.104.48]:53594 X-Source-Auth: tom+tromey.com X-Email-Count: 3 X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-Spam-Status: No, score=-3027.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, JMQ_SPF_NEUTRAL, RCVD_IN_ABUSEAT, RCVD_IN_BARRACUDACENTRAL, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_NEUTRAL, TXREP autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jun 2020 14:14:22 -0000 >>>>> "Eli" == Eli Zaretskii writes: >> From: Tom Tromey >> Cc: Tom Tromey >> Date: Tue, 14 Jan 2020 14:09:55 -0700 >> >> gdb uses the gnulib stat, while BFD does not. This can lead to >> inconsistencies between the two, because the gnulib stat adjusts for >> timezones. Eli> There's one more potential issue with Gnulib's replacement of 'fstat': Eli> it also replaces the definition of 'struct stat', and it does that in Eli> a way that might yield incompatibility between the definition on Eli> the system header and Gnulib's sys/stat.h replacement. I am looking into this issue again for the upcoming gdb 10 release. Looking at the gnulib in the gdb tree, as far as I can tell, it doesn't actually override struct stat. The code is all there: /* Optionally, override 'struct stat' on native Windows. */ #if @GNULIB_OVERRIDES_STRUCT_STAT@ [...] ... however, this is only ever set to 0 in our tree: $ git grep 'GNULIB_OVERRIDES_STRUCT_STAT.*=' -- gnulib/import/ gnulib/import/Makefile.in:GNULIB_OVERRIDES_STRUCT_STAT = @GNULIB_OVERRIDES_STRUCT_STAT@ gnulib/import/m4/sys_stat_h.m4: GNULIB_OVERRIDES_STRUCT_STAT=0; AC_SUBST([GNULIB_OVERRIDES_STRUCT_STAT]) (I chose a tighter grep for the purposes of posting, but in reality I looked at all mentions of GNULIB_OVERRIDES_STRUCT_STAT.) So, I think this is maybe not an issue. The timezone thing, however, remains an issue. It seems dangerous to me that we would have two implementations of stat that would give different answers. It's too easy, IMO, to accidentally compare values from one with values from the other -- in fact, that's what lead to the patches in this thread I'm replying to. Based on this, my inclination is to patch our copy of gnulib to avoid replacing stat on Windows. I'm looking into how to do this. Much of the rest of this series will still be needed. In particular it unearths a real race in the BFD cache. Let me know what you think. Tom