Bug #67287 Server crashes on INSERT into an InnoDB table
Submitted: 18 Oct 2012 13:42 Modified: 19 Oct 2012 10:44
Reporter: Dario Kampkaspar Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server: General Severity:S2 (Serious)
Version:5.6.7 OS:Windows (Server 2003 (SP2))
Assigned to: CPU Architecture:Any

[18 Oct 2012 13:42] Dario Kampkaspar
Description:
On a freshly installed 5.6.7, I create a database "katalog" and several tables in it. All are InnoDB and several have a fulltext index. On any insert (I tested PHP and via command line mysql client) into one of these tables (both tables with and without FT index), MySQL crashes.
The data entered are recovered completely after a restart, including the correct entry in the FT index.

I tested for RAM and HDD errors but could find none. I let Windows Update run and restarted after all updates were installed, then removed and re-installed MySQL. I did not change the automatically generated my.ini except for the data dir (which has no influence, I tested it without changing it).
Due to bug 67179, I use the workaround of running mysql_upgrade.
After that, I create the database, then only one (no matter which one) of the tables. MySQL crashes right on the first insert.

Mysqld-debug (which btw is not included in the installer!) gives me:

13:11:02 UTC - 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.
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.

key_buffer_size=8388608
read_buffer_size=16384
max_used_connections=1
max_threads=100
thread_count=1
connection_count=1
It is possible that mysqld could use up to 
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 35006 K  bytes of memory
Hope that's ok; if not, decrease some variables in the equation.

Thread pointer: 0x75943d0
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...
7c96cd12    ntdll.dll!RtlIpv4StringToAddressExW()
7c95d0f7    ntdll.dll!RtlLockHeap()
836163    mysqld-debug.exe!pthread_cond_signal()
83613f    mysqld-debug.exe!pthread_cond_signal()
7c198e    mysqld-debug.exe!??$_Fill_n@PAPAPAUst_join_table@@IPAPAU1@@std@@YAXPAPAPAUst_join_table@@IABQAPAU1@U_Range_checked_iterator_tag@0@@Z()
7c87b9    mysqld-debug.exe!??$_Fill_n@PAPAPAUst_join_table@@IPAPAU1@@std@@YAXPAPAPAUst_join_table@@IABQAPAU1@U_Range_checked_iterator_tag@0@@Z()
7c1899    mysqld-debug.exe!??$_Fill_n@PAPAPAUst_join_table@@IPAPAU1@@std@@YAXPAPAPAUst_join_table@@IABQAPAU1@U_Range_checked_iterator_tag@0@@Z()
7c2283    mysqld-debug.exe!??$_Fill_n@PAPAPAUst_join_table@@IPAPAU1@@std@@YAXPAPAPAUst_join_table@@IABQAPAU1@U_Range_checked_iterator_tag@0@@Z()
7c11c8    mysqld-debug.exe!??$_Fill_n@PAPAPAUst_join_table@@IPAPAU1@@std@@YAXPAPAPAUst_join_table@@IABQAPAU1@U_Range_checked_iterator_tag@0@@Z()
42eea1    mysqld-debug.exe!?ha_commit_trans@@YAHPAVTHD@@_N@Z()
5d7b68    mysqld-debug.exe!?trans_commit_stmt@@YA_NPAVTHD@@@Z()
568cc3    mysqld-debug.exe!?mysql_execute_command@@YAHPAVTHD@@@Z()
56be06    mysqld-debug.exe!?mysql_parse@@YAXPAVTHD@@PADIPAVParser_state@@@Z()
561340    mysqld-debug.exe!?dispatch_command@@YA_NW4enum_server_command@@PAVTHD@@PADI@Z()
560a37    mysqld-debug.exe!?do_command@@YA_NPAVTHD@@@Z()
4873a1    mysqld-debug.exe!?do_handle_one_connection@@YAXPAVTHD@@@Z()
486edc    mysqld-debug.exe!handle_one_connection()
c065f5    mysqld-debug.exe!?SetKey@?$BlockCipher@$00VAES@TaoCrypt@@$0A@@TaoCrypt@@QAEXPBEI@Z()
838058    mysqld-debug.exe!pthread_create()
d04023    mysqld-debug.exe!my_strnncoll_gbk()
d03fc4    mysqld-debug.exe!my_strnncoll_gbk()
7c82482f    kernel32.dll!GetModuleHandleA()

Trying to get some variables.
Some pointers may be invalid and cause the dump to abort.
Query (784d540): INSERT INTO `katalog`.`slw` (`003`, `004`, `007`, `7W0`, `7W1`, `7W2`, `7Wo`, `7Wc`, `7Wz`, `z`) VALUES (NULL, '0000-00-00 00:00:00', CURRENT_TIMESTAMP, 'tes2', NULL, NULL, NULL, '', NULL, '0')Connection ID (thread ID): 5
Status: NOT_KILLED

--
One of the tables which I also used for the test with only one table:

