SIGSEGV with disabled Innodb engine

Bug #1483965 reported by Arty
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MySQL Data Dumper
New
Undecided
Unassigned

Bug Description

Hi all.

Today I met the bug in mydumper version 0.6.2, that leads to application coredump upon startup.
Here is a backtrace of the fatal:
Core was generated by `mydumper --outputdir=/backup_remote/mysql/150812 --compress --build-empty-files'.
Program terminated with signal 11, Segmentation fault.
#0 0x00007ff8e4f1f607 in ____strtoull_l_internal () from /lib64/libc.so.6
Missing separate debuginfos, use: debuginfo-install glib2-2.40.0-4.el7.x86_64 glibc-2.17-78.0.1.el7.x86_64 keyutils-libs-1.5.8-3.el7.x86_64 krb5-libs-1.12.2-14.el7.x86_64 libcom_err-1.42.9-7.el7.x86_64 libgcc-4.8.3-9.el7.x86_64 libselinux-2.2.2-6.el7.x86_64 libstdc++-4.8.3-9.el7.x86_64 openssl-libs-1.0.1e-42.el7_1.9.x86_64 pcre-8.32-14.el7.x86_64 xz-libs-5.1.2-9alpha.el7.x86_64 zlib-1.2.7-13.el7.x86_64
(gdb) bt
#0 0x00007ff8e4f1f607 in ____strtoull_l_internal () from /lib64/libc.so.6
#1 0x000000000040586b in dump_database (conn=<optimized out>, database=0x24b1a70 "mysql") at /usr/src/debug/mydumper-0.6.2/mydumper.c:1554
#2 0x00000000004075db in start_dump (conn=0x2494470) at /usr/src/debug/mydumper-0.6.2/mydumper.c:1160
#3 0x00000000004043f2 in main (argc=1, argv=0x7ffdda67bc68) at /usr/src/debug/mydumper-0.6.2/mydumper.c:777

After some investigation I found that the bug is related to missing Innodb engine plugin, that we have forcibly disabled with 'innodb = OFF' my.cnf option (we use exclusively TokuDB and no need for InnoDB in this configuration).

The bug in dump_database() is hit when we traverse 'show table status output' and when we meet the following line ' innodb_index_stats | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | Unknown storage engine 'InnoDB' |',

In this case, obviously call to g_ascii_strtoull(NULL, NULL, 10) in /usr/src/debug/mydumper-0.6.2/mydumper.c:1554

dbt->datalength = g_ascii_strtoull(row[6], NULL, 10);

makes the SIGSEGV.

So my suggestion is to check Engine or Rows for NULL values before proceeding.

Here is our 'show engine status' output example.
mysql> show table status;
+---------------------------+--------+---------+------------+------+----------------+-------------+--------------------+--------------+-----------+----------------+---------------------+---------------------+---------------------+-------------------+----------+----------------+-----------------------------------------+
| Name | Engine | Version | Row_format | Rows | Avg_row_length | Data_length | Max_data_length | Index_length | Data_free | Auto_increment | Create_time | Update_time | Check_time | Collation | Checksum | Create_options | Comment |
+---------------------------+--------+---------+------------+------+----------------+-------------+--------------------+--------------+-----------+----------------+---------------------+---------------------+---------------------+-------------------+----------+----------------+-----------------------------------------+
| columns_priv | MyISAM | 10 | Fixed | 0 | 0 | 0 | 227994731135631359 | 4096 | 0 | NULL | 2015-07-17 15:25:34 | 2015-07-17 15:25:34 | NULL | utf8_bin | NULL | | Column privileges |
| db | MyISAM | 10 | Fixed | 6 | 440 | 2640 | 123848989752688639 | 5120 | 0 | NULL | 2015-07-17 15:25:34 | 2015-08-11 18:59:41 | 2015-07-17 15:25:34 | utf8_bin | NULL | | Database privileges |
| event | MyISAM | 10 | Dynamic | 0 | 0 | 0 | 281474976710655 | 2048 | 0 | NULL | 2015-07-17 15:25:34 | 2015-07-17 15:25:34 | NULL | utf8_general_ci | NULL | | Events |
| func | MyISAM | 10 | Fixed | 0 | 0 | 0 | 162974011515469823 | 1024 | 0 | NULL | 2015-07-17 15:25:34 | 2015-07-17 15:25:34 | NULL | utf8_bin | NULL | | User defined functions |
| general_log | CSV | 10 | Dynamic | 2 | 0 | 0 | 0 | 0 | 0 | NULL | NULL | NULL | NULL | utf8_general_ci | NULL | | General log |
| help_category | MyISAM | 10 | Dynamic | 40 | 28 | 1120 | 281474976710655 | 3072 | 0 | NULL | 2015-07-17 15:25:34 | 2015-07-17 15:25:36 | NULL | utf8_general_ci | NULL | | help categories |
| help_keyword | MyISAM | 10 | Fixed | 485 | 197 | 95545 | 55450570411999231 | 17408 | 0 | NULL | 2015-07-17 15:25:34 | 2015-07-17 15:25:36 | NULL | utf8_general_ci | NULL | | help keywords |
| help_relation | MyISAM | 10 | Fixed | 1090 | 9 | 9810 | 2533274790395903 | 20480 | 0 | NULL | 2015-07-17 15:25:34 | 2015-07-17 15:25:36 | NULL | utf8_general_ci | NULL | | keyword-topic relation |
| help_topic | MyISAM | 10 | Dynamic | 533 | 957 | 510552 | 281474976710655 | 21504 | 0 | NULL | 2015-07-17 15:25:34 | 2015-07-17 15:25:36 | NULL | utf8_general_ci | NULL | | help topics |
| innodb_index_stats | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | Unknown storage engine 'InnoDB' |
| innodb_table_stats | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | Unknown storage engine 'InnoDB' |
| ndb_binlog_index | MyISAM | 10 | Dynamic | 0 | 0 | 0 | 281474976710655 | 1024 | 0 | NULL | 2015-07-17 15:25:34 | 2015-07-17 15:25:34 | NULL | latin1_swedish_ci | NULL | | |
| plugin | MyISAM | 10 | Dynamic | 7 | 34 | 244 | 281474976710655 | 2048 | 0 | NULL | 2015-07-17 15:25:34 | 2015-07-17 16:07:56 | NULL | utf8_general_ci | NULL | | MySQL plugins |
| proc | MyISAM | 10 | Dynamic | 0 | 0 | 0 | 281474976710655 | 2048 | 0 | NULL | 2015-07-17 15:25:34 | 2015-07-17 15:25:34 | NULL | utf8_general_ci | NULL | | Stored Procedures |
| procs_priv | MyISAM | 10 | Fixed | 0 | 0 | 0 | 239253730204057599 | 4096 | 0 | NULL | 2015-07-17 15:25:34 | 2015-07-17 15:25:34 | NULL | utf8_bin | NULL | | Procedure privileges |
| proxies_priv | MyISAM | 10 | Fixed | 2 | 693 | 1386 | 195062158860484607 | 5120 | 0 | NULL | 2015-07-17 15:25:34 | 2015-07-17 15:25:34 | 2015-07-17 15:25:34 | utf8_bin | NULL | | User proxy privileges |
| servers | MyISAM | 10 | Fixed | 0 | 0 | 0 | 433752939111120895 | 1024 | 0 | NULL | 2015-07-17 15:25:34 | 2015-07-17 15:25:34 | NULL | utf8_general_ci | NULL | | MySQL Foreign Servers table |
| slave_master_info | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | Unknown storage engine 'InnoDB' |
| slave_relay_log_info | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | Unknown storage engine 'InnoDB' |
| slave_worker_info | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | Unknown storage engine 'InnoDB' |
| slow_log | CSV | 10 | Dynamic | 2 | 0 | 0 | 0 | 0 | 0 | NULL | NULL | NULL | NULL | utf8_general_ci | NULL | | Slow log |
| tables_priv | MyISAM | 10 | Fixed | 0 | 0 | 0 | 239535205180768255 | 4096 | 0 | NULL | 2015-07-17 15:25:34 | 2015-07-17 15:25:34 | NULL | utf8_bin | NULL | | Table privileges |
| time_zone | MyISAM | 10 | Fixed | 0 | 0 | 0 | 1970324836974591 | 1024 | 0 | 1 | 2015-07-17 15:25:34 | 2015-07-17 15:25:34 | NULL | utf8_general_ci | NULL | | Time zones |
| time_zone_leap_second | MyISAM | 10 | Fixed | 0 | 0 | 0 | 3659174697238527 | 1024 | 0 | NULL | 2015-07-17 15:25:34 | 2015-07-17 15:25:34 | NULL | utf8_general_ci | NULL | | Leap seconds information for time zones |
| time_zone_name | MyISAM | 10 | Fixed | 0 | 0 | 0 | 55450570411999231 | 1024 | 0 | NULL | 2015-07-17 15:25:34 | 2015-07-17 15:25:34 | NULL | utf8_general_ci | NULL | | Time zone names |
| time_zone_transition | MyISAM | 10 | Fixed | 0 | 0 | 0 | 4785074604081151 | 1024 | 0 | NULL | 2015-07-17 15:25:34 | 2015-07-17 15:25:34 | NULL | utf8_general_ci | NULL | | Time zone transitions |
| time_zone_transition_type | MyISAM | 10 | Fixed | 0 | 0 | 0 | 10696049115004927 | 1024 | 0 | NULL | 2015-07-17 15:25:34 | 2015-07-17 15:25:34 | NULL | utf8_general_ci | NULL | | Time zone transition types |
| user | MyISAM | 10 | Dynamic | 11 | 96 | 1056 | 281474976710655 | 2048 | 0 | NULL | 2015-07-17 15:25:34 | 2015-08-11 18:59:41 | NULL | utf8_bin | NULL | | Users and global privileges |
+---------------------------+--------+---------+------------+------+----------------+-------------+--------------------+--------------+-----------+----------------+---------------------+---------------------+---------------------+-------------------+----------+----------------+-----------------------------------------+

Revision history for this message
Arty (nopius) wrote :

Sorry for duplicate, just checked the fixed bug list and found exactly the same report.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.