Description:
mysql-proxy is crashing on startup, when LD_PRELOAD_64 is set to prealoadable libiconv object, for example:
/usr/local/libiconv/lib/preloadable_libiconv.so
mysql-proxy was build under this exactl environment.
Backtrace:
/usr/local/solarisstudio12.3/bin/dbx /usr/local/mysql-proxy/bin/mysql-proxy core
For information about new features see `help changes'
To remove this message, put `dbxenv suppress_startup_message 7.9' in your .dbxrc
Reading mysql-proxy
core file header read successfully
Reading ld.so.1
Reading preloadable_libiconv.so
Reading libm.so.2
Reading libmysql-chassis.so.0.0.0
Reading libmysql-proxy.so.0.0.0
Reading libevent-1.4.so.2.2.0
Reading libgmodule-2.0.so.0.3000.3
Reading libgthread-2.0.so.0.3000.3
Reading libpthread.so.1
Reading libthread.so.1
Reading libmysql-chassis-timing.so.0.0.0
Reading libmysql-chassis-glibext.so.0.0.0
Reading libglib-2.0.so.0.3000.3
Reading libresolv.so.2
Reading libnsl.so.1
Reading libsocket.so.1
Reading libc.so.1
Reading libgcc_s.so.1
Reading libproxy.so
Reading librt.so.1
Reading libmd.so.1
Reading libcryptoutil.so.1
Reading libmp.so.2
t@1 (l@1) program terminated by signal SEGV (no mapping at the fault address)
0xffff80ffbf3da5af: iconv+0x0013: call *0x0000000000000008(%r9)
Current function is g_iconv
314 return iconv (cd, inbuf, inbytes_left, outbuf, outbytes_left);
(dbx) where
current thread: t@1
[1] iconv(0x458b4800000000e8, 0xffff80ffbffff3c8, 0xffff80ffbffff3c0, 0xffff80ffbffff3d0, 0xffff80ffbffff3b8, 0xffff80ffbe333116), at 0xffff80ffbf3da5af
=>[2] g_iconv(converter = 0x4290d0, inbuf = 0xffff80ffbffff3c8, inbytes_left = 0xffff80ffbffff3c0, outbuf = 0xffff80ffbffff3d0, outbytes_left = 0xffff80ffbffff3b8), line 314 in "gconvert.c"
[3] g_convert_with_iconv(str = 0xffff80ffbffffad9 "192.168.0.3:3306", len = 16, converter = 0x4290d0, bytes_read = (nil), bytes_written = (nil), error = 0xffff80ffbffff800), line 745 in "gconvert.c"
[4] g_convert(str = 0xffff80ffbffffad9 "192.168.0.3:3306", len = -1, to_codeset = 0xffff80ffb0283fbf "UTF-8", from_codeset = 0x4188b0 "ASCII", bytes_read = (nil), bytes_written = (nil), error = 0xffff80ffbffff800), line 889 in "gconvert.c"
[5] g_locale_to_utf8(opsysstring = 0xffff80ffbffffad9 "192.168.0.3:3306", len = -1, bytes_read = (nil), bytes_written = (nil), error = 0xffff80ffbffff800), line 1220 in "gconvert.c"
[6] parse_arg(context = 0x427800, group = 0x427980, entry = 0x42f150, value = 0xffff80ffbffffad9 "192.168.0.3:3306", option_name = 0x42b2e0 "--proxy-backend-addresses", error = 0xffff80ffbffff800), line 1180 in "goption.c"
[7] parse_long_option(context = 0x427800, group = 0x427980, idx = 0xffff80ffbffff67c, arg = 0xffff80ffbffffac1 "proxy-backend-addresses=192.168.0.3:3306", aliased = 0, argc = 0xffff80ffbffff7ec, argv = 0xffff80ffbffff7e0, error = 0xffff80ffbffff800, parsed = 0xffff80ffbffff678), line 1538 in "goption.c"
[8] g_option_context_parse(context = 0x427800, argc = 0xffff80ffbffff7ec, argv = 0xffff80ffbffff7e0, error = 0xffff80ffbffff800), line 1871 in "goption.c"
[9] chassis_frontend_init_plugins(plugins = 0x418080, option_ctx = 0x427800, argc_p = 0xffff80ffbffff7ec, argv_p = 0xffff80ffbffff7e0, keyfile = (nil), keyfile_section_name = 0x403ea5 "mysql-proxy", base_dir = 0x42b2b0 "/usr/local/mysql-proxy", gerr = 0xffff80ffbffff800), line 410 in "chassis-frontend.c"
[10] main_cmdline(argc = 2, argv = 0xffff80ffbffff8a8), line 470 in "mysql-proxy-cli.c"
[11] main(argc = 2, argv = 0xffff80ffbffff8a8), line 652 in "mysql-proxy-cli.c"
(dbx) exit
How to repeat:
Build and install mysql-proxy 64-bit from source, with local libiconv and LD_PRELOAD_64 set to preloadable libiconv.
Run it.
Suggested fix:
unset the LD_PRELOAD_64 environment variable.