From 7ee728e2c7594d1d75bc1a45ee3d77669551f57f Mon Sep 17 00:00:00 2001 From: Chen Chengjun Date: Thu, 25 Jul 2024 17:14:46 +0800 Subject: [PATCH] Fix robust list iteartion bug --- kernel/aster-nix/src/process/posix_thread/robust_list.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kernel/aster-nix/src/process/posix_thread/robust_list.rs b/kernel/aster-nix/src/process/posix_thread/robust_list.rs index 5116d26cc..b360d82db 100644 --- a/kernel/aster-nix/src/process/posix_thread/robust_list.rs +++ b/kernel/aster-nix/src/process/posix_thread/robust_list.rs @@ -92,7 +92,8 @@ impl<'a> Iterator for FutexIter<'a> { return None; } - while self.entry_ptr != &self.robust_list.list as *const _ as usize { + let end_ptr = self.robust_list.list.next; + while self.entry_ptr != end_ptr || self.count == 0 { if self.count == ROBUST_LIST_LIMIT { break; }