[MDEV-31641] innochecksum dies with Floating point exception Created: 2023-07-06  Updated: 2023-07-17  Resolved: 2023-07-10

Status: Closed
Project: MariaDB Server
Component/s: Storage Engine - InnoDB
Affects Version/s: 10.2, 10.3, 10.4, 10.5, 10.6, 10.7, 10.8, 10.9, 10.10, 10.11, 11.0, 11.1, 11.2, 10.6.14
Fix Version/s: 10.4.31, 10.5.22, 10.6.15, 10.9.8, 10.10.6, 10.11.5, 11.0.3, 11.1.2, 11.2.1

Type: Bug Priority: Major
Reporter: Edward Stoever Assignee: Marko Mäkelä
Resolution: Fixed Votes: 0
Labels: Papercut, beginner-friendly

Attachments: File ibdata1.gz    
Issue Links:
Problem/Incident
is caused by MDEV-25361 innochecksum must not report errors f... Closed

 Description   

When using
/usr/bin/innochecksum Ver 10.6.14, for debian-linux-gnu (x86_64)
I get "Floating point exception" error at end of output for the command

/usr/bin/innochecksum -S ./ibdata1
...
Undo page type: 459
Undo page state: 0 active, 285 cached, 0 to_purge, 0 prepared, 174 other
index_id        #pages          #leaf_pages     #recs_per_page  #bytes_per_page
1               1               1               171             15368
2               10              9               138             9213
3               5               4               91              7322
4               4               3               145             6528
5               1               1               171             7673
11              3               2               58              6882
12              1               1               174             12921
13              1               1               174             11773
14              1               1               184             14895
Floating point exception

Testing against the same ibdata1 file against innochecksum that is provided with mysql 5.7.42 I do not get any error.

I have seen this on two recent cases. ibdata1 file is attached.



 Comments   
Comment by Daniel Black [ 2023-07-06 ]

The n_leaf_pages is 0 for a particular index it seems (bottom of defrag_analysis function in ./extra/innochecksum.cc).

Comment by Marko Mäkelä [ 2023-07-10 ]

This was caused by MDEV-25361. If an index or a table has been dropped and the page is marked as freed, we should not report anything. The floating point exception is being reported for entries that are all 0, except for the freed_pages member:

			/* update per-index statistics */
			{
				per_index_stats &index = index_ids[id];
				if (is_page_free(xdes, physical_page_size,
						 page_no)) {
					index.free_pages++;
					return;
				}
 
				index.pages++;

The invocation of std::map::operator[] will allocate and default-initialize an element.

Generated at Thu Feb 08 10:25:23 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.