]> git.sesse.net Git - plocate/commitdiff
uring: always pair io_uring_get_probe_ring and io_uring_free_probe
authorNick Alcock <nick.alcock@oracle.com>
Mon, 20 Mar 2023 11:48:51 +0000 (11:48 +0000)
committerSteinar H. Gunderson <steinar+git@gunderson.no>
Mon, 20 Mar 2023 12:09:02 +0000 (13:09 +0100)
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.

io_uring_engine.cpp

index 63a3af78a86256ad4469443e6f872b4f890a43bc..be9366037ae0dbd9e3ad2f34f7c9995513f1d20a 100644 (file)
@@ -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
 }