From f8a55c4731ab38b8c1a88cb7bf10fadc209fd78f Mon Sep 17 00:00:00 2001 From: dormando Date: Tue, 3 Aug 2021 12:50:56 -0700 Subject: 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. --- t/error-extstore.t | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 't') 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 { -- cgit v1.2.1