Bug #44465 Selecting from EVENTS_WAITS_CURRENT crashes server
Submitted: 24 Apr 2009 18:09 Modified: 30 Apr 2009 16:12
Reporter: Paul DuBois Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server: Performance Schema Severity:S3 (Non-critical)
Version:mysql-6.0-perf OS:Any
Assigned to: Marc ALFF CPU Architecture:Any

[24 Apr 2009 18:09] Paul DuBois
Description:
With the current mysql-6.0-perf tree, a simple query crashes the server:

SELECT * FROM EVENTS_WAITS_CURRENT;

Error log on Mac OS X:

Assertion failed: (f->real_type() == MYSQL_TYPE_LONGLONG), function read_row_values, file table_events_waits.cc, line 302.
090424 12:56:44 - mysqld got signal 6 ;
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=8384512
read_buffer_size=131072
max_used_connections=1
max_threads=151
thread_count=2
connection_count=1
It is possible that mysqld could use up to 
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 337766 K
bytes of memory
Hope that's ok; if not, decrease some variables in the equation.

thd: 0x0
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...

stack_bottom = 0x0 thread_stack 0x30c00
0   mysqld                              0x004ff2b4 my_print_stacktrace + 52^@
1   mysqld                              0x000f7927 handle_segfault + 839^@
2   libSystem.B.dylib                   0x94e182bb _sigtramp + 43^@
3   ???                                 0xffffffff 0x0 + 4294967295^@
4   mysqld                              0x0010213f main + 1571^@
5   mysqld                              0x00001f96 start + 54^@

Error log on Gentoo Linux:

mysqld: table_events_waits.cc:302: virtual int table_events_waits_common::read_row_values(TABLE*, unsigned char*, Field**, bool): Assertion `f->real_type() == MYSQL_TYPE_LONGLONG' failed.
090424 12:59:39 - mysqld got signal 6 ;
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=8384512
read_buffer_size=131072
max_used_connections=1
max_threads=151
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 = 337818 K
bytes of memory
Hope that's ok; if not, decrease some variables in the equation.

thd: 0x9fd7c70
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...
stack_bottom = 0xa576bf78 thread_stack 0x30c00
/var/mysql/60110/libexec/mysqld(my_print_stacktrace+0x2d) [0x8975c88]
/var/mysql/60110/libexec/mysqld(handle_segfault+0x2bd) [0x83672d8]
[0xffffe400]
/lib/libc.so.6(abort+0x188) [0xb7c26eb8]
/lib/libc.so.6(__assert_fail+0xee) [0xb7c1e6ee]
/var/mysql/60110/libexec/mysqld(table_events_waits_common::read_row_values(TABLE*, unsigned char*, Field**, bool)+0x6f2) [0x89f7e4a]
/var/mysql/60110/libexec/mysqld(pfs_table::read_row(TABLE*, unsigned char*, Field**)+0x62) [0x89f1d02]
/var/mysql/60110/libexec/mysqld(ha_perfschema::rnd_next(unsigned char*)+0xae) [0x89f0cea]
/var/mysql/60110/libexec/mysqld(rr_sequential(READ_RECORD*)+0x78) [0x84a2cce]
/var/mysql/60110/libexec/mysqld(join_init_read_record(st_join_table*)+0xb5) [0x83eb2e2]
/var/mysql/60110/libexec/mysqld(sub_select(JOIN*, st_join_table*, bool)+0x12c) [0x83ee985]
/var/mysql/60110/libexec/mysqld [0x83faeda]
/var/mysql/60110/libexec/mysqld(JOIN::exec()+0x20d3) [0x8411ea3]
/var/mysql/60110/libexec/mysqld(mysql_select(THD*, Item***, TABLE_LIST*, unsigned int, List<Item>&, Item*, unsigned int, st_order*, st_order*, Item*, st_order*, unsigned long long, select_result*, st_select_lex_unit*, st_select_lex*)+0x30f) [0x840cd30]
/var/mysql/60110/libexec/mysqld(handle_select(THD*, LEX*, select_result*, unsigned long)+0x1ec) [0x841219f]
/var/mysql/60110/libexec/mysqld [0x83788b6]
/var/mysql/60110/libexec/mysqld(mysql_execute_command(THD*)+0x944) [0x837a0df]
/var/mysql/60110/libexec/mysqld(mysql_parse(THD*, char const*, unsigned int, char const**)+0x22f) [0x83829d9]
/var/mysql/60110/libexec/mysqld(dispatch_command(enum_server_command, THD*, char*, unsigned int)+0x893) [0x83833fc]
/var/mysql/60110/libexec/mysqld(do_command(THD*)+0x244) [0x8384743]
/var/mysql/60110/libexec/mysqld(do_handle_one_connection(THD*)+0x10e) [0x8370a8f]
/var/mysql/60110/libexec/mysqld(handle_one_connection+0x44) [0x8370b6c]
/lib/libpthread.so.0 [0xb7eb1170]
/lib/libc.so.6(clone+0x5e) [0xb7cc9d4e]
Trying to get some variables.
Some pointers may be invalid and cause the dump to abort...
thd->query at 0xa02bf08 = select * FROM EVENTS_WAITS_CURRENT
thd->thread_id=3
thd->killed=NOT_KILLED
The manual page at http://dev.mysql.com/doc/mysql/en/crashing.html contains
information that should help you find out what is causing the crash.

How to repeat:
See above
[30 Apr 2009 16:12] Marc ALFF
The table schema for EVENTS_WAITS_CURRENT has changed to implement review comments, and in particular OBJECT_INSTANCE_BEGIN has changed to:
- OBJECT_INSTANCE_BEGIN BIGINT not null,

Using a recent build on an older database that was created with a varchar for OBJECT_INSTANCE_BEGIN caused the assert failure.

This is not a bug in the code: it's necessary to install a clean database for testing, as reusing databases from previous builds is not guaranteed to work.

No code change (no upgrade path is provided between intermediate versions at this development stage).