HEAD (12.0-CURRENT, r320640) [ino64] % uname -mirK ; date ; date -r -67769588800000000 12.0-CURRENT amd64 GENERIC-NODEBUG 1200037 Tue Jul 18 14:59:15 CEST 2017 Segmentation fault (core dumped) STABLE/11 (11.1-PRERELEASE, r319119) % uname -mirK ; date ; date -r -67769588800000000 11.1-PRERELEASE amd64 GENERIC 1100513 Tue Jul 18 14:49:17 CEST 2017 Segmentation fault (core dumped) STABLE/11 (11.0-STABLE, r315133) % uname -mirK ; date ; date -r -67769588800000000 11.0-STABLE amd64 GENERIC 1100509 Tue Jul 18 14:48:47 CEST 2017 Segmentation fault (core dumped) % env TZ= date -r -67769588800000000 Segmentation fault (core dumped) % date -r date.core Tue Jul 18 15:05:26 CEST 2017 % ident /bin/date /bin/date: $FreeBSD: stable/11/lib/csu/amd64/crt1.c 292000 2015-12-08 19:32:58Z emaste $ $FreeBSD: stable/11/lib/csu/common/crtbrand.c 232832 2012-03-11 20:04:09Z kib $ $FreeBSD: stable/11/lib/csu/common/ignore_init.c 245133 2013-01-07 17:58:27Z kib $ $FreeBSD: stable/11/lib/csu/amd64/crti.S 217105 2011-01-07 16:07:51Z kib $ $FreeBSD: stable/11/bin/date/date.c 282608 2015-05-07 20:54:38Z delphij $ $FreeBSD: stable/11/bin/date/netdate.c 244538 2012-12-21 15:54:13Z kevlo $ $FreeBSD: stable/11/bin/date/vary.c 133381 2004-08-09 13:43:39Z yar $ $FreeBSD: stable/11/lib/csu/amd64/crtn.S 217105 2011-01-07 16:07:51Z kib $ STABLE/10 (10.3-STABLE, 1003501) % uname -mirK ; date ; date -r -67769588800000000 10.3-STABLE amd64 GENERIC 1003501 Tue Jul 18 15:13:29 CEST 2017 Sun Jan 0 00:00:00 LMT 1900 % ident /bin/date /bin/date: $FreeBSD: stable/10/lib/csu/amd64/crt1.c 245133 2013-01-07 17:58:27Z kib $ $FreeBSD: stable/10/lib/csu/common/crtbrand.c 232832 2012-03-11 20:04:09Z kib $ $FreeBSD: stable/10/lib/csu/common/ignore_init.c 245133 2013-01-07 17:58:27Z kib $ $FreeBSD: stable/10/lib/csu/amd64/crti.S 217105 2011-01-07 16:07:51Z kib $ $FreeBSD: stable/10/bin/date/date.c 283258 2015-05-21 18:59:11Z delphij $ $FreeBSD: stable/10/bin/date/netdate.c 244538 2012-12-21 15:54:13Z kevlo $ $FreeBSD: stable/10/bin/date/vary.c 133381 2004-08-09 13:43:39Z yar $ $FreeBSD: stable/10/lib/csu/amd64/crtn.S 217105 2011-01-07 16:07:51Z kib $
Proposed fix in https://reviews.freebsd.org/D11660
A commit references this bug: Author: emaste Date: Thu Jul 20 15:28:48 UTC 2017 New revision: 321293 URL: https://svnweb.freebsd.org/changeset/base/321293 Log: date: avoid crash on invalid time localtime(3) returns NULL when passed an invalid time_t but date(1) previously did not handle it. Exit with an error in that case. PR: 220828 Reported by: Vin?cius Zavam Reviewed by: cem, kevans Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D11660 Changes: head/bin/date/date.c
(In reply to commit-hook from comment #2) I confirm it works. root@freebsd-12-0:/usr/src/bin/date # svnlite info Path: . Working Copy Root Path: /usr/src URL: https://svn.freebsd.org/base/head/bin/date Relative URL: ^/head/bin/date Repository Root: https://svn.freebsd.org/base Repository UUID: ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f Revision: 321326 Node Kind: directory Schedule: normal Last Changed Author: emaste Last Changed Rev: 321293 Last Changed Date: 2017-07-20 15:28:48 +0000 (Thu, 20 Jul 2017) root@freebsd-12-0:/usr/src/bin/date # make -s all install clean ===> tests (all) ===> tests (install) ===> tests (clean) root@freebsd-12-0:/usr/src/bin/date # rehash root@freebsd-12-0:/usr/src/bin/date # uname -mirK ; date ; date -r -67769588800000000 12.0-CURRENT amd64 GENERIC 1200038 Fri Jul 21 09:40:04 UTC 2017 date: invalid time
Thank you for the confirmation.
A commit references this bug: Author: emaste Date: Thu Aug 31 02:37:45 UTC 2017 New revision: 323044 URL: https://svnweb.freebsd.org/changeset/base/323044 Log: MFC r321293: date: avoid crash on invalid time localtime(3) returns NULL when passed an invalid time_t but date(1) previously did not handle it. Exit with an error in that case. PR: 220828 Submitted by: Vin?cius Zavam Changes: _U stable/11/ stable/11/bin/date/date.c
A commit references this bug: Author: marius Date: Thu Sep 7 23:28:36 UTC 2017 New revision: 323291 URL: https://svnweb.freebsd.org/changeset/base/323291 Log: MFC: r321293 date: avoid crash on invalid time PR: 220828 Approved by: re (kib) Changes: _U stable/10/ stable/10/bin/date/date.c
Marius thanks for handling the MFC to stable/10.