Date: Wed, 8 Jul 2015 12:22:03 -0700 From: Garrett Cooper <yaneurabeya@gmail.com> To: Doug Rabson <dfr@rabson.org> Cc: Jamie Landeg-Jones <jamie@dyslexicfish.net>, FreeBSD Current <freebsd-current@freebsd.org> Subject: Re: gettimeofday((void *)-1, NULL) implicates core dump on recent FreeBSD 11-CURRENT Message-ID: <0C541CE5-C322-4273-AE0B-1ACAEACCA096@gmail.com> In-Reply-To: <CACA0VUhFjBhPMTr=QD71jEvis9CMSrnpyu=xFiXu27nLeozGJA@mail.gmail.com> References: <CAPQ4ffuTcN_ytcH7GPY0s6OqWK9qo6MGaVZhOB%2B0ojWfd=fNCg@mail.gmail.com> <201507072241.t67MfsX5085860@hergotha.csail.mit.edu> <94BCDA65-5B86-4329-A312-4CB16E847B69@dons.net.au> <CAPQ4ffuuaiWGUthEhux2VrK6ZyHDT=0xd9z8k8f11N=6shdUng@mail.gmail.com> <201507081616.t68GGcY9047713@dyslexicfish.net> <CACA0VUhFjBhPMTr=QD71jEvis9CMSrnpyu=xFiXu27nLeozGJA@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
[-- Attachment #1 --] On Jul 8, 2015, at 12:17, Doug Rabson <dfr@rabson.org> 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’ll add a `#ifdef __FreeBSD__` to the testcase which will then skip it, because it’s easier to do that then test undefined behavior that only makes sense on NetBSD. Thanks! -NGie [-- Attachment #2 --] -----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-----
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?0C541CE5-C322-4273-AE0B-1ACAEACCA096>
