连接MYSQL时,操作都没有问题,过段时间会出现 段错误,查看了一下CORE文件发现在my_real_read处出错
net->vio的值为0,导值 if ((long) (length= vio_read(net->vio, pos, remain)) <= 0L) 此条广语句访问零指针,
猜测好像是与网络连接有关,由于对MYSQL不对熟悉,有没有对些了解的帮看一下。
#0 0x00007f1275c0aae5 in my_real_read (net=0x7f127001bf18, complen=complen@entry=0x7f126eb4bf00)
at /usr/src/debug/mariadb-5.5.44/sql/net_serv.cc:842
#1 0x00007f1275c0b94c in my_net_read (net=net@entry=0x7f127001bf18) at /usr/src/debug/mariadb-5.5.44/sql/net_serv.cc:1026
#2 0x00007f1275bfe55c in cli_safe_read (mysql=mysql@entry=0x7f127001bf18) at /usr/src/debug/mariadb-5.5.44/sql-common/client.c:741
#3 0x00007f1275bfea13 in cli_read_rows (mysql=0x7f127001bf18, mysql_fields=0x0, fields=7)
at /usr/src/debug/mariadb-5.5.44/sql-common/client.c:1576
#4 0x00007f1275bfa761 in cli_read_prepare_result (mysql=<optimized out>, stmt=<optimized out>)
at /usr/src/debug/mariadb-5.5.44/libmysql/libmysql.c:1453
#5 0x00007f1275bfaabd in mysql_stmt_prepare (stmt=<optimized out>, query=<optimized out>, length=<optimized out>)
at /usr/src/debug/mariadb-5.5.44/libmysql/libmysql.c:1639
#6 0x00007f12761045d9 in prepare (stmt=stmt@entry=0x7f125403ac50, query=0x7f12540419a0 “x”, query_length=84)
at /usr/src/debug/mysql-connector-odbc-5.2.5-src/driver/my_stmt.c:388
#7 0x00007f12760ffce8 in my_SQLPrepare (hstmt=hstmt@entry=0x7f125403ac50, szSqlStr=<optimized out>, cbSqlStr=<optimized out>,
dupe=<optimized out>) at /usr/src/debug/mysql-connector-odbc-5.2.5-src/driver/prepare.c:103
#8 0x00007f12760ffd7e in MySQLPrepare (hstmt=hstmt@entry=0x7f125403ac50, query=<optimized out>, len=<optimized out>,
dupe=dupe@entry=1 “\001”) at /usr/src/debug/mysql-connector-odbc-5.2.5-src/driver/prepare.c:74
#9 0x00007f127610ae9c in SQLPrepareWImpl (hstmt=0x7f125403ac50, str=<optimized out>, str_len=84)
at /usr/src/debug/mysql-connector-odbc-5.2.5-src/driver/unicode.c:804
#10 0x00007f12785786ea in SQLPrepare () from /lib64/libodbc.so.2
net->vio的值为0,导值 if ((long) (length= vio_read(net->vio, pos, remain)) <= 0L) 此条广语句访问零指针,
猜测好像是与网络连接有关,由于对MYSQL不对熟悉,有没有对些了解的帮看一下。
#0 0x00007f1275c0aae5 in my_real_read (net=0x7f127001bf18, complen=complen@entry=0x7f126eb4bf00)
at /usr/src/debug/mariadb-5.5.44/sql/net_serv.cc:842
#1 0x00007f1275c0b94c in my_net_read (net=net@entry=0x7f127001bf18) at /usr/src/debug/mariadb-5.5.44/sql/net_serv.cc:1026
#2 0x00007f1275bfe55c in cli_safe_read (mysql=mysql@entry=0x7f127001bf18) at /usr/src/debug/mariadb-5.5.44/sql-common/client.c:741
#3 0x00007f1275bfea13 in cli_read_rows (mysql=0x7f127001bf18, mysql_fields=0x0, fields=7)
at /usr/src/debug/mariadb-5.5.44/sql-common/client.c:1576
#4 0x00007f1275bfa761 in cli_read_prepare_result (mysql=<optimized out>, stmt=<optimized out>)
at /usr/src/debug/mariadb-5.5.44/libmysql/libmysql.c:1453
#5 0x00007f1275bfaabd in mysql_stmt_prepare (stmt=<optimized out>, query=<optimized out>, length=<optimized out>)
at /usr/src/debug/mariadb-5.5.44/libmysql/libmysql.c:1639
#6 0x00007f12761045d9 in prepare (stmt=stmt@entry=0x7f125403ac50, query=0x7f12540419a0 “x”, query_length=84)
at /usr/src/debug/mysql-connector-odbc-5.2.5-src/driver/my_stmt.c:388
#7 0x00007f12760ffce8 in my_SQLPrepare (hstmt=hstmt@entry=0x7f125403ac50, szSqlStr=<optimized out>, cbSqlStr=<optimized out>,
dupe=<optimized out>) at /usr/src/debug/mysql-connector-odbc-5.2.5-src/driver/prepare.c:103
#8 0x00007f12760ffd7e in MySQLPrepare (hstmt=hstmt@entry=0x7f125403ac50, query=<optimized out>, len=<optimized out>,
dupe=dupe@entry=1 “\001”) at /usr/src/debug/mysql-connector-odbc-5.2.5-src/driver/prepare.c:74
#9 0x00007f127610ae9c in SQLPrepareWImpl (hstmt=0x7f125403ac50, str=<optimized out>, str_len=84)
at /usr/src/debug/mysql-connector-odbc-5.2.5-src/driver/unicode.c:804
#10 0x00007f12785786ea in SQLPrepare () from /lib64/libodbc.so.2
解决方案
20
你是直接看的mysql代码输出的错误?
本人觉得你先看一下mysql的错误日志吧,毕竟看这个msyql源代码,要找问题,只能设置断点调试,那个太麻烦了
本人觉得你先看一下mysql的错误日志吧,毕竟看这个msyql源代码,要找问题,只能设置断点调试,那个太麻烦了
20
过多久?是时间超时?先看一下mysql的错误日志