From a7ff759ca1deacb2e0e6ae3c2d3dce91cc637dfe Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Wed, 19 Apr 2023 07:39:10 +0200 Subject: [PATCH] linux: fix academic valgrind warning (#3960) Fix a valgrind warning that only manifested with clang (not gcc!) by explicitly passing 0L instead of plain 0 as the |sigsz| argument to io_uring_enter(). That is, pass a long instead of an int. On x86_64, |sigsz| is passed on the stack (the other arguments are passed in registers) but where gcc emits a `push $0` that zeroes the entire stack slot, clang emits a `movl $0,(%rsp)` that leaves the upper 32 bits untouched. It's academic though since we don't pass IORING_ENTER_EXT_ARG and the kernel therefore completely ignores the argument. Refs: https://github.com/libuv/libuv/pull/3952 --- src/unix/linux.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/unix/linux.c b/src/unix/linux.c index 875dfcbf..5b6613be 100644 --- a/src/unix/linux.c +++ b/src/unix/linux.c @@ -348,7 +348,13 @@ int uv__io_uring_enter(int fd, * in newer kernels unless IORING_ENTER_EXT_ARG is set, * in which case it takes a struct io_uring_getevents_arg. */ - return syscall(__NR_io_uring_enter, fd, to_submit, min_complete, flags, 0, 0); + return syscall(__NR_io_uring_enter, + fd, + to_submit, + min_complete, + flags, + NULL, + 0L); }