[MDEV-25628] Crash in "mysqld" when importing data - 0xc0000005 Created: 2021-05-10  Updated: 2021-05-11

Status: Open
Project: MariaDB Server
Component/s: None
Affects Version/s: 10.6.0
Fix Version/s: None

Type: Bug Priority: Major
Reporter: Martin Rotter Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None
Environment:

Happens also with MariaDB 10.5.x, x86 installation on x86 Windows 10 Pro. Database size is around 5.5 GB. 4 GB of RAM.



 Description   

Below output of "mysqld". I was running "source mydata.sql" on the other machine and when command completed I entered "quit" command in "mysql.exe" and then "mysqld" immediately crashed.

Crashes with basically same error output occured also randomly with same dataset when someone ran any query against the DB.

Any help appreciated.

PS C:\Program Files\MariaDB 10.6\bin> .\mysqld --console
2021-05-10  9:15:56 0 [Note] C:\Program Files\MariaDB 10.6\bin\mysqld.exe (mysqld 10.6.0-MariaDB) starting as process 44
084 ...
2021-05-10  9:15:56 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2021-05-10  9:15:56 0 [Note] InnoDB: Number of pools: 1
2021-05-10  9:15:56 0 [Note] InnoDB: Using SSE4.2 crc32 instructions
2021-05-10  9:15:56 0 [Note] InnoDB: Initializing buffer pool, total size = 536870912, chunk size = 134217728
2021-05-10  9:15:56 0 [Note] InnoDB: Completed initialization of buffer pool
2021-05-10  9:15:56 0 [Note] InnoDB: 128 rollback segments are active.
2021-05-10  9:15:57 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2021-05-10  9:15:57 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wai
t ...
2021-05-10  9:15:57 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2021-05-10  9:15:57 0 [Note] InnoDB: 10.6.0 started; log sequence number 153170; transaction id 112
2021-05-10  9:15:57 0 [Note] Plugin 'FEEDBACK' is disabled.
2021-05-10  9:15:57 0 [Note] InnoDB: Loading buffer pool(s) from C:\Program Files\MariaDB 10.6\data\ib_buffer_pool
2021-05-10  9:15:57 0 [Note] Server socket created on IP: '::'.
2021-05-10  9:15:57 0 [Note] Server socket created on IP: '0.0.0.0'.
2021-05-10  9:15:57 0 [Note] InnoDB: Buffer pool(s) load completed at 210510  9:15:57
2021-05-10  9:15:57 0 [Note] Reading of all Master_info entries succeeded
2021-05-10  9:15:57 0 [Note] Added new Master_info '' to hash table
2021-05-10  9:15:57 0 [Note] C:\Program Files\MariaDB 10.6\bin\mysqld.exe: ready for connections.
Version: '10.6.0-MariaDB'  socket: ''  port: 3306  mariadb.org binary distribution
2021-05-10  9:23:15 6 [ERROR] InnoDB: Space id and page no stored in the page, read in are [page id: space=8, page numbe
r=128], should be [page id: space=8, page number=262272]
210510  9:23:15 [ERROR] mysqld got exception 0xc0000005 ;
This could be because you hit a bug. It is also possible that this binary
or one of the libraries it was linked against is corrupt, improperly built,
or misconfigured. This error can also be caused by malfunctioning hardware.
 
To report this bug, see https://mariadb.com/kb/en/reporting-bugs
 
We will try our best to scrape up some info that will hopefully help
diagnose the problem, but since we have already crashed,
something is definitely wrong and this may fail.
 
Server version: 10.6.0-MariaDB
key_buffer_size=134217728
read_buffer_size=131072
max_used_connections=2
max_threads=65537
thread_count=2
It is possible that mysqld could use up to
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 135636 K  bytes of memory
Hope that's ok; if not, decrease some variables in the equation.
 
