mysql_upgrade from MySQL 5.0 crashes in DBUG_ASSERT

Bug #709964 reported by Vladislav Vaintroub
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MariaDB
New
Undecided
Unassigned

Bug Description

Trying to run mysql_upgrade from MySQL 5.0 to Mariadb 5.2 crashes
in DBUG_ASSERT()

Version: '5.2.5-MariaDB-debug' socket: '' port: 0 Source distribution
Assertion failed: next_chunk <= buff_end, file ..\..\sql\table.cc, line 998
110130 0:58:06 [ERROR] mysqld got exception 0x80000003 ;
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=0
read_buffer_size=65536
max_used_connections=1
max_threads=102
threads_connected=1
It is possible that mysqld could use up to
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 33426 K
bytes of memory
Hope that's ok; if not, decrease some variables in the equation.

thd: 0x16850f38
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...
002CB9A3 mysqld.exe!my_sigabrt_handler()[mysqld.cc:2203]
00298DA9 mysqld.exe!raise()[winsig.c:586]
0029D4D6 mysqld.exe!abort()[abort.c:74]
008A6847 mysqld.exe!_wassert()[assert.c:336]
0044A45E mysqld.exe!open_binary_frm()[table.cc:998]
00449579 mysqld.exe!open_table_def()[table.cc:651]
003ABBF2 mysqld.exe!get_table_share()[sql_base.cc:383]
003B4166 mysqld.exe!get_table_share_with_create()[sql_base.cc:462]
003B39EE mysqld.exe!open_unireg_entry()[sql_base.cc:3913]
003B1697 mysqld.exe!open_table()[sql_base.cc:2954]
003B4DD8 mysqld.exe!open_tables()[sql_base.cc:4676]
003B5F54 mysqld.exe!open_and_lock_tables_derived()[sql_base.cc:5094]
003037A2 mysqld.exe!simple_open_n_lock_tables()[mysql_priv.h:1564]
003B59A2 mysqld.exe!open_n_lock_single_table()[sql_base.cc:4972]
00400C8E mysqld.exe!mysql_alter_table()[sql_table.cc:6772]
004322BC mysqld.exe!mysql_execute_command()[sql_parse.cc:2963]
0043AEE2 mysqld.exe!mysql_parse()[sql_parse.cc:6128]
0042EA2A mysqld.exe!dispatch_command()[sql_parse.cc:1209]
0042E274 mysqld.exe!do_command()[sql_parse.cc:903]
0032C41B mysqld.exe!handle_one_connection()[sql_connect.cc:1154]
008D925D mysqld.exe!pthread_start()[my_winthread.c:87]
008AAD23 mysqld.exe!_callthreadstart()[thread.c:259]
008AACB9 mysqld.exe!_threadstart()[thread.c:243]
75A63677 kernel32.dll!BaseThreadInitThunk()
77AC9D42 ntdll.dll!RtlInitializeExceptionChain()
77AC9D15 ntdll.dll!RtlInitializeExceptionChain()
Trying to get some variables.
Some pointers may be invalid and cause the dump to abort...
thd->query at 16869E20=ALTER TABLE procs_priv
   ENGINE=MyISAM,
   CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin
thd->thread_id=4
thd->killed=NOT_KILLED

Subsequent attempt to start fails with the same assertion but in different code path:

thd: 0x1e28b000
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...
00CAB9A3 mysqld.exe!my_sigabrt_handler()[mysqld.cc:2203]
00C78DA9 mysqld.exe!raise()[winsig.c:586]
00C7D4D6 mysqld.exe!abort()[abort.c:74]
01286847 mysqld.exe!_wassert()[assert.c:336]
00E2A45E mysqld.exe!open_binary_frm()[table.cc:998]
00E29579 mysqld.exe!open_table_def()[table.cc:651]
00D8BBF2 mysqld.exe!get_table_share()[sql_base.cc:383]
00D94166 mysqld.exe!get_table_share_with_create()[sql_base.cc:462]
00D939EE mysqld.exe!open_unireg_entry()[sql_base.cc:3913]
00D91697 mysqld.exe!open_table()[sql_base.cc:2954]
00D9F13D mysqld.exe!open_system_tables_for_read()[sql_base.cc:9186]
00DCCFF5 mysqld.exe!my_tz_init()[tztime.cc:1645]
00CAC869 mysqld.exe!win_main()[mysqld.cc:4695]
00CAF841 mysqld.exe!mysql_service()[mysqld.cc:4847]
0128AD23 mysqld.exe!_callthreadstart()[thread.c:259]
0128ACB9 mysqld.exe!_threadstart()[thread.c:243]
75A63677 kernel32.dll!BaseThreadInitThunk()
77AC9D42 ntdll.dll!RtlInitializeExceptionChain()
77AC9D15 ntdll.dll!RtlInitializeExceptionChain()

Revision history for this message
Vladislav Vaintroub (wlad-montyprogram) wrote :

Assertion seems to come from this code in table.cc

   if (share->mysql_version >= 50110)
    {
      /* New auto_partitioned indicator introduced in 5.1.11 */
#ifdef WITH_PARTITION_STORAGE_ENGINE
      share->auto_partitioned= *next_chunk;
#endif
      next_chunk++;
      DBUG_ASSERT(next_chunk <= buff_end); <-- HERE
    }

Revision history for this message
Vladislav Vaintroub (wlad-montyprogram) wrote :

The output of mysql_upgraqde prior to crash was

Phase 1/3: Fixing table and database names
Phase 2/3: Checking and upgrading tables
Processing databases
information_schema
mysql
mysql.columns_priv OK
mysql.db OK
mysql.func OK
mysql.help_category Needs upgrade
mysql.help_keyword Needs upgrade
mysql.help_relation OK
mysql.help_topic Needs upgrade
mysql.host OK
mysql.proc Needs upgrade
mysql.procs_priv Needs upgrade
mysql.tables_priv OK
mysql.time_zone OK
mysql.time_zone_leap_second OK
mysql.time_zone_name Needs upgrade
mysql.time_zone_transition OK
mysql.time_zone_transition_type OK
mysql.user OK
test

Repairing tables
mysql.help_category OK
mysql.help_keyword OK
mysql.help_topic OK
mysql.proc OK
mysql.procs_priv OK
mysql.time_zone_name OK
Phase 3/3: Running 'mysql_fix_privilege_tables'...
ERROR 2013 (HY000) at line 436: Lost connection to MySQL server during query

Revision history for this message
Sergei Golubchik (sergii) wrote : Re: [Bug 709964] Re: mysql_upgrade from MySQL 5.0 crashes in DBUG_ASSERT

Hi, Vladislav!

could you attach the table in question?
Or is it enough to download MySQL 5.0, install it,
then install MariaDB 5.2 and run mysql_upgrade ?

Regards,
Sergei

Revision history for this message
Vladislav Vaintroub (wlad-montyprogram) wrote :

Hi Sergei,
this was an empty 5.0.91 with only system tables, installed with Windows installer.

Only debug version of MariaDB 5.2 crashed, release started ok, though table is likely not completely in order.
I think there must be something wrong in mysqlcheck autorepair, because crashed tables procs_priv was first "autorepaired" as part of upgrade.

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.