/memcheck/tests/freebsd/capsicum
/memcheck/tests/freebsd/chflags
/memcheck/tests/freebsd/chmod_chown
+/memcheck/tests/freebsd/clock_nanosleep_interrupt
/memcheck/tests/freebsd/delete_sized_mismatch
/memcheck/tests/freebsd/errno_aligned_allocs
/memcheck/tests/freebsd/eventfd1
chflags.stderr.exp-x86 \
chmod_chown.vgtest \
chmod_chown.stderr.exp \
+ clock_nanosleep_interrupt.vgtest \
+ clock_nanosleep_interrupt.stderr.exp \
delete_sized_mismatch.vgtest \
delete_sized_mismatch.stderr.exp \
delete_sized_mismatch_xml.vgtest \
access aio aio_read aligned_alloc bug464476 bug470713 \
bug483786 \
capsicum chflags \
- chmod_chown delete_sized_mismatch errno_aligned_allocs \
+ chmod_chown clock_nanosleep_interrupt \
+ delete_sized_mismatch errno_aligned_allocs \
extattr \
fexecve \
file_locking_wait6 \
--- /dev/null
+
+#include <time.h>
+
+/* should complain about rqtp and rmtp */
+void valgrind_should_complain(void)
+{
+ struct timespec ts_uninitialized;
+
+ clock_nanosleep(CLOCK_MONOTONIC, 0, &ts_uninitialized, &ts_uninitialized);
+}
+
+/* should have no complaints */
+void valgrind_should_not_complain(void)
+{
+ struct timespec ts_initialized = {0};
+
+ clock_nanosleep(CLOCK_MONOTONIC, 0, &ts_initialized, &ts_initialized);
+}
+
+/* should have no complaints */
+void valgrind_should_not_complain2(void)
+{
+ struct timespec ts_initialized = {0};
+
+ clock_nanosleep(CLOCK_MONOTONIC, TIMER_ABSTIME, &ts_initialized,
+ &ts_initialized);
+}
+
+int main(int argc, char** argv)
+{
+
+ valgrind_should_complain();
+ valgrind_should_not_complain();
+ valgrind_should_not_complain2();
+
+ return (0);
+}
--- /dev/null
+Syscall param clock_nanosleep(rqtp) points to uninitialised byte(s)
+ ...
+ by 0x........: valgrind_should_complain (bug483786.c:9)
+ by 0x........: main (bug483786.c:32)
+ Address 0x........ is on thread 1's stack
+ in frame #1, created by valgrind_should_complain (bug483786.c:6)
+
--- /dev/null
+prog: bug483786
+vgopts: -q
--- /dev/null
+#include <fcntl.h>
+#include <signal.h>
+#include <stdio.h>
+#include <sys/time.h>
+#include <unistd.h>
+#include <stdlib.h>
+
+volatile int ticks = 0;
+struct itimerval timert;
+struct sigaction timer_action;
+
+void handle_vtalrm(int sig) { ticks++; }
+
+
+int main(int argc, char* argv[])
+{
+ timer_action.sa_handler = handle_vtalrm;
+ sigemptyset(&timer_action.sa_mask);
+ timer_action.sa_flags = SA_RESTART;
+
+ sigaction(SIGVTALRM, &timer_action, NULL);
+
+ timert.it_interval.tv_sec = timert.it_value.tv_sec = 0;
+ timert.it_interval.tv_usec = timert.it_value.tv_usec = 500;
+ setitimer(ITIMER_VIRTUAL, &timert, NULL);
+
+ struct timespec ts_initialized = {0, 1000000};
+ struct timespec* too_small = malloc(1);
+
+ clock_nanosleep(CLOCK_MONOTONIC, TIMER_ABSTIME, &ts_initialized,
+ too_small);
+}
--- /dev/null
+Syscall param clock_nanosleep(rmtp) points to unaddressable byte(s)
+ ...
+ by 0x........: main (clock_nanosleep_interrupt.c:30)
+ Address 0x........ is 0 bytes after a block of size 1 alloc'd
+ at 0x........: malloc (vg_replace_malloc.c:...)
+ by 0x........: main (clock_nanosleep_interrupt.c:28)
+
--- /dev/null
+prog: clock_nanosleep_interrupt
+vgopts: -q