public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Luis Machado <luis.machado@arm.com>
To: Simon Marchi <simark@simark.ca>,
	gdb-patches@sourceware.org, binutils@sourceware.org
Subject: Re: [PATCH] Disable year 2038 support on 32-bit hosts by default
Date: Mon, 1 Aug 2022 15:17:15 +0100	[thread overview]
Message-ID: <4224183e-e2c1-9a98-7e41-61a58e49aa29@arm.com> (raw)
In-Reply-To: <959a19b9-b2c3-6638-e0b9-b66ca8328574@simark.ca>

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.

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.

  reply	other threads:[~2022-08-01 14:17 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-01  7:51 Luis Machado
2022-08-01 14:08 ` Simon Marchi
2022-08-01 14:17   ` Luis Machado [this message]
2022-08-01 15:37     ` Simon Marchi
2022-08-01 15:58       ` Eli Zaretskii
2022-08-02  6:42         ` Luis Machado
2022-08-08 11:34           ` Luis Machado
2022-08-08 11:58             ` Eli Zaretskii
2022-08-08 12:04               ` Luis Machado
2022-08-08 12:38                 ` Eli Zaretskii
2022-08-08 17:55           ` Paul Eggert
2022-08-08 18:00             ` Luis Machado
2022-08-08 18:01               ` Luis Machado
2022-08-09 15:49                 ` Paul Eggert
2022-08-09 15:59                   ` Luis Machado
2022-08-09 16:13                     ` Paul Eggert
2022-08-10  9:41                     ` Nick Clifton
2022-08-10 10:14                       ` Luis Machado
2022-08-09 16:29                   ` Eli Zaretskii
2022-08-09 17:02                     ` Paul Eggert
2022-08-10  8:38                       ` Alan Modra
2022-08-08 14:51 ` Nick Clifton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4224183e-e2c1-9a98-7e41-61a58e49aa29@arm.com \
    --to=luis.machado@arm.com \
    --cc=binutils@sourceware.org \
    --cc=gdb-patches@sourceware.org \
    --cc=simark@simark.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).