From nobody Mon Oct 17 02:09:52 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 4MrL6V1xw9z4fTjm for ; Mon, 17 Oct 2022 02:09:54 +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 4MrL6T34ctz3qGG for ; Mon, 17 Oct 2022 02:09:53 +0000 (UTC) (envelope-from jschauma@netmeister.org) Received: by panix.netmeister.org (Postfix, from userid 1000) id E924285851; Sun, 16 Oct 2022 22:09:52 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=netmeister.org; s=2022; t=1665972592; bh=qlvtFyx8xCzQSEWjc9QzZuxLA1UCxRAbQgNFmOJBduY=; h=Date:From:To:Subject; b=IJjgxwyDn3AvoaBIbaOzh2JtW9nGygL/UxwYrXh4jfUxa8rGUkaXhX5BqwBKe00rS 8MLJXEqfYnnJkn7/AxxGCNgHp7+imbXmPJ14HMAUacumGfjQwrSmSY8r132qQsFpHH PLAYqn24R3CfTOSUQLtLWEXrdWH1ptGk4iuaOgSEdPBEs/wAFKfOe/Typ+BGtpfm4P lONnLWLnp0UwW9yLEEdI5ygNUnpNvP4AApe6Gv46Z+5pBpA1zGEOAKD529sat4x4Hs JpHAf1X/EUTkh+RPjzANmFK3nDO3elqUumLuH2lVooAaXRJ1JX7J9/U1KcmIAEQhl5 +vQEFc+jc88YQ== Date: Sun, 16 Oct 2022 22:09:52 -0400 From: Jan Schaumann To: freebsd-hackers@freebsd.org Subject: host unresponsive when setting time very far in the future Message-ID: 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=us-ascii Content-Disposition: inline X-Rspamd-Queue-Id: 4MrL6T34ctz3qGG X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=netmeister.org header.s=2022 header.b=IJjgxwyD; 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_SPF_ALLOW(-0.20)[+a:c]; R_DKIM_ALLOW(-0.20)[netmeister.org:s=2022]; 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 Hello, I've observed that trying to set the date _very_ far in the future causes my FreeBSD AWS instance to become unresponsive and requiring a forced reboot to come back. (I don't see an actual kernel panic, however.) # date -f "%s" 44093078356492799 Fri Dec 31 23:59:59 UTC 1397255999 succeeds, but any second more (i.e., into the year 1397256000), and the system locks up. After setting the date as above and waiting a few seconds does increment the seconds since epoch just fine into the year 1397256000: # date +%s 44093078356492850 # date Sat Jan 1 00:00:51 UTC 1397256000 so gettimeofday(2) has no problem with these numbers, but it seems that settimeofday(2) does tickles the kernel in a funny way? What's the significance of this particular year? If tm_year is a 32-bit entity, then I'd expect it to max out at epoch 67768036191676799 aka 12/31 23:59:59 2147485547, but that doesn't seem to be the case here. Any ideas (a) what this limit is, and (b) why the system doesn't handle it gracefully by e.g., returning EINVAL? -Jan