==2266368==ERROR: AddressSanitizer: heap-use-after-free on address 0x503000006080 at pc 0x57166638812c bp 0x7ea82bffed00 sp 0x7ea82bffecf0
|
READ of size 8 at 0x503000006080 thread T4
|
2024-10-01 1:15:07 0 [Note] Server socket created on IP: '127.0.0.1'.
|
#0 0x57166638812b in purge_sys_t::get_page(page_id_t) /home/marko/11.2/storage/innobase/trx/trx0purge.cc:791
|
#1 0x571666388a83 in purge_sys_t::choose_next_log() /home/marko/11.2/storage/innobase/trx/trx0purge.cc:901
|
#2 0x571664cc0ba9 in purge_sys_t::fetch_next_rec() /home/marko/11.2/storage/innobase/trx/trx0purge.cc:1014
|
#3 0x571664cc0ba9 in trx_purge_attach_undo_recs /home/marko/11.2/storage/innobase/trx/trx0purge.cc:1236
|
#4 0x571664cc0ba9 in trx_purge(unsigned long, unsigned long) /home/marko/11.2/storage/innobase/trx/trx0purge.cc:1372
|
#5 0x571666376180 in purge_coordinator_state::do_purge() /home/marko/11.2/storage/innobase/srv/srv0srv.cc:1505
|
#6 0x57166637586d in purge_coordinator_callback /home/marko/11.2/storage/innobase/srv/srv0srv.cc:1589
|
…
|
0x503000006080 is located 16 bytes inside of 32-byte region [0x503000006070,0x503000006090)
|
freed by thread T4 here:
|
#0 0x7ea8342fa678 in free ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:52
|
#1 0x571666387c4d in ut_allocator<std::__detail::_Hash_node<std::pair<page_id_t const, buf_block_t*>, true>, true>::deallocate(std::__detail::_Hash_node<std::pair<page_id_t const, buf_block_t*>, true>*, unsigned long) /home/marko/11.2/storage/innobase/include/ut0new.h:426
|
…
|
#8 0x571666387c4d in std::unordered_map<page_id_t const, buf_block_t*, purge_sys_t::hasher, std::equal_to<page_id_t>, ut_allocator<std::pair<page_id_t const, buf_block_t*>, true> >::erase(page_id_t const&) /usr/include/c++/13/bits/unordered_map.h:770
|
#9 0x571666387c4d in purge_sys_t::get_page(page_id_t) /home/marko/11.2/storage/innobase/trx/trx0purge.cc:788
|
#10 0x571666388a83 in purge_sys_t::choose_next_log() /home/marko/11.2/storage/innobase/trx/trx0purge.cc:901
|
#11 0x571664cc0ba9 in purge_sys_t::fetch_next_rec() /home/marko/11.2/storage/innobase/trx/trx0purge.cc:1014
|
#12 0x571664cc0ba9 in trx_purge_attach_undo_recs /home/marko/11.2/storage/innobase/trx/trx0purge.cc:1236
|
#13 0x571664cc0ba9 in trx_purge(unsigned long, unsigned long) /home/marko/11.2/storage/innobase/trx/trx0purge.cc:1372
|
#14 0x571666376180 in purge_coordinator_state::do_purge() /home/marko/11.2/storage/innobase/srv/srv0srv.cc:1505
|
#15 0x57166637586d in purge_coordinator_callback /home/marko/11.2/storage/innobase/srv/srv0srv.cc:1589
|
…
|
previously allocated by thread T4 here:
|
…
|
#7 0x5716663878b9 in std::unordered_map<page_id_t const, buf_block_t*, purge_sys_t::hasher, std::equal_to<page_id_t>, ut_allocator<std::pair<page_id_t const, buf_block_t*>, true> >::operator[](page_id_t const&) /usr/include/c++/13/bits/unordered_map.h:987
|
#8 0x5716663878b9 in purge_sys_t::get_page(page_id_t) /home/marko/11.2/storage/innobase/trx/trx0purge.cc:782
|
#9 0x571666388a83 in purge_sys_t::choose_next_log() /home/marko/11.2/storage/innobase/trx/trx0purge.cc:901
|
#10 0x571664cc0ba9 in purge_sys_t::fetch_next_rec() /home/marko/11.2/storage/innobase/trx/trx0purge.cc:1014
|
#11 0x571664cc0ba9 in trx_purge_attach_undo_recs /home/marko/11.2/storage/innobase/trx/trx0purge.cc:1236
|
#12 0x571664cc0ba9 in trx_purge(unsigned long, unsigned long) /home/marko/11.2/storage/innobase/trx/trx0purge.cc:1372
|
#13 0x571666376180 in purge_coordinator_state::do_purge() /home/marko/11.2/storage/innobase/srv/srv0srv.cc:1505
|
#14 0x57166637586d in purge_coordinator_callback /home/marko/11.2/storage/innobase/srv/srv0srv.cc:1589
|
I was able to reproduce something in rr record:
10.11 21b20712a3fe7ac44291b398a3731e514c23c8a4
==2266368==ERROR: AddressSanitizer: heap-use-after-free on address 0x503000006080 at pc 0x57166638812c bp 0x7ea82bffed00 sp 0x7ea82bffecf0
READ of size 8 at 0x503000006080 thread T4
2024-10-01 1:15:07 0 [Note] Server socket created on IP: '127.0.0.1'.
#0 0x57166638812b in purge_sys_t::get_page(page_id_t) /home/marko/11.2/storage/innobase/trx/trx0purge.cc:791
#1 0x571666388a83 in purge_sys_t::choose_next_log() /home/marko/11.2/storage/innobase/trx/trx0purge.cc:901
#2 0x571664cc0ba9 in purge_sys_t::fetch_next_rec() /home/marko/11.2/storage/innobase/trx/trx0purge.cc:1014
#3 0x571664cc0ba9 in trx_purge_attach_undo_recs /home/marko/11.2/storage/innobase/trx/trx0purge.cc:1236
#4 0x571664cc0ba9 in trx_purge(unsigned long, unsigned long) /home/marko/11.2/storage/innobase/trx/trx0purge.cc:1372
#5 0x571666376180 in purge_coordinator_state::do_purge() /home/marko/11.2/storage/innobase/srv/srv0srv.cc:1505
#6 0x57166637586d in purge_coordinator_callback /home/marko/11.2/storage/innobase/srv/srv0srv.cc:1589
…
0x503000006080 is located 16 bytes inside of 32-byte region [0x503000006070,0x503000006090)
freed by thread T4 here:
#0 0x7ea8342fa678 in free ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:52
#1 0x571666387c4d in ut_allocator<std::__detail::_Hash_node<std::pair<page_id_t const, buf_block_t*>, true>, true>::deallocate(std::__detail::_Hash_node<std::pair<page_id_t const, buf_block_t*>, true>*, unsigned long) /home/marko/11.2/storage/innobase/include/ut0new.h:426
…
#8 0x571666387c4d in std::unordered_map<page_id_t const, buf_block_t*, purge_sys_t::hasher, std::equal_to<page_id_t>, ut_allocator<std::pair<page_id_t const, buf_block_t*>, true> >::erase(page_id_t const&) /usr/include/c++/13/bits/unordered_map.h:770
#9 0x571666387c4d in purge_sys_t::get_page(page_id_t) /home/marko/11.2/storage/innobase/trx/trx0purge.cc:788
#10 0x571666388a83 in purge_sys_t::choose_next_log() /home/marko/11.2/storage/innobase/trx/trx0purge.cc:901
#11 0x571664cc0ba9 in purge_sys_t::fetch_next_rec() /home/marko/11.2/storage/innobase/trx/trx0purge.cc:1014
#12 0x571664cc0ba9 in trx_purge_attach_undo_recs /home/marko/11.2/storage/innobase/trx/trx0purge.cc:1236
#13 0x571664cc0ba9 in trx_purge(unsigned long, unsigned long) /home/marko/11.2/storage/innobase/trx/trx0purge.cc:1372
#14 0x571666376180 in purge_coordinator_state::do_purge() /home/marko/11.2/storage/innobase/srv/srv0srv.cc:1505
#15 0x57166637586d in purge_coordinator_callback /home/marko/11.2/storage/innobase/srv/srv0srv.cc:1589
…
previously allocated by thread T4 here:
…
#7 0x5716663878b9 in std::unordered_map<page_id_t const, buf_block_t*, purge_sys_t::hasher, std::equal_to<page_id_t>, ut_allocator<std::pair<page_id_t const, buf_block_t*>, true> >::operator[](page_id_t const&) /usr/include/c++/13/bits/unordered_map.h:987
#8 0x5716663878b9 in purge_sys_t::get_page(page_id_t) /home/marko/11.2/storage/innobase/trx/trx0purge.cc:782
#9 0x571666388a83 in purge_sys_t::choose_next_log() /home/marko/11.2/storage/innobase/trx/trx0purge.cc:901
#10 0x571664cc0ba9 in purge_sys_t::fetch_next_rec() /home/marko/11.2/storage/innobase/trx/trx0purge.cc:1014
#11 0x571664cc0ba9 in trx_purge_attach_undo_recs /home/marko/11.2/storage/innobase/trx/trx0purge.cc:1236
#12 0x571664cc0ba9 in trx_purge(unsigned long, unsigned long) /home/marko/11.2/storage/innobase/trx/trx0purge.cc:1372
#13 0x571666376180 in purge_coordinator_state::do_purge() /home/marko/11.2/storage/innobase/srv/srv0srv.cc:1505
#14 0x57166637586d in purge_coordinator_callback /home/marko/11.2/storage/innobase/srv/srv0srv.cc:1589
This is related to the purge_sys.pages cache that was implemented in
MDEV-34515.