CREATE TABLE IF NOT EXISTS `slw` (
  `003` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT 'ID',
  `004` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' COMMENT 'Erstellungsdatum',
  `007` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'Änderung',
  `7W0` varchar(250) CHARACTER SET utf8 COLLATE utf8_german2_ci NOT NULL COMMENT 'Schlagwort / Norm FT',
  `7W1` varchar(250) CHARACTER SET utf8 COLLATE utf8_german2_ci DEFAULT NULL COMMENT 'Schlagwort / lokal FT',
  `7W2` text COLLATE utf8_unicode_ci COMMENT 'Beschreibung / Definition',
  `7Wo` bigint(20) unsigned DEFAULT NULL COMMENT 'Oberbegriff',
  `7Wc` varchar(1) COLLATE utf8_unicode_ci NOT NULL COMMENT 'Schlagwortart',
  `7Wz` text COLLATE utf8_unicode_ci COMMENT 'allgem. Bemerkungen',
  `z` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`003`),
  KEY `7Wo` (`7Wo`),
  FULLTEXT KEY `idx` (`7W0`,`7W1`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Schlagwort-Stammsätze' AUTO_INCREMENT=1 ;

--

I tested the same thing on a different machine running Win 2008 R2. There, the crash doesn't happen and over 100k INSERTs.

How to repeat:
INSERT anything.
[18 Oct 2012 14:34] MySQL Verification Team
Thank you for the bug report. I can't repeat, please provide your my.ini file. Thanks.

d:\tmp\mysql-5.6.7-rc-winx64\bin>mysql -uroot
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.6.7-rc-debug MySQL Community Server - Debug (GPL)

Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> create database katalog;
Query OK, 1 row affected (0.00 sec)

mysql> use katalog
Database changed
mysql> CREATE TABLE IF NOT EXISTS `slw` (
    ->   `003` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT 'ID',
    ->   `004` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' COMMENT 'Erstellungsdatum',
    ->   `007` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'Ã"nderung',
    ->   `7W0` varchar(250) CHARACTER SET utf8 COLLATE utf8_german2_ci NOT NULL COMMENT 'Schlagwort / Norm FT',
    ->   `7W1` varchar(250) CHARACTER SET utf8 COLLATE utf8_german2_ci DEFAULT NULL COMMENT 'Schlagwort / lokal FT',
    ->   `7W2` text COLLATE utf8_unicode_ci COMMENT 'Beschreibung / Definition',
    ->   `7Wo` bigint(20) unsigned DEFAULT NULL COMMENT 'Oberbegriff',
    ->   `7Wc` varchar(1) COLLATE utf8_unicode_ci NOT NULL COMMENT 'Schlagwortart',
    ->   `7Wz` text COLLATE utf8_unicode_ci COMMENT 'allgem. Bemerkungen',
    ->   `z` tinyint(1) NOT NULL DEFAULT '0',
    ->   PRIMARY KEY (`003`),
    ->   KEY `7Wo` (`7Wo`),
    ->   FULLTEXT KEY `idx` (`7W0`,`7W1`)
    -> ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Schlagwort-Stammsätze' AUTO_INCREMENT=1 ;
Query OK, 0 rows affected (0.30 sec)

mysql> INSERT INTO `katalog`.`slw` (`003`, `004`, `007`, `7W0`, `7W1`, `7W2`, `7Wo`, `7Wc`, `7Wz`, `z`) VALUES (NULL, '0000-00-00 00:00:00', CURRENT_TIMEST
AMP, 'tes2', NULL, NULL, NULL, '', NULL, '0');
Query OK, 1 row affected (0.02 sec)

mysql> show variables like "%version%";
+-------------------------+--------------------------------------+
| Variable_name           | Value                                |
+-------------------------+--------------------------------------+
| innodb_version          | 1.2.7                                |
| protocol_version        | 10                                   |
| slave_type_conversions  |                                      |
| version                 | 5.6.7-rc-debug                       |
| version_comment         | MySQL Community Server - Debug (GPL) |
| version_compile_machine | x86_64                               |
| version_compile_os      | Win64                                |
+-------------------------+--------------------------------------+
7 rows in set (0.01 sec)

mysql>
[18 Oct 2012 15:06] Dario Kampkaspar
Thank you for the quick reply! I am puzzled myself, as the same settings and DB work on my development machine.

Here is my my.ini (only comments removed):

[client]
no-beep
port=3306

[mysql]
default-character-set=utf8

[mysqld]
port=3306
basedir="C:\Programme\MySQL\MySQL Server 5.6\"
datadir="D:\mySQL-Data\data\"
character-set-server=utf8
default-storage-engine=INNODB
sql-mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"

log-output=FILE
general-log=0
general_log_file="SERVER.log"
slow-query-log=1
slow_query_log_file="SERVER-slow.log"
long_query_time=5
log-bin="SERVER-bin"
log-error="SERVER.err"
max_connections=100
query_cache_size=0
table_open_cache=256
tmp_table_size=6M
thread_cache_size=8

myisam_max_sort_file_size=100G
myisam_sort_buffer_size=8M
key_buffer_size=8M
read_buffer_size=17K
read_rnd_buffer_size=256K
sort_buffer_size=243K

innodb_additional_mem_pool_size=2M
innodb_flush_log_at_trx_commit=1
innodb_log_buffer_size=1M
innodb_buffer_pool_size=14M
innodb_log_file_size=10M
innodb_thread_concurrency=8

binlog-do-db=katalog

---

If there is anything else you need, please let me know.
[18 Oct 2012 16:41] MySQL Verification Team
Thank you for the feedback. I can't repeat, I did my test with a complete fresh data stuff (shipped with the package). Please test in this way. Thanks.
[18 Oct 2012 22:36] MySQL Verification Team
iirc win2003 and xp will have a problem with this when log-bin is enabled.
there's an internal bug for it, which may even be fixed in the current source.
[19 Oct 2012 10:05] Dario Kampkaspar
Shane: You were right! After disabling binlog, everything works smoothly :)

This bug should be marked as a duplicate of it, then.

Thanks all for your support!
[19 Oct 2012 10:44] MySQL Verification Team
Duplicate of internal bugs:

Bug 14640486 - MISSING INITIALIZATION OF MYSQL_BIN_LOG::M_PREP_XIDS_COND
Bug 14126548 - CANNOT ENABLE BINARY LOGGING ON XP OR WIN2003, CRASHES IN DEC_PREP_XIDS

Fix will be available in 5.6.8.