Commit 4849d94f authored by Marko Mäkelä's avatar Marko Mäkelä

MDEV-28828 SIGSEGV in buf_flush_LRU_list_batch

In commit 73fee39e (MDEV-27985)
a regression was introduced that would cause bpage=nullptr to
be referenced.

buf_flush_LRU_list_batch(): Always terminate the loop upon
encountering a null pointer.
parent 06e9ce79
...@@ -1294,7 +1294,6 @@ static void buf_flush_LRU_list_batch(ulint max, flush_counters_t *n) ...@@ -1294,7 +1294,6 @@ static void buf_flush_LRU_list_batch(ulint max, flush_counters_t *n)
n->flushed + n->evicted < max) || n->flushed + n->evicted < max) ||
recv_recovery_is_on()); ++scanned) recv_recovery_is_on()); ++scanned)
{ {
retry:
buf_page_t *prev= UT_LIST_GET_PREV(LRU, bpage); buf_page_t *prev= UT_LIST_GET_PREV(LRU, bpage);
const lsn_t oldest_modification= bpage->oldest_modification(); const lsn_t oldest_modification= bpage->oldest_modification();
buf_pool.lru_hp.set(prev); buf_pool.lru_hp.set(prev);
...@@ -1326,7 +1325,6 @@ static void buf_flush_LRU_list_batch(ulint max, flush_counters_t *n) ...@@ -1326,7 +1325,6 @@ static void buf_flush_LRU_list_batch(ulint max, flush_counters_t *n)
mysql_mutex_lock(&buf_pool.mutex); mysql_mutex_lock(&buf_pool.mutex);
if (p.second) if (p.second)
buf_pool.stat.n_pages_written+= p.second; buf_pool.stat.n_pages_written+= p.second;
bpage= buf_pool.lru_hp.get();
goto retry; goto retry;
} }
else else
...@@ -1357,6 +1355,7 @@ static void buf_flush_LRU_list_batch(ulint max, flush_counters_t *n) ...@@ -1357,6 +1355,7 @@ static void buf_flush_LRU_list_batch(ulint max, flush_counters_t *n)
else else
/* Can't evict or dispatch this block. Go to previous. */ /* Can't evict or dispatch this block. Go to previous. */
ut_ad(buf_pool.lru_hp.is_hp(prev)); ut_ad(buf_pool.lru_hp.is_hp(prev));
retry:
bpage= buf_pool.lru_hp.get(); bpage= buf_pool.lru_hp.get();
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment