[MDEV-8819] Failing assertion: block->page.space == page_get_space_id(page_align(ptr)) in file buf0buf.cc line 2551 Created: 2015-09-20  Updated: 2017-10-31  Resolved: 2015-09-25

Status: Closed
Project: MariaDB Server
Component/s: Encryption, Storage Engine - InnoDB, Storage Engine - XtraDB
Affects Version/s: 10.1
Fix Version/s: 10.1.8

Type: Bug Priority: Major
Reporter: Elena Stepanova Assignee: Jan Lindström (Inactive)
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Relates
relates to MDEV-14140 IMPORT TABLESPACE must not go beyond ... Closed
Sprint: 10.1.8-3

 Description   

2015-09-20  1:45:55 140516505151232 [Note] InnoDB: Creating #1 thread id 140515701946112 total threads 5.
2015-09-20  1:45:55 140515676768000 [ERROR] InnoDB: Corruption: Block space_id 45 != page space_id 0 or Block offset 1 != page offset 0
2015-09-20 01:45:55 7fcc5affc700  InnoDB: Assertion failure in thread 140515676768000 in file buf0buf.cc line 2551
InnoDB: Failing assertion: block->page.space == page_get_space_id(page_align(ptr))
InnoDB: We intentionally generate a memory trap.

#5  0x00007f73f7e243e0 in *__GI_abort () at abort.c:92
#6  0x00007f73fad431a0 in buf_block_align_instance (buf_pool=0x7f73f766b078, ptr=0x7f73e3b28000 "") at 10.1/storage/xtradb/buf/buf0buf.cc:2550
#7  0x00007f73fad4325b in buf_block_align (ptr=0x7f73e3b28000 "") at 10.1/storage/xtradb/buf/buf0buf.cc:2583
#8  0x00007f73fabdf4df in mtr_memo_contains_page (mtr=0x7f73c9bfcf70, ptr=0x7f73e3b28000 "", type=2) at 10.1/storage/xtradb/mtr/mtr0mtr.cc:424
#9  0x00007f73fab97dce in ibuf_bitmap_page_get_bits_low (page=0x7f73e3b28000 "", page_no=2, zip_size=0, latch_type=2, mtr=0x7f73c9bfcf70, bit=2) at 10.1/storage/xtradb/ibuf/ibuf0ibuf.cc:768
#10 0x00007f73fab9f967 in ibuf_merge_or_delete_for_page (block=0x7f73dbfc0d40, space=45, page_no=2, zip_size=0, update_ibuf_bitmap=1) at 10.1/storage/xtradb/ibuf/ibuf0ibuf.cc:4686
#11 0x00007f73fad481c4 in buf_page_io_complete (bpage=0x7f73dbfc0d40) at 10.1/storage/xtradb/buf/buf0buf.cc:4779
#12 0x00007f73fad6610b in buf_read_page_low (err=0x7f73c9bfd60c, sync=true, mode=132, space=45, zip_size=0, unzip=0, tablespace_version=8, offset=2, trx=0x0, rbpage=0x7f73c9bfd688) at 10.1/storage/xtradb/buf/buf0rea.cc:262
#13 0x00007f73fad6659b in buf_read_page (space=45, zip_size=0, offset=2, trx=0x0, bpage=0x7f73c9bfd688) at 10.1/storage/xtradb/buf/buf0rea.cc:474
#14 0x00007f73fad43b89 in buf_page_get_gen (space=45, zip_size=0, offset=2, rw_latch=2, guess=0x0, mode=16, file=0x7f73fb299b90 "10.1/storage/xtradb/fil/fil0crypt.cc", line=1863, mtr=0x7f73c9bfd860, err=0x0) at 10.1/storage/xtradb/buf/buf0buf.cc:2895
#15 0x00007f73fadc6fec in fil_crypt_get_page_throttle_func (state=0x7f73c9bfddc0, space=45, zip_size=0, offset=2, mtr=0x7f73c9bfd860, sleeptime_ms=0x7f73c9bfd818, file=0x7f73fb299b90 "10.1/storage/xtradb/fil/fil0crypt.cc", line=1863) at 10.1/storage/xtradb/fil/fil0crypt.cc:1748
#16 0x00007f73fadc738a in fil_crypt_rotate_page (key_state=0x7f73c9bfddb0, state=0x7f73c9bfddc0) at 10.1/storage/xtradb/fil/fil0crypt.cc:1860
#17 0x00007f73fadc78ff in fil_crypt_rotate_pages (key_state=0x7f73c9bfddb0, state=0x7f73c9bfddc0) at 10.1/storage/xtradb/fil/fil0crypt.cc:2027
#18 0x00007f73fadc8044 in fil_crypt_thread (arg=0x0) at 10.1/storage/xtradb/fil/fil0crypt.cc:2250
#19 0x00007f73f9e35b50 in start_thread (arg=<optimized out>) at pthread_create.c:304
#20 0x00007f73f7eca95d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112

MDEV-8817 and MDEV-8819 can appear interchangeably on the test flow from MDEV-8817.
The test for MDEV-8819 is very similar to MDEV-8817, with slight differences, which hopefully make MDEV-8817 be triggered less (or never), and thus the probability of MDEV-8819 will increase.

RQG command line

perl runall-new.pl --threads=2 --duration=600 --queries=100M --redefine=mdev8819-redefine.yy  --restart-timeout=30 --validators=none --mysqld=--log_output=FILE --mysqld=--plugin_load_add=file_key_management.so --mysqld=--file_key_management_filename=$BASEDIR/mysql-test/std_data/keys.txt  --reporters=QueryTimeout,Backtrace,ErrorLog,Deadlock,CrashRestart --grammar=mdev8819.yy --gendata=mdev8819.zz --engine=InnoDB  --basedir=$BASEDIR --vardir=<your vardir>

Use RQG from lp:~elenst/randgen/mariadb-patches.
mdev8819.yy, mdev8819-redefine.yy and mdev8819.zz are attached.

The test can also trigger MDEV-8821.



 Comments   
Comment by Jan Lindström (Inactive) [ 2015-09-22 ]

Hmm, totally empty page in buf_block_align_instance, do not yet understand this one.

Comment by Jan Lindström (Inactive) [ 2015-09-25 ]

commit 26e4403f649839e82dd26f7a6b31165063eb2871
Author: Jan Lindström <jan.lindstrom@mariadb.com>
Date: Thu Sep 24 14:02:18 2015 +0300

MDEV-8819: Failing assertion: block->page.space == page_get_space_id(page_align(ptr)) in file buf0buf.cc line 2551

Add error handling on page reading and do not try to access empty pages.

Generated at Thu Feb 08 07:30:02 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.