Skip to content

Commit 4164f17

Browse files
committed
MDEV-37360: SIGSEGV in srv_printf_innodb_monitor
srv_printf_innodb_monitor(): After acquiring a latch, abort the iteration if innodb_adaptive_hash_index=OFF. If the adaptive hash index was disabled in a concurrently executing thread, btr_search_sys_t::partition::clear() would have freed part->heap, leading to us dereferencing a null pointer. Reviewed by: Thirunarayanan Balathandayuthapani Tested by: Saahil Alam
1 parent c45a34b commit 4164f17

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

storage/innobase/srv/srv0srv.cc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -774,6 +774,10 @@ srv_printf_innodb_monitor(
774774
for (ulint i = 0; i < btr_ahi_parts; ++i) {
775775
const auto part= &btr_search_sys.parts[i];
776776
part->latch.rd_lock(SRW_LOCK_CALL);
777+
if (!btr_search_enabled) {
778+
part->latch.rd_unlock();
779+
break;
780+
}
777781
ut_ad(part->heap->type == MEM_HEAP_FOR_BTR_SEARCH);
778782
fprintf(file, "Hash table size " ULINTPF
779783
", node heap has " ULINTPF " buffer(s)\n",

0 commit comments

Comments
 (0)