Thread pointer: 0x360c39f8
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...
server.dll!page_cur_search_with_match()[page0cur.cc:390]
server.dll!btr_cur_search_to_nth_level_func()[btr0cur.cc:1983]
server.dll!Row_sel_get_clust_rec_for_mysql::operator()()[row0sel.cc:3283]
server.dll!row_search_mvcc()[row0sel.cc:5388]
server.dll!ha_innobase::index_read()[ha_innodb.cc:8616]
server.dll!handler::index_read_map()[handler.h:3857]
server.dll!handler::ha_index_read_map()[handler.cc:3125]
server.dll!join_read_always_key()[sql_select.cc:21606]
server.dll!sub_select()[sql_select.cc:20842]
server.dll!evaluate_join_record()[sql_select.cc:21069]
server.dll!sub_select()[sql_select.cc:20884]
server.dll!do_select()[sql_select.cc:20392]
server.dll!JOIN::exec_inner()[sql_select.cc:4598]
server.dll!JOIN::exec()[sql_select.cc:4379]
server.dll!mysql_select()[sql_select.cc:4856]
server.dll!handle_select()[sql_select.cc:446]
server.dll!execute_sqlcom_select()[sql_parse.cc:6244]
server.dll!mysql_execute_command()[sql_parse.cc:3940]
server.dll!mysql_parse()[sql_parse.cc:8018]
server.dll!dispatch_command()[sql_parse.cc:1897]
server.dll!do_command()[sql_parse.cc:1406]
server.dll!threadpool_process_request()[threadpool_common.cc:394]
server.dll!tp_callback()[threadpool_common.cc:203]
server.dll!io_completion_callback()[threadpool_win.cc:299]
KERNEL32.DLL!FlsSetValue()
ntdll.dll!TpWaitForWait()
ntdll.dll!TpCallbackIndependent()
KERNEL32.DLL!BaseThreadInitThunk()
ntdll.dll!RtlExpandEnvironmentStrings_U()
ntdll.dll!RtlExpandEnvironmentStrings_U()
 
Trying to get some variables.
Some pointers may be invalid and cause the dump to abort.
Query (0x35dae560): SELECT MAX(IdRadek) FROM dokumentace_Soubory s JOIN dokumentace_Navstevy n ON n.IdPacienta = '909808
640' AND s.TypObsahu = 1 AND s.IdNavstevy = n.IdNavstevy
Connection ID (thread ID): 6
Status: NOT_KILLED
 
Optimizer switch: index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_
sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,fi
rstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table
_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,
join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=on,table_elimination=on,exten
ded_keys=on,exists_to_in=on,orderby_uses_equalities=on,condition_pushdown_for_derived=on,split_materialized=on,condition
_pushdown_for_subquery=on,rowid_filter=on,condition_pushdown_from_having=on,not_null_range_scan=off
 
The manual page at https://mariadb.com/kb/en/how-to-produce-a-full-stack-trace-for-mysqld/ contains
information that should help you find out what is causing the crash.
Writing a core file at C:\Program Files\MariaDB 10.6\data\



 Comments   
Comment by Alice Sherepa [ 2021-05-11 ]

Is it suitable for you to add mydata.sql? Or at least table structures for dokumentace_Soubory and dokumentace_Navstevy.

Comment by Martin Rotter [ 2021-05-11 ]

Sorry, I cannot post data here, quite confidential. Structures:

-- --------------------------------------------------------
-- Hostitel:                     127.0.0.1
-- Verze serveru:                10.5.3-MariaDB - mariadb.org binary distribution
-- OS serveru:                   Win64
-- HeidiSQL Verze:               11.2.0.6213
-- --------------------------------------------------------
 
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET NAMES utf8 */;
/*!50503 SET NAMES utf8mb4 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
 
 
-- Exportování struktury databáze pro
CREATE DATABASE IF NOT EXISTS `elektronickadokumentace` /*!40100 DEFAULT CHARACTER SET utf8mb4 */;
USE `elektronickadokumentace`;
 
-- Exportování struktury pro tabulka elektronickadokumentace.dokumentace_adresy
CREATE TABLE IF NOT EXISTS `dokumentace_adresy` (
  `IdAdresy` int(11) NOT NULL AUTO_INCREMENT,
  `Ulice` varchar(50) NOT NULL,
  `Obec` varchar(50) NOT NULL,
  `CisloPopisne` varchar(50) NOT NULL,
  `CisloOrientacni` varchar(50) NOT NULL,
  `Psc` varchar(10) NOT NULL,
  PRIMARY KEY (`IdAdresy`)
) ENGINE=InnoDB AUTO_INCREMENT=4162 DEFAULT CHARSET=utf8mb4;
 
-- Export dat nebyl vybrán.
 
