Description:
When initing and closing embedded server with mysql_library_init() and mysql_library_end() multiple times I obtain a crash in my_strcasecmp_8bit function with following stack trace :
Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_PROTECTION_FAILURE at address: 0x00000003
my_strcasecmp_8bit (cs=0x74b1a0, s=0x3 <Address 0x3 out of bounds>, t=0x4c2624 "utf8") at ctype-simple.c:244
244 while (map[(uchar) *s] == map[(uchar) *t++])
(gdb) backtrace
#0 my_strcasecmp_8bit (cs=0x74b1a0, s=0x3 <Address 0x3 out of bounds>, t=0x4c2624 "utf8") at ctype-simple.c:244
#1 0x0009da0f in get_charset_number [inlined] () at /Users/lucien/DATA/PROGRAMATION/_LIB/32/mysql-5.1.43-DBG/mysys/charset.c:446
#2 0x0009da0f in get_charset_by_csname (cs_name=0x4c2624 "utf8", cs_flags=32, flags=16) at charset.c:564
#3 0x002509b2 in init_common_variables (conf_file_name=0x4d1388 "my", argc=4, argv=0x3801748, groups=0xbffff720) at mysqld.cc:3384
#4 0x00250fe6 in init_embedded_server (argc=4, argv=0xbffff730, groups=0xbffff720) at lib_sql.cc:504
This bug appear in 5.1.44, 5.1.43 but it works smoothly in 5.1.42
I use a home made MySQL compiled with following options:
CC=gcc CFLAGS="-O3 -fno-omit-frame-pointer" CXX=gcc CXXFLAGS="-O3 -fno-omit-frame-pointer -felide-constructors -fno-exceptions -fno-rtti" ./configure CC=gcc CFLAGS="-O3 -fno-omit-frame-pointer -arch i386" CXX=gcc CXXFLAGS="-O3 -fno-omit-frame-pointer -felide-constructors -fno-exceptions -fno-rtti -arch i386" LDFLAGS="-arch i386" OBJCFLAGS="-arch i386" OBJCXXFLAGS="-arch i386" --prefix=/Users/Lucien/DATA/LIB_MYSQL --with-extra-charsets=complex --enable-thread-safe-client --enable-local-infile --with-embedded-server --with-charset=utf8
How to repeat:
To reproduce : init and close MySQL embedded multiple time (mysql_library_init()) with following arguments. After a few init (usually 3-4) MySQL crash in function described above.
char *server_args[] =
{
"this_program",
“--datadir=”/Users/Lucien/DATA/test”,
"--language=./mysql",
"--port=3309"
};
char *server_groups[] =
{
"embedded",
"server",
"this_program_SERVER",
(char *)NULL
};
Description: When initing and closing embedded server with mysql_library_init() and mysql_library_end() multiple times I obtain a crash in my_strcasecmp_8bit function with following stack trace : Program received signal EXC_BAD_ACCESS, Could not access memory. Reason: KERN_PROTECTION_FAILURE at address: 0x00000003 my_strcasecmp_8bit (cs=0x74b1a0, s=0x3 <Address 0x3 out of bounds>, t=0x4c2624 "utf8") at ctype-simple.c:244 244 while (map[(uchar) *s] == map[(uchar) *t++]) (gdb) backtrace #0 my_strcasecmp_8bit (cs=0x74b1a0, s=0x3 <Address 0x3 out of bounds>, t=0x4c2624 "utf8") at ctype-simple.c:244 #1 0x0009da0f in get_charset_number [inlined] () at /Users/lucien/DATA/PROGRAMATION/_LIB/32/mysql-5.1.43-DBG/mysys/charset.c:446 #2 0x0009da0f in get_charset_by_csname (cs_name=0x4c2624 "utf8", cs_flags=32, flags=16) at charset.c:564 #3 0x002509b2 in init_common_variables (conf_file_name=0x4d1388 "my", argc=4, argv=0x3801748, groups=0xbffff720) at mysqld.cc:3384 #4 0x00250fe6 in init_embedded_server (argc=4, argv=0xbffff730, groups=0xbffff720) at lib_sql.cc:504 This bug appear in 5.1.44, 5.1.43 but it works smoothly in 5.1.42 I use a home made MySQL compiled with following options: CC=gcc CFLAGS="-O3 -fno-omit-frame-pointer" CXX=gcc CXXFLAGS="-O3 -fno-omit-frame-pointer -felide-constructors -fno-exceptions -fno-rtti" ./configure CC=gcc CFLAGS="-O3 -fno-omit-frame-pointer -arch i386" CXX=gcc CXXFLAGS="-O3 -fno-omit-frame-pointer -felide-constructors -fno-exceptions -fno-rtti -arch i386" LDFLAGS="-arch i386" OBJCFLAGS="-arch i386" OBJCXXFLAGS="-arch i386" --prefix=/Users/Lucien/DATA/LIB_MYSQL --with-extra-charsets=complex --enable-thread-safe-client --enable-local-infile --with-embedded-server --with-charset=utf8 How to repeat: To reproduce : init and close MySQL embedded multiple time (mysql_library_init()) with following arguments. After a few init (usually 3-4) MySQL crash in function described above. char *server_args[] = { "this_program", “--datadir=”/Users/Lucien/DATA/test”, "--language=./mysql", "--port=3309" }; char *server_groups[] = { "embedded", "server", "this_program_SERVER", (char *)NULL };