summaryrefslogtreecommitdiff
path: root/t/error-extstore.t
diff options
context:
space:
mode:
authordormando <dormando@rydia.net>2021-08-03 12:50:56 -0700
committerdormando <dormando@rydia.net>2021-08-09 17:09:08 -0700
commitf8a55c4731ab38b8c1a88cb7bf10fadc209fd78f (patch)
tree1f3d66e1904d931adadd39971624285122dc1be3 /t/error-extstore.t
parent5d53b04240938654ecd38f2e609cd821e3a3723f (diff)
downloadmemcached-f8a55c4731ab38b8c1a88cb7bf10fadc209fd78f.tar.gz
core: fix hang bug in extstore
The previous commit (IO queue submit if queue is not NULL, instead of queue count) exposed an apparent long standing bug in extstore: do an ascii-multiget request with multiple keys, but one too-long or otherwise garbage key. This will reset the queue count to 0 but leave a stack pointer to now freed memory. The next request could infinite loop, as this test was causing.
Diffstat (limited to 't/error-extstore.t')
-rw-r--r--t/error-extstore.t8
1 files changed, 8 insertions, 0 deletions
diff --git a/t/error-extstore.t b/t/error-extstore.t
index 6df1528..ed196bc 100644
--- a/t/error-extstore.t
+++ b/t/error-extstore.t
@@ -68,6 +68,14 @@ wait_for_ext();
cmp_ok($stats->{get_aborted_extstore}, '>', 1, 'some extstore queries aborted');
}
+# Infinite loop: if we aborted some extstore requests, the next request would hang
+# the daemon.
+{
+ my $size = 3000 * 1024;
+ my $data = "x" x $size;
+ mem_get_is($sock, "foo1", $data);
+}
+
# Disable automatic page balancing, then move enough pages that the large
# items can no longer be loaded from extstore
{