-- Exportování struktury pro tabulka elektronickadokumentace.dokumentace_navstevy
CREATE TABLE IF NOT EXISTS `dokumentace_navstevy` (
  `IdNavstevy` int(11) NOT NULL AUTO_INCREMENT,
  `IdPacienta` varchar(20) CHARACTER SET utf8 NOT NULL,
  `Datum` datetime NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`IdNavstevy`),
  KEY `IdPacienta` (`IdPacienta`),
  CONSTRAINT `dokumentace_navstevy_ibfk_1` FOREIGN KEY (`IdPacienta`) REFERENCES `dokumentace_pacienti` (`IdPacienta`)
) ENGINE=InnoDB AUTO_INCREMENT=49305 DEFAULT CHARSET=utf8mb4;
 
-- Export dat nebyl vybrán.
 
-- Exportování struktury pro tabulka elektronickadokumentace.dokumentace_pacienti
CREATE TABLE IF NOT EXISTS `dokumentace_pacienti` (
  `IdPacienta` varchar(20) CHARACTER SET utf8 NOT NULL,
  `Jmeno` varchar(50) NOT NULL,
  `Prijmeni` varchar(50) NOT NULL,
  `RodneCislo` varchar(50) NOT NULL,
  `IdAdresy` int(11) NOT NULL,
  `DatumNarozeni` datetime NOT NULL,
  PRIMARY KEY (`IdPacienta`),
  KEY `IdAdresy` (`IdAdresy`),
  CONSTRAINT `dokumentace_pacienti_ibfk_1` FOREIGN KEY (`IdAdresy`) REFERENCES `dokumentace_adresy` (`IdAdresy`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
 
-- Export dat nebyl vybrán.
 
-- Exportování struktury pro tabulka elektronickadokumentace.dokumentace_soubory
CREATE TABLE IF NOT EXISTS `dokumentace_soubory` (
  `IdSouboru` int(11) NOT NULL AUTO_INCREMENT,
  `IdNavstevy` int(11) NOT NULL,
  `Data` longblob NOT NULL,
  `TypObsahu` smallint(6) NOT NULL,
  `CasVlozeni` datetime NOT NULL DEFAULT current_timestamp(),
  `NazevSouboru` varchar(255) DEFAULT NULL,
  `TypSouboru` varchar(16) NOT NULL DEFAULT 'pdf',
  `Podepsano` bit(1) NOT NULL DEFAULT b'1',
  `IdRadek` int(11) NOT NULL DEFAULT 0,
  PRIMARY KEY (`IdSouboru`),
  KEY `IdNavstevy` (`IdNavstevy`),
  CONSTRAINT `dokumentace_soubory_ibfk_1` FOREIGN KEY (`IdNavstevy`) REFERENCES `dokumentace_navstevy` (`IdNavstevy`)
) ENGINE=InnoDB AUTO_INCREMENT=65368 DEFAULT CHARSET=utf8mb4;
 
-- Export dat nebyl vybrán.
 
-- Exportování struktury pro tabulka elektronickadokumentace.metadata
CREATE TABLE IF NOT EXISTS `metadata` (
  `Klic` varchar(50) NOT NULL,
  `Hodnota` varchar(50) NOT NULL,
  PRIMARY KEY (`Klic`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
 
-- Export dat nebyl vybrán.
 
/*!40101 SET SQL_MODE=IFNULL(@OLD_SQL_MODE, '') */;
/*!40014 SET FOREIGN_KEY_CHECKS=IFNULL(@OLD_FOREIGN_KEY_CHECKS, 1) */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40111 SET SQL_NOTES=IFNULL(@OLD_SQL_NOTES, 1) */;

Comment by Martin Rotter [ 2021-05-11 ]

Sadly it seems that only certain data trigger the bug, I will try to anonymize data and post here later.

Comment by Martin Rotter [ 2021-05-11 ]

Also, I did some testing with earlier mariadb version:
10.5.3 - WORKS OK
10.5.5 - WORKS OK
10.5.6 - WORKS OK
10.5.7 - WORKS BADLY
10.5.8 - NOT TESTED
10.5.9 - WORKS BADLY
10.5.10 - WORKS BADLY

So it seems that MariaDB 10.5.7 introduced the bug.

Comment by Alice Sherepa [ 2021-05-11 ]

The test case to demonstrate the problem would be highly appreciated. There is also the opportunity to upload it to our ftp in the private section: ftp://ftp.askmonty.org/private/

Generated at Thu Feb 08 09:39:08 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.