Commit 24892648447 for php.net
commit 24892648447d170ded6706a8d3c5473f9bdc679c
Author: NickSdot <32384907+NickSdot@users.noreply.github.com>
Date: Thu Jul 30 01:05:33 2026 +0700
Tests: Fixes leaked System V shared-memory segments in tests (#22911)
The two tests leave System V IPC segments behind after successful execution.
Repeated test-suite runs can exhaust IPC limits and cause unrelated SHMOP/SysV
tests to fail.
diff --git a/ext/shmop/tests/shmop_open_private.phpt b/ext/shmop/tests/shmop_open_private.phpt
index 8757de0a633..0ba74e5af65 100644
--- a/ext/shmop/tests/shmop_open_private.phpt
+++ b/ext/shmop/tests/shmop_open_private.phpt
@@ -13,6 +13,8 @@
$read = shmop_read($shm2, 0, 4);
var_dump(is_string($read) && $read !== $write);
+shmop_delete($shm1);
+shmop_delete($shm2);
?>
--EXPECT--
bool(true)
diff --git a/ext/sysvshm/tests/gh16591.phpt b/ext/sysvshm/tests/gh16591.phpt
index d3ece7cd796..fb1c58168f5 100644
--- a/ext/sysvshm/tests/gh16591.phpt
+++ b/ext/sysvshm/tests/gh16591.phpt
@@ -13,11 +13,15 @@ function __serialize(): array {
}
}
-$mem = shm_attach(1);
+$key = ftok(__FILE__, 't');
+$mem = shm_attach($key);
+$cleanup = shm_attach($key);
try {
shm_put_var($mem, 1, new C);
} catch (Error $e) {
echo $e->getMessage(), "\n";
+} finally {
+ shm_remove($cleanup);
}
?>