[MDEV-21165] Server gets crash on checksum CRC32 is 0 Created: 2019-11-28 Updated: 2020-02-02 Resolved: 2020-02-02 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Storage Engine - InnoDB |
| Affects Version/s: | 10.2.24, 10.2.25, 10.1.39, 10.1.40, 10.3.14, 10.3.15, 10.3.16 |
| Fix Version/s: | 10.2.26, 10.1.41, 10.3.17, 10.4.7 |
| Type: | Bug | Priority: | Major |
| Reporter: | Shuode Li | Assignee: | Marko Mäkelä |
| Resolution: | Duplicate | Votes: | 1 |
| Labels: | crash | ||
| Environment: |
All |
||
| Issue Links: |
|
||||||||||||||||
| Description |
|
Recently we get a issue which lead database get crash when query a specific row. We believe it is a MariaDB bug. What we see
We confirmed that the page is not empty and has right data by hexdump like tool. *Analysis *
Which means header_crc32 xor content_crc32. Which means it can get 0. In our scenario, we get a 0 value on the page. On buf0buf.cc function buf_page_is_corrupted
Which when the checksum value is 0, it will think it is crash.
it crash. |
| Comments |
| Comment by Marko Mäkelä [ 2019-12-03 ] | ||||
|
A similar bug was handled in Side note: | ||||
| Comment by Marko Mäkelä [ 2019-12-11 ] | ||||
|
shuodl, I appreciate your observation that the reason why innodb_checksum_algorithm=crc32 can result in a checksum value of 0 is that it is computing an exclusive or of two CRC-32C checksums. The value of a CRC (using any primitive polynomial in a binary Galois field) can only be 0 if the input is all 0. That is, unless the buffer is all zero, its CRC should not be 0. While fixing this bug, I think that we should check whether the | ||||
| Comment by Marko Mäkelä [ 2020-02-02 ] | ||||
|
I performed further analysis of this report. The intentionally crashing ib::fatal() call ought to be from the following code in buf_page_io_complete():
That was reported as line number 6065. But the line number of the ib::fatal() call is 6110 in the reported affected version 10.2.29! The quoted code in buf_page_is_corrupted() was corrected in the fix of Let me try to find the correct affectedVersion. It ought to be one of 10.2.24, 10.2.25, 10.3.14, 10.3.15, 10.3.16. |