In article
<> writes:

>We discovered that one of the kyua test failing from gettimeofday tests.
>The error is reproducible on recent snapshot from 11-CURRENT:
>root@freebsd:~ # cat test-gtod.c
>#include <sys/time.h>
>#include <stdio.h>
>main(int argc, char **argv)
>        return (gettimeofday((void *)-1, NULL));

Undefined behavior here, so the implementation is allowed to do
literally anything at all.  Certainly there's nothing wrong with it
dumping core here, and the test is erroneous if it expects otherwise.
The first argument to gettimeofday() MUST be a valid pointer to struct
timeval, and the implementation does depend on this.

Perhaps the test was (erroneously) written to assume that
gettimeofday() was a system call, and could therefore detect invalid
pointers and return [EFAULT].  This has not been the case for some
time.  (In HEAD, not since r237434, which is three years ago.)


_______________________________________________ mailing list
To unsubscribe, send any mail to ""

Reply via email to