Bug #28756 Server crashes if a plugin cannot be installed
Submitted: 29 May 2007 17:20 Modified: 16 Mar 2009 12:47
Reporter: Joerg Bruehe Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server Severity:S1 (Critical)
Version:5.1 + 6.0 OS:Mac OS X (64 bit only)
Assigned to: Daniel Fischer CPU Architecture:Any
Triage: Triaged: D1 (Critical) / R1 (None/Negligible)

[29 May 2007 17:20] Joerg Bruehe
Description:
On OS X (PPC, 64 bit), the server crashes (2013) if it gets instructed to install a non-existing ".so" file as a plugin.

Test "ps":
=====
Errors are (from /PATH/mysqltest-time) :
mysqltest: At line 2178: query 'call proc_1()' failed with wrong errno 2013: 'Lost connection to MySQL server during query', instead of 1126...
(the last lines may be the most important ones)
Result from queries before failure can be found in /PATH/mysql-test/var/log/ps.log
=====

Long-standing test failure which just did not get reported :-(

The lines leading to the error:

create procedure proc_1() install plugin my_plug soname 'some_plugin.so';
--replace_regex /(Can\'t open shared library).*$/\1/
--error ER_CANT_OPEN_LIBRARY,ER_FEATURE_DISABLED
call proc_1();

How to repeat:
Run test "ps" on that platform.
[29 May 2007 17:41] Antony Curtis
This bug may be a dup of Bug#27836 which is queued on the 5.1-engines tree.
[12 Jun 2007 17:25] Antony Curtis
Unable to reproduce on G5 PowerMac using either own built sources nor with 64bit 5.1.19-beta pre-built binaries.
Joerg will examine if error is reproducable.
[26 Jun 2007 14:01] Joerg Bruehe
It is - happened again in the 5.1.20 builds.
[11 Jul 2007 0:34] Antony Curtis
Crash occurs in sql_plugin.cc

(gdb) frame 3
#3  0x000000000028ca60 in plugin_dl_add (dl=<incomplete type>, report=<incomplete type>) at sql_plugin.cc:372
372       if (!(plugin_dl.handle= dlopen(dlpath, RTLD_NOW)))
(gdb) print &dlpath
$2 = (struct <unknown> *) 0xf007e4b0
(gdb) x/s 0xf007e4b0
0xf007e4b0:      "/Users/mysqldev/antony/osx-tiger-ppc-64bit/mysql-5.1.20-beta/mysql-test/lib/mysql/some_plugin.so"

Arguments to dlopen() are perfectly sane, even if the file does not exist.
This appears to be a bug in dyld on MacOS 10.4.6 which has been fixed in later versions, in particular MacOS 10.4.10 definitely doesn't crash in this test.
[28 Dec 2007 19:51] Joerg Bruehe
I have no idea why this was set to "can't repeat".

The bug occurs in 5.1.21, 5.1.22, 6.0.3, and 6.0.4
(I just repeated it in 6.0.4-alpha, the others are from existing logs).

Assuming
1) it is an OS bug, as claimed above,
2) we still have to build on this version, and
3) we cannot or will not work around it,
a "won't fix" (as a conscious decision!) might be appropriate.
[17 Jan 2008 21:03] Antony Curtis
This bug does not exist in MacOS 10.4.10 or on MacOS 10.5 - it only exists on 10.4.6 and the crash occurs within the MacOS system libraries. Not a bug in the mysql code.
Pushbuild host should be updated from 10.4.6 to 10.4.10.
Lars has asked me to reassign this bug.
[16 Mar 2009 12:49] Daniel Fischer
"Not a bug" because this is a bug in the operating system that is exposed by our binaries, and not a bug in the MySQL Server. As far as I can tell, Mac OS X 10.4.6 was the last version of Mac OS X that was affected.

The bug report was originally filed because internal testing on an older version of Mac OS X exposed this bug.