From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 0Ww+Fk3z52JNix4AWB0awg (envelope-from ) for ; Mon, 01 Aug 2022 11:37:49 -0400 Received: by simark.ca (Postfix, from userid 112) id 47C1F1EA05; Mon, 1 Aug 2022 11:37:49 -0400 (EDT) Authentication-Results: simark.ca; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=PfdMd0DC; dkim-atps=neutral X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-4.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,NICE_REPLY_A,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 81ED11E9EB for ; Mon, 1 Aug 2022 11:37:48 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 0A42A3857C7B for ; Mon, 1 Aug 2022 15:37:48 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0A42A3857C7B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1659368268; bh=4gbDhNQoRZiEztW4ylhF4mtg91nDSh2IldUmYvV5A3w=; h=Date:Subject:To:References:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=PfdMd0DCAr5q5rjKSJKbpyAOdmm1dd6ZuS7tY9WxPdndgSpo3KJd789dI0CFy79lt h9yroCoP0MYSsMtEUSd4kLfLDR3N37qrKsRoZe8KCQ/uJ/07kGlWb77eLv2bpV7qqZ H7YcQv+OCBaCS5lRRhDt8pbq9X5OhAN1+Rv9EdSA= Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id E6E7138582B9; Mon, 1 Aug 2022 15:37:28 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org E6E7138582B9 Received: from [10.0.0.11] (192-222-157-6.qc.cable.ebox.net [192.222.157.6]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id 63D711E9EB; Mon, 1 Aug 2022 11:37:28 -0400 (EDT) Message-ID: <14374ca2-3979-f2d2-2296-a36ba9c615d2@simark.ca> Date: Mon, 1 Aug 2022 11:37:27 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [PATCH] Disable year 2038 support on 32-bit hosts by default Content-Language: en-US To: Luis Machado , gdb-patches@sourceware.org, binutils@sourceware.org References: <20220801075149.1152064-1-luis.machado@arm.com> <959a19b9-b2c3-6638-e0b9-b66ca8328574@simark.ca> <4224183e-e2c1-9a98-7e41-61a58e49aa29@arm.com> In-Reply-To: <4224183e-e2c1-9a98-7e41-61a58e49aa29@arm.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit 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: , From: Simon Marchi via Gdb-patches Reply-To: Simon Marchi Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" On 2022-08-01 10:17, Luis Machado wrote: > On 8/1/22 15:08, Simon Marchi wrote: >> >> >> On 2022-08-01 03:51, Luis Machado via Gdb-patches wrote: >>> With a recent import of gnulib, code has been pulled that tests and enables >>> 64-bit time_t by default on 32-bit hosts that support it. >>> >>> Although gdb can use the gnulib support, bfd doesn't use gnulib and currently >>> doesn't do these checks. >>> >>> As a consequence, if we have a 32-bit host that supports 64-bit time_t, we'll >>> have a mismatch between gdb's notion of time_t and bfd's notion of time_t. >>> >>> This will lead to mismatches in the struct stat size, leading to memory >>> corruption and crashes. >>> >>> This patch disables the year 2038 check for now, which makes things work >>> reliably again. >>> >>> I'd consider this a temporary fix until we have proper bfd checks for the year >>> 2038, if it makes sense. 64-bit hosts seems to be more common these days, so >>> I'm not sure how important it is to have this support enabled and how soon >>> we want to enable it. >> >> I don't understand: why offer a --enable-year2038 switch if using it >> would produce a broken build? > > That switch is already offered by gnulib since the recent import, and it is on by default. So in practice it produces a broken build for 32-bit hosts > running a distro that understands 64-bit time_t. It's been broken for a while now. Ah ok, I didn't understand that this configure switch was althread provided by gnulib. Makes sense. > What I'm suggesting is having a temporary fix so default builds aren't silently broken due to a mismatch in stat size between GDB and BFD. > > It isn't clear to me if we really want to switch to 64-bit time_t for 32-bit hosts at this point. There is potential for more breakage. My opinion would be to follow the trend and use 64-bit everywhere, and not have to worry about future-proofing anymore. But I don't have any stakes in this. Simon