MySQL Forums
Forum List  »  Connector/C (libmysql)

mysql_ping() crash the client app
Posted by: xu cao
Date: October 14, 2014 11:19PM

we encountered an crash error when uses the mysql connector. The coredump was like:

No symbol "net" in current context.
(gdb) bt
#0 0x00002b4c13558e64 in my_real_read (net=0x2b4c043e1cb0, complen=0x2b4caa57fef0)
at /export/home/pb2/build/sb_0-6742818-1346230389.05/rpm/BUILD/mysql-5.5.28/mysql-5.5.28/sql/net_serv.cc:833
#1 0x00002b4c135590d0 in my_net_read (net=0x0) at /export/home/pb2/build/sb_0-6742818-1346230389.05/rpm/BUILD/mysql-5.5.28/mysql-5.5.28/sql/net_serv.cc:1028
#2 0x00002b4c1355a3b6 in cli_safe_read (mysql=0x0) at /export/home/pb2/build/sb_0-6742818-1346230389.05/rpm/BUILD/mysql-5.5.28/mysql-5.5.28/sql-common/client.c:735
#3 0x00002b4c1355e0d9 in cli_advanced_command (mysql=0x2b4c043e1cb0, command=<value optimized out>, header=0x0, header_length=0, arg=0x0, arg_length=0, skip_check=0 '\000',
stmt=0x0) at /export/home/pb2/build/sb_0-6742818-1346230389.05/rpm/BUILD/mysql-5.5.28/mysql-5.5.28/sql-common/client.c:863
#4 0x00002b4c135519e5 in mysql_ping (mysql=0x0) at /export/home/pb2/build/sb_0-6742818-1346230389.05/rpm/BUILD/mysql-5.5.28/mysql-5.5.28/libmysql/libmysql.c:969
#5 0x00002b4c1354c63b in rytong::MysqlConnection::get_connection (this=0x2b4c043e1c90) at /root/ewp/drivers/db/c_src/mysql/MysqlConnection.h:53
#6 0x00002b4c1354e907 in rytong::MysqlDBOperation::real_query_sql (this=0x2b4ce4092530, sql=0x2b4c135dfa3f "ROLLBACK", res=0x912fa68, db_conn=@0x2b4caa580070)
at c_src/mysql/MysqlDBOperation.cpp:558
#7 0x00002b4c1354e9d8 in rytong::MysqlDBOperation::trans_rollback (this=0x2b4ce4092530, res=0x912fa68) at c_src/mysql/MysqlDBOperation.cpp:166
#8 0x00002b4c135454d1 in rytong::DatabaseDrv::execute_cmd (db_oper=0x2b4ce4092530, cmd=DRV_TRANSACTION_ROLLBACK, res=0x912fa68) at c_src/base/DatabaseDrv.cpp:178
#9 0x00002b4c135457e8 in rytong::DatabaseDrv::io_async (arg=0x912fa58) at c_src/base/DatabaseDrv.cpp:98
#10 0x00002b4c135416b7 in rytong::ThreadPool::async_main (arg=0x2b4c0401ed50) at c_src/base/ThreadPool.cpp:136
#11 0x0000003832e0683d in start_thread () from /lib64/libpthread.so.0
#12 0x00000038322d4fcd in clone () from /lib64/libc.so.6
(gdb) print 0x2b4c043e1cb0
$4 = 47605488688304
(gdb) print *0x2b4c043e1cb0
$5 = 0
(gdb) down
#3 0x00002b4c1355e0d9 in cli_advanced_command (mysql=0x2b4c043e1cb0, command=<value optimized out>, header=0x0, header_length=0, arg=0x0, arg_length=0, skip_check=0 '\000',
stmt=0x0) at /export/home/pb2/build/sb_0-6742818-1346230389.05/rpm/BUILD/mysql-5.5.28/mysql-5.5.28/sql-common/client.c:863
863 /export/home/pb2/build/sb_0-6742818-1346230389.05/rpm/BUILD/mysql-5.5.28/mysql-5.5.28/sql-common/client.c: 没有那个文件或目录.
in /export/home/pb2/build/sb_0-6742818-1346230389.05/rpm/BUILD/mysql-5.5.28/mysql-5.5.28/sql-common/client.c
(gdb) down
#2 0x00002b4c1355a3b6 in cli_safe_read (mysql=0x0) at /export/home/pb2/build/sb_0-6742818-1346230389.05/rpm/BUILD/mysql-5.5.28/mysql-5.5.28/sql-common/client.c:735
735 in /export/home/pb2/build/sb_0-6742818-1346230389.05/rpm/BUILD/mysql-5.5.28/mysql-5.5.28/sql-common/client.c
(gdb) up
#3 0x00002b4c1355e0d9 in cli_advanced_command (mysql=0x2b4c043e1cb0, command=<value optimized out>, header=0x0, header_length=0, arg=0x0, arg_length=0, skip_check=0 '\000',
stmt=0x0) at /export/home/pb2/build/sb_0-6742818-1346230389.05/rpm/BUILD/mysql-5.5.28/mysql-5.5.28/sql-common/client.c:863
863 in /export/home/pb2/build/sb_0-6742818-1346230389.05/rpm/BUILD/mysql-5.5.28/mysql-5.5.28/sql-common/client.c
(gdb) up
#4 0x00002b4c135519e5 in mysql_ping (mysql=0x0) at /export/home/pb2/build/sb_0-6742818-1346230389.05/rpm/BUILD/mysql-5.5.28/mysql-5.5.28/libmysql/libmysql.c:969
969 /export/home/pb2/build/sb_0-6742818-1346230389.05/rpm/BUILD/mysql-5.5.28/mysql-5.5.28/libmysql/libmysql.c: 没有那个文件或目录.
in /export/home/pb2/build/sb_0-6742818-1346230389.05/rpm/BUILD/mysql-5.5.28/mysql-5.5.28/libmysql/libmysql.c
(gdb) up
#5 0x00002b4c1354c63b in rytong::MysqlConnection::get_connection (this=0x2b4c043e1c90) at /root/ewp/drivers/db/c_src/mysql/MysqlConnection.h:53
53 int state = mysql_ping(conn_);
(gdb) print state
$6 = 0
(gdb) print conn_
$7 = (MYSQL *) 0x2b4c043e1cb0
(gdb) print *conn_
$8 = {net = {vio = 0x0, buff = 0x0, buff_end = 0x2b4c043e8420 "\020b", write_pos = 0x2b4c043e6420 "<", read_pos = 0x2b4c043e6420 "<", fd = 164, remain_in_buf = 0, length = 0,
buf_length = 0, where_b = 0, max_packet = 8192, max_packet_size = 1073741824, pkt_nr = 1, compress_pkt_nr = 0, write_timeout = 31536000, read_timeout = 31536000,
retry_count = 1, fcntl = 0, return_status = 0x0, reading_or_writing = 0 '\000', save_char = 0 '\000', unused1 = 0 '\000', unused2 = 0 '\000', compress = 0 '\000',
unused3 = 0 '\000', unused = 0x0, last_errno = 2013, error = 0 '\000', unused4 = 0 '\000', unused5 = 0 '\000',
last_error = "Lost connection to MySQL server during query", '\000' <repeats 467 times>, sqlstate = "HY000", extension = 0x0}, connector_fd = 0x0,
host = 0x2b4c043e21f0 "192.168.20.93", user = 0x2b4c043e8430 "root", passwd = 0x2b4c043e8450 "Ryt_123", unix_socket = 0x0, server_version = 0x2b4c043e2208 "5.5.28-log",
host_info = 0x2b4c043e21d0 "192.168.20.93 via TCP/IP", info = 0x0, db = 0x2b4c043e8470 "vas_manage", charset = 0x2b4c13a204e0, fields = 0x0, field_alloc = {free = 0x0,
used = 0x0, pre_alloc = 0x0, min_malloc = 32, block_size = 8160, block_num = 4, first_block_usage = 0, error_handler = 0}, affected_rows = 18446744073709551615, insert_id = 0,
extra_info = 0, thread_id = 5318, packet_length = 1, port = 3306, client_flag = 959117, server_capabilities = 18446744071563114495, protocol_version = 10, field_count = 0,
server_status = 2, server_language = 8, warning_count = 0, options = {connect_timeout = 0, read_timeout = 0, write_timeout = 0, port = 0, protocol = 0, client_flag = 128,
host = 0x0, user = 0x0, password = 0x0, unix_socket = 0x0, db = 0x0, init_commands = 0x0, my_cnf_file = 0x0, my_cnf_group = 0x0, charset_dir = 0x0,
charset_name = 0x2b4c043e21b0 "utf8", ssl_key = 0x0, ssl_cert = 0x0, ssl_ca = 0x0, ssl_capath = 0x0, ssl_cipher = 0x0, shared_memory_base_name = 0x0, max_allowed_packet = 0,
use_ssl = 0 '\000', compress = 0 '\000', named_pipe = 0 '\000', unused1 = 0 '\000', unused2 = 0 '\000', unused3 = 0 '\000', unused4 = 0 '\000',
methods_to_use = MYSQL_OPT_GUESS_CONNECTION, client_ip = 0x0, secure_auth = 0 '\000', report_data_truncation = 1 '\001', local_infile_init = 0, local_infile_read = 0,
local_infile_end = 0, local_infile_error = 0, local_infile_userdata = 0x0, extension = 0x0}, status = MYSQL_STATUS_READY, free_me = 1 '\001', reconnect = 1 '\001',
scramble = "+&{\\<SnQ)xB~x]I5lDK.", unused1 = 0 '\000', unused2 = 0x0, unused3 = 0x0, unused4 = 0x0, unused5 = 0x0, stmts = 0x0, methods = 0x2b4c13a0d3c0, thd = 0x0,
unbuffered_fetch_owner = 0x0, info_buffer = 0x0, extension = 0x0}



It seemed that mysql_ping() crashed after a 2013 error "Lost connection to MySQL server during query" happened. The MYSQL* looked normal excepted that the net.vio and net.buff were NULL. Was that the reason why mysql_ping() crashed?


And by the way, why the following dump

#2 0x00002b4c1355a3b6 in cli_safe_read (mysql=0x0)
#4 0x00002b4c135519e5 in mysql_ping (mysql=0x0)

prompted that MYSQL* mysql = 0x0, not the one in

#3 0x00002b4c1355e0d9 in cli_advanced_command (mysql=0x2b4c043e1cb0)

Thanks for help.

Options: ReplyQuote


Subject
Views
Written By
Posted
mysql_ping() crash the client app
2522
October 14, 2014 11:19PM
968
November 15, 2014 11:07AM
879
February 03, 2015 07:29PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.