From owner-freebsd-current@freebsd.org Wed Jul 8 19:22:02 2015 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CE29D9966FA for ; Wed, 8 Jul 2015 19:22:02 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pa0-x236.google.com (mail-pa0-x236.google.com [IPv6:2607:f8b0:400e:c03::236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 981851FB7 for ; Wed, 8 Jul 2015 19:22:02 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by pactm7 with SMTP id tm7so136537789pac.2 for ; Wed, 08 Jul 2015 12:22:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:mime-version:content-type:from:in-reply-to:date:cc :message-id:references:to; bh=N6MYfeQAqsUeg1fpbUwojyeWPHKVVzGzu8WOpOKDvF4=; b=LVR8xX+sdrduVm0rp0YbX8OioyEQUG9pzYVJC4lJ8IUeyilOlFAo596AO2vIwf7LXY cbdy6Cn0ZCOduMwiZnxCagM4taIEbmG44nRiusd4G3ymm5TiujuWevL+YuYE1oUUpsqU 1FH7EuYSmChQsoNT8GtiNz5h0HlkmLIJ5vVui2Rl7eRwj5K6/Wawop4Jse8NoeFpwhwX Q5G91U7Iab2QLQlyuI0QJGorNAkCYLUk/YCDbOICUydqk/1pMq+v9kX0PIQK8kyCq+uv DxaeJ/RlLZFla1u+p7bC7DJoEJZ6W0cy0QlLV1XwK+Sh1p376BY7ddVflSlJCMaAXUKC 7pBQ== X-Received: by 10.66.62.202 with SMTP id a10mr23594700pas.42.1436383322279; Wed, 08 Jul 2015 12:22:02 -0700 (PDT) Received: from [192.168.20.5] (c-98-247-240-204.hsd1.wa.comcast.net. [98.247.240.204]) by smtp.gmail.com with ESMTPSA id ml10sm3344001pab.47.2015.07.08.12.22.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 08 Jul 2015 12:22:01 -0700 (PDT) Subject: Re: gettimeofday((void *)-1, NULL) implicates core dump on recent FreeBSD 11-CURRENT Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Content-Type: multipart/signed; boundary="Apple-Mail=_806CD52F-E3BB-41F4-BB73-EAC9F1E93C05"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail 2.5 From: Garrett Cooper In-Reply-To: Date: Wed, 8 Jul 2015 12:22:03 -0700 Cc: Jamie Landeg-Jones , FreeBSD Current Message-Id: <0C541CE5-C322-4273-AE0B-1ACAEACCA096@gmail.com> References: <201507072241.t67MfsX5085860@hergotha.csail.mit.edu> <94BCDA65-5B86-4329-A312-4CB16E847B69@dons.net.au> <201507081616.t68GGcY9047713@dyslexicfish.net> To: Doug Rabson X-Mailer: Apple Mail (2.1878.6) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jul 2015 19:22:03 -0000 --Apple-Mail=_806CD52F-E3BB-41F4-BB73-EAC9F1E93C05 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 On Jul 8, 2015, at 12:17, Doug Rabson wrote: > As far as I can tell, POSIX doesn't require either EFAULT or any other > behaviour - the text in = http://www.open-std.org/jtc1/sc22/open/n4217.pdf > just says, "No errors are defined". Our man page is wrong and any real > program which relies on gettimeofday not faulting when given bad = inputs is > broken. I would suggest the following: 1. Document behavior in NOTES about gettimeofday returning EFAULT with = the specific scenarios kib mentioned, segfaulting otherwise = (wordsmithing the actual info of course). Otherwise, it might confuse = people who look at the manpage later. 2. I=92ll add a `#ifdef __FreeBSD__` to the testcase which will then = skip it, because it=92s easier to do that then test undefined behavior = that only makes sense on NetBSD. Thanks! -NGie --Apple-Mail=_806CD52F-E3BB-41F4-BB73-EAC9F1E93C05 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQEcBAEBCgAGBQJVnXhcAAoJEMZr5QU6S73epyQH+wUuC1k1yxQQiyciCSMbK+T2 JAXuP8lPP8qpR4GoQ2y2hBpbqOpBa4HxTNAYpKQq9SRCjVDvag9XQLTJTCCmQRUk s49xpf+ThNi8w5oMN3TYiIDSWz3j5Y+fjeq4bjSbDpmBA/oF2ryoL+W8d45dRqVG xxBHRjglETufq9XvaxcGgl+Yy4ch90pdoWPr15A1khw8AmbkwAobrGFZIYtj0W8f cgPZwnLbtBan2XlphUYlWnYjn+BTtmMa5MJOnuKh2dLR8wRr71MHgzRF/CCFOUb9 i1T8D05NlfoxZ01gJbfsz+XeI1Jr0O9/74dr/NcQsL9pLvvt26xqlCBNGAPr9Hc= =HhGc -----END PGP SIGNATURE----- --Apple-Mail=_806CD52F-E3BB-41F4-BB73-EAC9F1E93C05--