| Bug #40935 | Crash upon server restart after installation of plugins | ||
|---|---|---|---|
| Submitted: | 21 Nov 2008 18:06 | Modified: | 14 Apr 2009 22:44 |
| Reporter: | Paul DuBois | Email Updates: | |
| Status: | Duplicate | Impact on me: | |
| Category: | MySQL Server | Severity: | S2 (Serious) |
| Version: | 6.0 bzr | OS: | Any |
| Assigned to: | Assigned Account | CPU Architecture: | Any |
| Tags: | Contribution | ||
[21 Nov 2008 18:06]
Paul DuBois
[24 Nov 2008 3:48]
Zhenxing He
This is not specific to semi-synchronous, you'll get a crash with any
plugins, I think the problem is in plugin_load, where the 'tmp_root' is
freed before calling close_thread_tables, so the memory allocated for
the MDL locks are freed and caused the crash.
I think the following patch can fix this.
=== modified file 'sql/sql_plugin.cc'
*** sql/sql_plugin.cc 2008-11-06 18:39:27 +0000
--- sql/sql_plugin.cc 2008-11-23 05:54:59 +0000
***************
*** 1384,1390 ****
if (plugin_add(tmp_root, &name, &dl, argc, argv, REPORT_TO_LOG))
sql_print_warning("Couldn't load plugin named '%s' with soname '%s'.",
str_name.c_ptr(), str_dl.c_ptr());
- free_root(tmp_root, MYF(MY_MARK_BLOCKS_FREE));
}
pthread_mutex_unlock(&LOCK_plugin);
if (error > 0)
--- 1384,1389 ----
***************
*** 1393,1398 ****
--- 1392,1398 ----
new_thd->version--; // Force close to free memory
end:
close_thread_tables(new_thd);
+ free_root(tmp_root, MYF(MY_MARK_BLOCKS_FREE));
/* Remember that we don't have a THD */
my_pthread_setspecific_ptr(THR_THD, 0);
DBUG_VOID_RETURN;
[4 Apr 2009 20:04]
Sveta Smirnova
Thank you for the report. Verified mostly as described. Backtrace in my env: stack_bottom = 0xbfd290cc thread_stack 0x20000 ./libexec/mysqld(my_print_stacktrace+0x32) [0x88294ae] ./libexec/mysqld(handle_segfault+0x2de) [0x82bfcd8] [0x2ce420] ./libexec/mysqld(MDL_context::remove_all_requests()+0x43) [0x84dab4d] ./libexec/mysqld(close_thread_tables(THD*, bool)+0x37e) [0x8321460] ./libexec/mysqld [0x84c8002] ./libexec/mysqld(plugin_init(int*, char**, int)+0x64f) [0x84c8691] ./libexec/mysqld [0x82c3f5e] ./libexec/mysqld(main+0x1f3) [0x82c824b] /lib/libc.so.6(__libc_start_main+0xdf) [0x301d7f] I installed rpl_semi_sync_master
[14 Apr 2009 22:44]
Davi Arnaut
This is a duplicate of Bug#44137
[14 Apr 2009 22:53]
Davi Arnaut
This bug was reported earlier then Bug#44137 and even before transactional DDL locking was pushed to the main tree. But since the latter is already pushed, this one has been closed as a duplicate.
