>Description:
When using groups in 3.23.49, client dumps core.
This bug sounds to be new (it does not appear in 3.23.41)
>How-To-Repeat:
Just compile a little C client (you can also dump cores with DBI perl
module) :
% cat bug.c
#include <mysql/mysql.h>
#include <stdio.h>
int main(void) {
MYSQL mysql;
mysql_init(&mysql);
mysql_options(&mysql, MYSQL_READ_DEFAULT_GROUP, "bug");
mysql_real_connect(&mysql, NULL, NULL, NULL, NULL, 0, NULL, 0);
return 0;
}
% cat $HOME/.my.cnf
[bug]
host=foobar
% cc -I/usr/local/include -g bug.c -o bug -L/usr/local/lib/mysql -lmysqlclient
% gdb bug
(gdb) run
Starting program: /home/lwa/tmp/mbug/bug
Program received signal SIGSEGV, Segmentation fault.
strcend (s=0x804efff "-" <Error reading address 0x804f000: Bad address>, c=95)
at strcend.c:51
51 if (*s == (char) c) return (char*) s;
(gdb) where
#0 strcend (s=0x804efff "-" <Error reading address 0x804f000: Bad address>,
c=95) at strcend.c:51
#1 0x280700f6 in mysql_read_default_options (options=0xbfbff400,
filename=0x28081442 "my", group=0x804b030 "bug") at libmysql.c:715
#2 0x28070a64 in mysql_real_connect (mysql=0xbfbff270, host=0x0, user=0x0,
passwd=0x0, db=0x0, port=0, unix_socket=0x0, client_flag=0)
at libmysql.c:1189
#3 0x80485e2 in main () at bug.c:8
#4 0x80484c3 in _start ()
(gdb) print (char *)0x804d000
$1 = 0x804d000 "[bug]\n\thost=foobar\n", '-' <repeats 181 times>...
(gdb)
>Fix:
After the core, the memory is full of '-'.
I suspect the following newly added lines in
libmysql/libmysql.c:mysql_read_default_options() :
/* Change all '_' in variable name to '-' */
for (end= *option ; (end= strcend(end,'_')) ; )
*end= '-';
>Submitter-Id: <submitter ID>
>Originator: Laurent Wacrenier
>Organization: France Teaser
>MySQL support: none
>Synopsis: core dump in clients using groups
>Severity: critical
>Priority: medium
>Category: mysql
>Class: sw-bug
>Release: mysql-3.23.49 (FreeBSD port: mysql-server-3.23.49)
>Environment:
System: FreeBSD victor.teaser.fr 5.0-CURRENT FreeBSD 5.0-CURRENT #3: Fri Feb 1
15:12:56 CET 2002 [EMAIL PROTECTED]:/usr/src/sys/i386/compile/VICTOR i386
Some paths: /usr/bin/perl /usr/bin/make /usr/local/bin/gmake /usr/bin/gcc /usr/bin/cc
GCC: Using builtin specs.
gcc version 2.95.3 20010315 (release)
Compilation info: CC='cc' CFLAGS='-O9 -mpentiumpro -pipe -g -march=pentiumpro'
CXX='cc' CXXFLAGS='-O9 -mpentiumpro -pipe -g -march=pentiumpro -felide-constructors
-fno-rtti -fno-exceptions' LDFLAGS=''
LIBC:
-r--r--r-- 1 root wheel 1463360 1 f�v 14:58 /usr/lib/libc.a
lrwxr-xr-x 1 root wheel 9 1 f�v 14:58 /usr/lib/libc.so -> libc.so.5
-r--r--r-- 1 root wheel 732000 1 f�v 14:58 /usr/lib/libc.so.5
Configure command: ./configure --localstatedir=/var/db/mysql --without-perl
--without-debug --without-readline --without-bench --with-mit-threads=no
--with-libwrap --with-low-memory '--with-comment=FreeBSD port: mysql-server-3.23.49'
--enable-assembler --with-berkeley-db --with-innodb --prefix=/usr/local
i386-portbld-freebsd5.0
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php