From nobody Mon Oct 17 18:05:05 2022 X-Original-To: freebsd-hackers@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4MrlJh0ZGFz4b5M5 for ; Mon, 17 Oct 2022 18:05:08 +0000 (UTC) (envelope-from jschauma@netmeister.org) Received: from panix.netmeister.org (panix.netmeister.org [166.84.7.99]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4MrlJg0rCwz3kTP for ; Mon, 17 Oct 2022 18:05:07 +0000 (UTC) (envelope-from jschauma@netmeister.org) Received: by panix.netmeister.org (Postfix, from userid 1000) id C75D085851; Mon, 17 Oct 2022 14:05:05 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=netmeister.org; s=2022; t=1666029906; bh=vkX+HjP6ttG7aLGuECzOG5ii3aDbJlwni8N49cjZGGg=; h=Date:From:To:Subject:References:In-Reply-To; b=0jkBzaxx3MIKc9giUTFwqSS50pgRsfvH8/mJI3Kbt49sVuKQPszGouK27PAt6UzQn PFbf0gzZm6jFWVD1s+CLpH1nxo69aD1I2PeY+3jDtf8SJeEmRH0j6my8BWDKzKQbH7 Zd9oUnOyu5ORpH4y5qqzC6tS5EuRVKsvLqgYvXRjSGm8z8pW4WY7vE/D8lP6U82qYP hdYHppiOiHxCQIvumINrC/rCuSUZEZAxDSN/uXmT/LvwXfrUpg/53ROWX1yRULeVsV RUTGtMawZo27kd0RfYOF6gzEx8HzsP5gChNj1N1SB/QE16qMyvXCSNB0AYix8Rrui1 czXNjhwEpE4Mw== Date: Mon, 17 Oct 2022 14:05:05 -0400 From: Jan Schaumann To: freebsd-hackers@freebsd.org Subject: Re: host unresponsive when setting time very far in the future Message-ID: Mail-Followup-To: freebsd-hackers@freebsd.org References: List-Id: Technical discussions relating to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-hackers List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-hackers@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Rspamd-Queue-Id: 4MrlJg0rCwz3kTP X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=netmeister.org header.s=2022 header.b=0jkBzaxx; dmarc=pass (policy=quarantine) header.from=netmeister.org; spf=pass (mx1.freebsd.org: domain of jschauma@netmeister.org designates 166.84.7.99 as permitted sender) smtp.mailfrom=jschauma@netmeister.org X-Spamd-Result: default: False [-4.00 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-1.000]; DMARC_POLICY_ALLOW(-0.50)[netmeister.org,quarantine]; R_DKIM_ALLOW(-0.20)[netmeister.org:s=2022]; R_SPF_ALLOW(-0.20)[+a]; MIME_GOOD(-0.10)[text/plain]; MIME_TRACE(0.00)[0:+]; MLMMJ_DEST(0.00)[freebsd-hackers@freebsd.org]; RCVD_TLS_LAST(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; ASN(0.00)[asn:2033, ipnet:166.84.0.0/16, country:US]; ARC_NA(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; RCVD_COUNT_TWO(0.00)[2]; FROM_HAS_DN(0.00)[]; DKIM_TRACE(0.00)[netmeister.org:+]; TO_MATCH_ENVRCPT_ALL(0.00)[]; TO_DN_NONE(0.00)[]; MID_RHS_MATCH_FROM(0.00)[] X-ThisMailContainsUnwantedMimeParts: N Warner Losh wrote: > We do know that if the year (tm_year) overflows an int (32-bit signed), > we'll > have problems. It would be approximately year 2,147,483,648 (since I think > the limitation is signed, not unsigned, but if unsigned it's 4294967296 > instead). Right, though since tm_year is defined as "year ­ 1900", I'd expect to be able to reach 12/31 23:59:59 in 2,147,485,547, as on e.g., NetBSD and Linux: netbsd$ date -r 67768036191676799 Wed Dec 31 23:59:59 UTC 2147485547 linux$ date --date '@67768036191676799' Wed Dec 31 11:59:59 PM UTC 2147485547 But FreeBSD: freebsd$ date -r 67768036191676799 date: invalid time freebsd$ date -r 67767976233532799 Tue Dec 31 23:59:59 UTC 2147483647 Kinda unclear to me how FreeBSD ended up with a tm_year value that's not 1900 based here? > Anything beyond that we know definitely won't work. Why we fall short > and "only" make it to year 1.561,694,399, I don't know the root > cause of. It's not even a nice, round multiple of the above... Regardless of the root cause, though, I think something somewhere should return EINVAL before the system freaks out. :-) -Jan