Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-37946

Deadlock when reading an encrypted page during SET GLOBAL innodb_read_reads or innodb_write_threads

    XMLWordPrintable

Details

    • Can result in hang or crash

    Description

      Deadlock found on debug build
      Leads to :-

      origin/10.11 77a3d7a985e6a494b8e4b7b5ccd634602a9a7e1f

      # 2025-10-23T11:09:07 [2442810] | Thread 4 (Thread 2451071.2451146 (mariadbd)):
      # 2025-10-23T11:09:07 [2442810] | #0  0x0000000070000002 in syscall_traced ()
      # 2025-10-23T11:09:07 [2442810] | #1  0x00000000e0007c78 in _raw_syscall () at /home/ubuntu/rr/src/preload/raw_syscall.S:120
      # 2025-10-23T11:09:07 [2442810] | #2  0x00000000e0001909 in traced_raw_syscall (call=0x7033235fffa0) at /home/ubuntu/rr/src/preload/syscallbuf.c:377
      # 2025-10-23T11:09:07 [2442810] | #3  0x00000000e0006b80 in sys_futex (call=<optimized out>) at /home/ubuntu/rr/src/preload/syscallbuf.c:2039
      # 2025-10-23T11:09:07 [2442810] | #4  syscall_hook_internal (call=call@entry=0x7033235fffa0) at /home/ubuntu/rr/src/preload/syscallbuf.c:4178
      # 2025-10-23T11:09:07 [2442810] | #5  0x00000000e0007a3c in syscall_hook (call=0x7033235fffa0) at /home/ubuntu/rr/src/preload/syscallbuf.c:4355
      # 2025-10-23T11:09:07 [2442810] | #6  syscall_hook (call=0x7033235fffa0) at /home/ubuntu/rr/src/preload/syscallbuf.c:4339
      # 2025-10-23T11:09:07 [2442810] | #7  0x00000000e0001323 in _syscall_hook_trampoline () at /home/ubuntu/rr/src/preload/syscall_hook.S:308
      # 2025-10-23T11:09:07 [2442810] | #8  0x00000000e000138d in __morestack () at /home/ubuntu/rr/src/preload/syscall_hook.S:443
      # 2025-10-23T11:09:07 [2442810] | #9  0x00000000e00016da in _syscall_hook_trampoline_b8_ca_00_00_00 () at /home/ubuntu/rr/src/preload/syscall_hook.S:634
      # 2025-10-23T11:09:07 [2442810] | #10 0x000024f826115d61 in __futex_abstimed_wait_common64 (private=1885, cancel=true, abstime=0x0, op=393, expected=0, futex_word=0x62e58bf94a28) at ./nptl/futex-internal.c:57
      # 2025-10-23T11:09:07 [2442810] | #11 __futex_abstimed_wait_common (cancel=true, private=1885, abstime=0x0, clockid=0, expected=0, futex_word=0x62e58bf94a28) at ./nptl/futex-internal.c:87
      # 2025-10-23T11:09:07 [2442810] | #12 __GI___futex_abstimed_wait_cancelable64 (futex_word=futex_word@entry=0x62e58bf94a28, expected=expected@entry=0, clockid=clockid@entry=0, abstime=abstime@entry=0x0, private=private@entry=0) at ./nptl/futex-internal.c:139
      # 2025-10-23T11:09:07 [2442810] | #13 0x000024f8261187dd in __pthread_cond_wait_common (abstime=0x0, clockid=0, mutex=0x62e58bf94978, cond=0x62e58bf94a00) at ./nptl/pthread_cond_wait.c:503
      # 2025-10-23T11:09:07 [2442810] | #14 ___pthread_cond_wait (cond=cond@entry=0x62e58bf94a00, mutex=mutex@entry=0x62e58bf94978) at ./nptl/pthread_cond_wait.c:627
      # 2025-10-23T11:09:07 [2442810] | #15 0x000062e588fc86a3 in safe_cond_wait (cond=0x62e58bf94a00, mp=0x62e58bf94950, file=0x62e58917f8f0 "/data/Server/10.11D/tpool/tpool_structs.h", line=181) at /data/Server/10.11D/mysys/thr_mutex.c:489
      # 2025-10-23T11:09:07 [2442810] | #16 0x000062e588d641d5 in tpool::cache<tpool::aiocb>::wait (this=this@entry=0x62e58bf94950, m=...) at /data/Server/10.11D/tpool/tpool_structs.h:181
      # 2025-10-23T11:09:07 [2442810] | #17 0x000062e588d6421d in tpool::cache<tpool::aiocb>::wait (this=0x62e58bf94950) at /data/Server/10.11D/tpool/tpool_structs.h:189
      # 2025-10-23T11:09:07 [2442810] | #18 0x000062e588d5ff9a in io_slots::wait (this=<optimized out>) at /data/Server/10.11D/storage/innobase/os/os0file.cc:109
      # 2025-10-23T11:09:07 [2442810] | #19 os_aio_wait_until_no_pending_writes_low (declare=declare@entry=true) at /data/Server/10.11D/storage/innobase/os/os0file.cc:3199
      # 2025-10-23T11:09:07 [2442810] | #20 0x000062e588d5ffbf in os_aio_wait_until_no_pending_writes (declare=declare@entry=true) at /data/Server/10.11D/storage/innobase/os/os0file.cc:3209
      # 2025-10-23T11:09:07 [2442810] | #21 0x000062e588ea15cd in buf_pool_t::io_buf_t::reserve (this=0x62e589ac9678 <buf_pool+22968>, wait_for_reads=wait_for_reads@entry=true) at /data/Server/10.11D/storage/innobase/buf/buf0buf.cc:1602
      # 2025-10-23T11:09:07 [2442810] | #22 0x000062e588eb87b7 in buf_pool_t::io_buf_reserve (wait_for_reads=true, this=<optimized out>) at /data/Server/10.11D/storage/innobase/include/buf0buf.h:1881
      # 2025-10-23T11:09:07 [2442810] | #23 buf_page_encrypt (space=space@entry=0x62e58bf3e300, bpage=bpage@entry=0xe080fff0, s=s@entry=0xe099e000 "", slot=slot@entry=0xe17ffb18, size=size@entry=0xe17ffb10) at /data/Server/10.11D/storage/innobase/buf/buf0flu.cc:646
      # 2025-10-23T11:09:07 [2442810] | #24 0x000062e588eba630 in buf_page_t::flush (this=this@entry=0xe080fff0, space=space@entry=0x62e58bf3e300) at /data/Server/10.11D/storage/innobase/buf/buf0flu.cc:825
      # 2025-10-23T11:09:07 [2442810] | #25 0x000062e588ebdbbd in buf_flush_LRU_list_batch (max=max@entry=200, n=n@entry=0xe17ffc40, to_withdraw=to_withdraw@entry=0) at /data/Server/10.11D/storage/innobase/buf/buf0flu.cc:1379
      # 2025-10-23T11:09:07 [2442810] | #26 0x000062e588ebe024 in buf_do_LRU_batch (max=max@entry=200, n=n@entry=0xe17ffc40) at /data/Server/10.11D/storage/innobase/buf/buf0flu.cc:1417
      # 2025-10-23T11:09:07 [2442810] | #27 0x000062e588ebe113 in buf_flush_LRU (max_n=200) at /data/Server/10.11D/storage/innobase/buf/buf0flu.cc:1763
      # 2025-10-23T11:09:07 [2442810] | #28 0x000062e588ebe37b in buf_flush_sync_for_checkpoint (lsn=lsn@entry=385881) at /data/Server/10.11D/storage/innobase/buf/buf0flu.cc:2235
      # 2025-10-23T11:09:07 [2442810] | #29 0x000062e588ebf1db in buf_flush_page_cleaner () at /data/Server/10.11D/storage/innobase/buf/buf0flu.cc:2544
      # 2025-10-23T11:09:07 [2442810] | #30 0x000062e588ebf225 in std::__invoke_impl<void, void (*)()> (__f=<optimized out>) at /usr/include/c++/13/bits/invoke.h:60
      # 2025-10-23T11:09:07 [2442810] | #31 std::__invoke<void (*)()> (__fn=<optimized out>) at /usr/include/c++/13/bits/invoke.h:96
      # 2025-10-23T11:09:07 [2442810] | #32 std::thread::_Invoker<std::tuple<void (*)()> >::_M_invoke<0ul> (this=<optimized out>) at /usr/include/c++/13/bits/std_thread.h:292
      # 2025-10-23T11:09:07 [2442810] | #33 std::thread::_Invoker<std::tuple<void (*)()> >::operator() (this=<optimized out>) at /usr/include/c++/13/bits/std_thread.h:299
      # 2025-10-23T11:09:07 [2442810] | #34 std::thread::_State_impl<std::thread::_Invoker<std::tuple<void (*)()> > >::_M_run (this=<optimized out>) at /usr/include/c++/13/bits/std_thread.h:244
      # 2025-10-23T11:09:07 [2442810] | #35 0x000000006fd21bb4 in ?? () from /lib/x86_64-linux-gnu/libstdc++.so.6
      # 2025-10-23T11:09:07 [2442810] | #36 0x000024f826119a94 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:447
      # 2025-10-23T11:09:07 [2442810] | #37 0x000024f8261a6a34 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:100
      

      RR trace is present on SDP:-
      /data/results/1761242641/TBR-2341-TBR-2342

      Attachments

        Issue Links

          Activity

            People

              thiru Thirunarayanan Balathandayuthapani
              saahil Saahil Alam
              Thirunarayanan Balathandayuthapani Thirunarayanan Balathandayuthapani
              Saahil Alam Saahil Alam
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated: