Bug #66560 Custom MySQL build crashes on --with-max-indexes beyond 120
Submitted: 28 Aug 2012 1:31 Modified: 28 Aug 2012 14:08
Reporter: Jaime Sicam Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server: Compiling Severity:S3 (Non-critical)
Version:5.1.65, 5.5.27 OS:Linux
Assigned to: CPU Architecture:Any

[28 Aug 2012 1:31] Jaime Sicam
Description:
For MySQL 5.5.27:
If you set  MAX_INDEXES between 121-128 in config.h.cmake, compile and install you get the following errors:

00:52:14 UTC - mysqld got signal 11 ;
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=131072
max_used_connections=0
max_threads=151
thread_count=1
connection_count=0
It is possible that mysqld could use up to 
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 338489 K  bytes of memory
Hope that's ok; if not, decrease some variables in the equation.

Thread pointer: 0x16691f0
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 = 7fa8fd504c28 thread_stack 0x40000
/home/mybuster/mysql-binaries/mysql-5.5.27/5.5.27/bin/mysqld(my_print_stacktrace+0x2e)[0x75c38e]
/home/mybuster/mysql-binaries/mysql-5.5.27/5.5.27/bin/mysqld(handle_fatal_signal+0x41a)[0x65261a]
/lib64/libpthread.so.0[0x3894e0f500]
/home/mybuster/mysql-binaries/mysql-5.5.27/5.5.27/bin/mysqld(my_hash_sort_bin+0x1d)[0x8bebcd]
/home/mybuster/mysql-binaries/mysql-5.5.27/5.5.27/bin/mysqld[0x745d4b]
/home/mybuster/mysql-binaries/mysql-5.5.27/5.5.27/bin/mysqld[0x745e02]
/home/mybuster/mysql-binaries/mysql-5.5.27/5.5.27/bin/mysqld(my_hash_first_from_hash_value+0x95)[0x746045]
/home/mybuster/mysql-binaries/mysql-5.5.27/5.5.27/bin/mysqld(my_hash_search+0xe)[0x74614e]
/home/mybuster/mysql-binaries/mysql-5.5.27/5.5.27/bin/mysqld(_Z22get_cached_table_sharePKcS0_+0x38)[0x52fb88]
/home/mybuster/mysql-binaries/mysql-5.5.27/5.5.27/bin/mysqld(_Z21check_if_table_existsP3THDP10TABLE_LISTPb+0xa6)[0x537606]
/home/mybuster/mysql-binaries/mysql-5.5.27/5.5.27/bin/mysqld(_Z10open_tableP3THDP10TABLE_LISTP11st_mem_rootP18Open_table_context+0x8a9)[0x538c09]
/home/mybuster/mysql-binaries/mysql-5.5.27/5.5.27/bin/mysqld(_Z11open_tablesP3THDPP10TABLE_LISTPjjP19Prelocking_strategy+0x3af)[0x53995f]
/home/mybuster/mysql-binaries/mysql-5.5.27/5.5.27/bin/mysqld(_Z30open_normal_and_derived_tablesP3THDP10TABLE_LISTj+0x44)[0x53a234]
/home/mybuster/mysql-binaries/mysql-5.5.27/5.5.27/bin/mysqld(_ZN18Prepared_statement7prepareEPKcj+0xfa1)[0x577f71]
/home/mybuster/mysql-binaries/mysql-5.5.27/5.5.27/bin/mysqld(_Z22mysql_sql_stmt_prepareP3THD+0x2b3)[0x57a2c3]
/home/mybuster/mysql-binaries/mysql-5.5.27/5.5.27/bin/mysqld(_Z21mysql_execute_commandP3THD+0x1eb0)[0x5696b0]
/home/mybuster/mysql-binaries/mysql-5.5.27/5.5.27/bin/mysqld(_Z11mysql_parseP3THDPcjP12Parser_state+0x189)[0x56bcb9]
/home/mybuster/mysql-binaries/mysql-5.5.27/5.5.27/bin/mysqld[0x56c0d4]
/home/mybuster/mysql-binaries/mysql-5.5.27/5.5.27/bin/mysqld(_Z19do_handle_bootstrapP3THD+0x164)[0x56c394]
/home/mybuster/mysql-binaries/mysql-5.5.27/5.5.27/bin/mysqld(handle_bootstrap+0x4a)[0x56c3fa]
/lib64/libpthread.so.0[0x3894e07851]
/lib64/libc.so.6(clone+0x6d)[0x3894ae76dd]

Trying to get some variables.
Some pointers may be invalid and cause the dump to abort.
Query (7fa8f0019570): CREATE TABLE performance_schema.cond_instances(NAME VARCHAR(128) not null,OBJECT_INSTANCE_BEGIN BIGINT not null)ENGINE=PERFORMANCE_SCHEMA
Connection ID (thread ID): 1
Status: NOT_KILLED

0x75c38e my_print_stacktrace + 46
0x65261a handle_fatal_signal + 1050
0x3894e0f500 _end + -1813264552
0x8bebcd my_hash_sort_bin + 29
0x745d4b calc_hash + 43
0x745e02 my_hash_rec_mask + 66
0x746045 my_hash_first_from_hash_value + 149
0x74614e my_hash_search + 14
0x52fb88 get_cached_table_share(char const*, char const*) + 56
0x537606 check_if_table_exists(THD*, TABLE_LIST*, bool*) + 166
0x538c09 open_table(THD*, TABLE_LIST*, st_mem_root*, Open_table_context*) + 2217
0x53995f open_tables(THD*, TABLE_LIST**, unsigned int*, unsigned int, Prelocking_strategy*) + 943
0x53a234 open_normal_and_derived_tables(THD*, TABLE_LIST*, unsigned int) + 68
0x577f71 Prepared_statement::prepare(char const*, unsigned int) + 4001
0x57a2c3 mysql_sql_stmt_prepare(THD*) + 691
0x5696b0 mysql_execute_command(THD*) + 7856
0x56bcb9 mysql_parse(THD*, char*, unsigned int, Parser_state*) + 393
0x56c0d4 handle_bootstrap_impl(THD*) + 1012
0x56c394 do_handle_bootstrap(THD*) + 356
0x56c3fa handle_bootstrap + 74
0x3894e07851 _end + -1813296471
0x3894ae76dd _end + -1816573643

How to repeat:
On MySQL 5.1.25:
Run configure with these options:
./configure --with-max-indexes=121
Try compiling and running MySQL and it will crash

On MySQL 5.5.27:
Edit config.h.cmake and change "#define MAX_INDEXES 64" to "#define MAX_INDEXES 121"
Try compiling and running MySQL and it will crash
[28 Aug 2012 9:24] Valeriy Kravchuk
I've built 5.1.66 with this configure option:

./configure --with-max-indexes=121

Now, what exactly should I run/execute to prove the crash?
[28 Aug 2012 11:15] Jaime Sicam
Hi Valeriy,
  Thanks for reviewing the bug. I used MySQL Sandbox for testing.  After compiling, I just run:  "make_sandbox_from_source . single"   It will try to start MySQL but crash in the middle of things.
[28 Aug 2012 12:38] Alexey Kopytov
This is most likely a duplicate of http://bugs.mysql.com/bug.php?id=54127
[28 Aug 2012 14:08] Valeriy Kravchuk
I can not repeat crash at server startup with 5.1.66 on Mac OS X... Anyway, let's consider this a duplicate of bug #54127.