tpcc_start core dump on Ubuntu 9.04 64bit

Bug #997478 reported by Vincent Liu on 2012-05-10
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
percona-tools
Undecided
Unassigned

Bug Description

Reading symbols from /lib/libgcc_s.so.1...done.
Loaded symbols for /lib/libgcc_s.so.1
Reading symbols from /lib/libnss_files.so.2...done.
Loaded symbols for /lib/libnss_files.so.2
Core was generated by `./tpcc_start -h xxx -P xxx -d tpcc -uxxx -pxxx -w 10 -c 1 -'.
Program terminated with signal 11, Segmentation fault.
[New process 31299]
[New process 31297]
#0 0x00007f4c6b17dfd2 in my_stat () from /usr/lib/libmysqlclient_r.so.16
(gdb) bt
#0 0x00007f4c6b17dfd2 in my_stat () from /usr/lib/libmysqlclient_r.so.16
#1 0x00007f4c6b1753b4 in ?? () from /usr/lib/libmysqlclient_r.so.16
#2 0x00007f4c6b175cd0 in ?? () from /usr/lib/libmysqlclient_r.so.16
#3 0x00007f4c6b175e77 in get_charset_by_csname () from /usr/lib/libmysqlclient_r.so.16
#4 0x00007f4c6b1977ba in mysql_init_character_set () from /usr/lib/libmysqlclient_r.so.16
#5 0x00007f4c6b1997a8 in mysql_real_connect () from /usr/lib/libmysqlclient_r.so.16
#6 0x0000000000402ad1 in thread_main (arg=<value optimized out>) at main.c:668
#7 0x00007f4c6a9853ba in start_thread () from /lib/libpthread.so.0
#8 0x00007f4c6ac8002d in clone () from /lib/libc.so.6
#9 0x0000000000000000 in ?? ()

(gdb) run -h 220.181.86.239 -P 6303 -d tpcc -umyshard -pmyshard -w 10 -c 1 -r 10 -l 60

But I tried to compile it on 32bit ubuntu and it runs well. Anyway..

Fix:

=== modified file 'src/main.c'
--- src/main.c 2011-10-24 02:54:41 +0000
+++ src/main.c 2012-05-09 09:40:40 +0000
@@ -659,6 +659,7 @@
     db_string_ptr = node_string[((num_node * t_num)/num_conn)];
   }

+ mysql_thread_init();
   if(is_local==1){
     /* exec sql connect :connect_string; */
     resp = mysql_real_connect(ctx[t_num], "localhost", db_user, db_password, db_string, port, NULL, 0);

Btw, the Makefile uses `mysql_config`, which may not be installed on any machine. It would be better if we could mention this a lit in README, anyway...

Good tool, thank you all so much for such a good job!

Gea-Suan Lin (gslin) wrote :

In AWS EC2 us-east-1, I can reproduce this issue on m1.small 64bits (Ubuntu 12.04 LTS).

Chang chen (baibaichen) wrote :

the root cause is we don't call mysql_thread_init() in the connection thread see http://dev.mysql.com/doc/refman/5.0/en/mysql-thread-init.html

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers