Skip to content

Commit 63e8c1e

Browse files
committed
tst_clocks: Fix unaddressable byte warning
Valgrind complains about unaddressable byte: tst_test.c:1559: TINFO: Timeout per run is 0h 00m 30s ==28379== Syscall param clock_gettime(tp) points to unaddressable byte(s) ==28379== at 0x497D41D: syscall (in /usr/lib64/libc.so.6) ==28379== by 0x412CCF: syscall_supported_by_kernel (tst_clocks.c:21) ==28379== by 0x412CCF: tst_clock_gettime (tst_clocks.c:71) ==28379== by 0x405A72: heartbeat (tst_test.c:1359) ==28379== by 0x4063CB: testrun (tst_test.c:1443) ==28379== by 0x4063CB: fork_testrun (tst_test.c:1593) ==28379== by 0x40840B: tst_run_tcases (tst_test.c:1687) ==28379== by 0x404CDD: main (tst_test.h:398) ==28379== Address 0x0 is not stack'd, malloc'd or (recently) free'd While this is not a real problem, because it is in the library, this warning appears in every test, which can be confusing. Fixes: 4ac3a9c ("syscalls: Don't pass struct timespec to tst_syscall()") Acked-by: Cyril Hrubis <chrubis@suse.cz> Signed-off-by: Petr Vorel <pvorel@suse.cz>
1 parent 08a0d46 commit 63e8c1e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/tst_clocks.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,9 @@ typedef int (*mysyscall)(clockid_t clk_id, void *ts);
1717
int syscall_supported_by_kernel(long sysnr)
1818
{
1919
int ret;
20+
struct timespec foo;
2021

21-
ret = syscall(sysnr, 0, NULL);
22+
ret = syscall(sysnr, 0, &foo);
2223
if (ret == -1 && errno == ENOSYS)
2324
return 0;
2425

0 commit comments

Comments
 (0)