From: Nick Alcock Date: Mon, 20 Mar 2023 11:48:51 +0000 (+0000) Subject: uring: always pair io_uring_get_probe_ring and io_uring_free_probe X-Git-Tag: 1.1.19~3 X-Git-Url: https://git.sesse.net/?p=plocate;a=commitdiff_plain;h=7f39444852308224240ebfb75e0bf8f39403afa0 uring: always pair io_uring_get_probe_ring and io_uring_free_probe As of liburing 2.4-to-be, liburing has ceased using malloc for its probe allocations: it's concealed behind layers of confusing macros, but io_uring_get_probe_ring() doesn't actually use libc's malloc but ratehr its own __uring_alloc/__uring_free functions. So it no longer works to free() the return value of io_uring_get_probe_ring(): you have to use io_uring_free_probe() instead. I am going to report this to liburing upstream as a possible bug, but it is easy to work around in plocate in any case. --- diff --git a/io_uring_engine.cpp b/io_uring_engine.cpp index 63a3af7..be93660 100644 --- a/io_uring_engine.cpp +++ b/io_uring_engine.cpp @@ -41,7 +41,7 @@ IOUringEngine::IOUringEngine(size_t slop_bytes) if (!supports_stat) { dprintf("io_uring on this kernel does not support statx(); will do synchronous access checking.\n"); } - free(probe); + io_uring_free_probe(probe); } #endif }