mailing list of musl libc
 help / color / mirror / code / Atom feed
* [musl] [PATCH] fix use of uninitialized dummy_fut in aio_suspend
@ 2022-10-07 12:23 Alexey Izbyshev
  0 siblings, 0 replies; only message in thread
From: Alexey Izbyshev @ 2022-10-07 12:23 UTC (permalink / raw)
  To: musl

aio_suspend waits on a dummy futex in the corner case when the array of
requests contains NULL pointers only. But the value of this futex was
left uninitialized, so if it happens to be non-zero, aio_suspend
degrades to spinning instead of blocking.
---
 src/aio/aio_suspend.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/aio/aio_suspend.c b/src/aio/aio_suspend.c
index 1c1060e3..290b43f2 100644
--- a/src/aio/aio_suspend.c
+++ b/src/aio/aio_suspend.c
@@ -9,7 +9,7 @@ int aio_suspend(const struct aiocb *const cbs[], int cnt, const struct timespec
 {
 	int i, tid = 0, ret, expect = 0;
 	struct timespec at;
-	volatile int dummy_fut, *pfut;
+	volatile int dummy_fut = 0, *pfut;
 	int nzcnt = 0;
 	const struct aiocb *cb = 0;
 
-- 
2.37.2


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-10-07 12:24 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-07 12:23 [musl] [PATCH] fix use of uninitialized dummy_fut in aio_suspend Alexey Izbyshev

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).