Bug #114661 ibuf_merge_or_delete_for_page cause crash
Submitted: 16 Apr 2024 22:51 Modified: 17 Apr 2024 10:41
Reporter: yuxiang jiang (OCA) Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:8.0.30 OS:Any
Assigned to: CPU Architecture:Any

[16 Apr 2024 22:51] yuxiang jiang
Description:
We met a crash like below in debug mode.

It seems that change buffer will crash when delete affect 0 rows.

============crash stack in debug version
2024-04-17T06:33:52.967132+08:00 0 [ERROR] [MY-012726] [InnoDB] Records in wrong order on space 6413 page 1912 index `IBUF_DUMMY`

InnoDB: previous record PHYSICAL RECORD: n_fields 3; compact format; info bits 0
 0: len 8; hex 80000000211d5378; asc     ! Sx;;
 1: len 30; hex e2809ce59f8ee5b882e69591e68fb4e2809de8b59be4ba8be59cbae59cb0; asc                               ; (total 39 bytes);
 2: len 8; hex 800000000001ea20; asc         ;;

InnoDB: record PHYSICAL RECORD: n_fields 3; compact format; info bits 0
 0: len 8; hex 80000000211d5378; asc     ! Sx;;
 1: len 30; hex 5be98791e8b0b7e59bad5d2020e6b2b9e7b298e7b1b332356b6728e58c85; asc [         ]           25kg(   ; (total 31 bytes);
 2: len 8; hex 800000000001e8e2; asc         ;;

2024-04-17T06:33:52.967521+08:00 0 [ERROR] [MY-012738] [InnoDB] Apparent corruption in space 6413 page 1912 index `IBUF_DUMMY`
2024-04-17T06:33:52.967535+08:00 0 [ERROR] [MY-013183] [InnoDB] Assertion failure: ibuf0ibuf.cc:4306:page_validate(block->frame, dummy_index) thread 140550513960704
InnoDB: We intentionally generate a memory trap.
InnoDB: Submit a detailed bug report to http://bugs.mysql.com.
InnoDB: If you get repeated assertion failures or crashes, even
InnoDB: immediately after the mysqld startup, there may be
InnoDB: corruption in the InnoDB tablespace. Please refer to
InnoDB: http://dev.mysql.com/doc/refman/8.0/en/forcing-innodb-recovery.html
InnoDB: about forcing recovery.
22:33:52 UTC - mysqld got signal 6 ;
Most likely, you have hit a bug, but this error can also be caused by malfunctioning hardware.
Thread pointer: 0x0
Attempting backtrace. You can use the following information to find out
where mysqld died. If you see no messages after this, something went
terribly wrong...
stack_bottom = 0 thread_stack 0x30000
/data2/mywork/my_mysql/my_mysql-80/my_mysql/mysql_install/mysql-server-8.0.18/bin/mysqld(my_print_stacktrace(unsigned char const*, unsigned long)+0x68) [0x5c0f642]
/data2/mywork/my_mysql/my_mysql-80/my_mysql/mysql_install/mysql-server-8.0.18/bin/mysqld(handle_fatal_signal+0x490) [0x35596c9]
/lib64/libpthread.so.0(+0xf5e0) [0x7fd4ced545e0]
/lib64/libc.so.6(gsignal+0x37) [0x7fd4cd5af1f7]
/lib64/libc.so.6(abort+0x148) [0x7fd4cd5b08e8]
/data2/mywork/my_mysql/my_mysql-80/my_mysql/mysql_install/mysql-server-8.0.18/bin/mysqld(ut_dbg_assertion_failed(char const*, char const*, unsigned long)+0x382) [0x6441d7a]
/data2/mywork/my_mysql/my_mysql-80/my_mysql/mysql_install/mysql-server-8.0.18/bin/mysqld(ibuf_merge_or_delete_for_page(buf_block_t*, page_id_t const&, page_size_t const*, unsigned long)+0x1779) [0x5f5a7ff]
/data2/mywork/my_mysql/my_mysql-80/my_mysql/mysql_install/mysql-server-8.0.18/bin/mysqld(buf_page_io_complete(buf_page_t*, bool)+0x14c7) [0x6588ac8]
/data2/mywork/my_mysql/my_mysql-80/my_mysql/mysql_install/mysql-server-8.0.18/bin/mysqld(fil_aio_wait(unsigned long)+0x40c) [0x67b1926]
/data2/mywork/my_mysql/my_mysql-80/my_mysql/mysql_install/mysql-server-8.0.18/bin/mysqld() [0x63218a9]
/data2/mywork/my_mysql/my_mysql-80/my_mysql/mysql_install/mysql-server-8.0.18/bin/mysqld(void std::__invoke_impl<void, void (*&)(unsigned long), unsigned long&>(std::__invoke_other, void (*&)(unsigned long), unsigned long&)+0x70) [0x6356ea9]
/data2/mywork/my_mysql/my_mysql-80/my_mysql/mysql_install/mysql-server-8.0.18/bin/mysqld(std::__invoke_result<void (*&)(unsigned long), unsigned long&>::type std::__invoke<void (*&)(unsigned long), unsigned long&>(void (*&)(unsigned long), unsigned long&)+0x78) [0x6356d45]
/data2/mywork/my_mysql/my_mysql-80/my_mysql/mysql_install/mysql-server-8.0.18/bin/mysqld(void std::_Bind<void (*(unsigned long))(unsigned long)>::__call<void, , 0ul>(std::tuple<>&&, std::_Index_tuple<0ul>)+0x7e) [0x6356af6]
/data2/mywork/my_mysql/my_mysql-80/my_mysql/mysql_install/mysql-server-8.0.18/bin/mysqld(void std::_Bind<void (*(unsigned long))(unsigned long)>::operator()<, void>()+0x4e) [0x6356670]
/data2/mywork/my_mysql/my_mysql-80/my_mysql/mysql_install/mysql-server-8.0.18/bin/mysqld(void Runnable::operator()<void (*)(unsigned long), unsigned long>(void (*&&)(unsigned long), unsigned long&&)+0x1dd) [0x635603b]
/data2/mywork/my_mysql/my_mysql-80/my_mysql/mysql_install/mysql-server-8.0.18/bin/mysqld(void std::__invoke_impl<void, Runnable, void (*)(unsigned long), unsigned long>(std::__invoke_other, Runnable&&, void (*&&)(unsigned long), unsigned long&&)+0x9a) [0x63540b4]
/data2/mywork/my_mysql/my_mysql-80/my_mysql/mysql_install/mysql-server-8.0.18/bin/mysqld(std::__invoke_result<Runnable, void (*)(unsigned long), unsigned long>::type std::__invoke<Runnable, void (*)(unsigned long), unsigned long>(Runnable&&, void (*&&)(unsigned long), unsigned long&&)+0xa2) [0x634de3b]
/data2/mywork/my_mysql/my_mysql-80/my_mysql/mysql_install/mysql-server-8.0.18/bin/mysqld(decltype (__invoke((_S_declval<0ul>)(), (_S_declval<1ul>)(), (_S_declval<2ul>)())) std::thread::_Invoker<std::tuple<Runnable, void (*)(unsigned long), unsigned long> >::_M_invoke<0ul, 1ul, 2ul>(std::_Index_tuple<0ul, 1ul, 2ul>)+0xe9) [0x6357131]
/data2/mywork/my_mysql/my_mysql-80/my_mysql/mysql_install/mysql-server-8.0.18/bin/mysqld(std::thread::_Invoker<std::tuple<Runnable, void (*)(unsigned long), unsigned long> >::operator()()+0x2f) [0x635700d]
/data2/mywork/my_mysql/my_mysql-80/my_mysql/mysql_install/mysql-server-8.0.18/bin/mysqld(std::thread::_State_impl<std::thread::_Invoker<std::tuple<Runnable, void (*)(unsigned long), unsigned long> > >::_M_run()+0x2e) [0x6356fc8]
/data2/mywork/my_mysql/my_mysql-80/my_mysql/mysql_install/mysql-server-8.0.18/bin/mysqld() [0x735171f]
/lib64/libpthread.so.0(+0x7e25) [0x7fd4ced4ce25]
/lib64/libc.so.6(clone+0x6d) [0x7fd4cd67235d]
The manual page at http://dev.mysql.com/doc/mysql/en/crashing.html contains
information that should help you find out what is causing the crash.
Writing a core file

How to repeat:
This happened By chance
[17 Apr 2024 10:41] MySQL Verification Team
Hi Mr. jiang,

Thank you for your bug report.

We have created ourselves a test case with a table with many rows. Then we ran a DELETE on the value that does not exist in the table.

We had no problems what so ever.

We tried this test case with 8.0.36-debug, 8.2.0-debug and 8.3.0-debug and there were not problems what so ever.

We then analysed all the existing bug and could not find a similar test case, at all.

We simply can not repeat your problem

Hence, we can not proceed without getting a proper test case from you.

Can't repeat.