Description:
This bug was found in the DEBUG version. When I try to close a disconnected mysql client, it crashed.
bt:
#0 0x00007f680984a5f7 in raise () from /lib64/libc.so.6
#1 0x00007f680984bce8 in abort () from /lib64/libc.so.6
#2 0x0000000000646b87 in DbugExit (why=0x7f6802ffc0d0 "missing DBUG_RETURN or DBUG_VOID_RETURN macro in function \"?func\"\n") at /data/tools/source/mysql-5.7.16/dbug/dbug.c:2228
#3 0x0000000000645420 in _db_return_ (_line_=4916, _stack_frame_=0x7f6802ffc310) at /data/tools/source/mysql-5.7.16/dbug/dbug.c:1291
#4 0x000000000062c2fc in mysql_reconnect (mysql=0x7f67e80012e0) at /data/tools/source/mysql-5.7.16/sql-common/client.c:4916
#5 0x0000000000622aa8 in cli_advanced_command (mysql=0x7f67e80012e0, command=COM_QUIT, header=0x0, header_length=0, arg=0x0, arg_length=0, skip_check=1 '\001', stmt=0x0)
at /data/tools/source/mysql-5.7.16/sql-common/client.c:1249
#6 0x000000000062ca16 in mysql_close (mysql=0x7f67e80012e0) at /data/tools/source/mysql-5.7.16/sql-common/client.c:5110
#7 0x0000000000610078 in freeMysql (m=0x7f67e80012e0) at /data/leopoldfreeman/workspace/syncservice/csync/component/simpleMysqlClient/src/mysqlClientImpl.cpp:12
#8 0x0000000000611358 in std::_Function_handler<void (st_mysql*), void (*)(st_mysql*)>::_M_invoke(std::_Any_data const&, st_mysql*) (__functor=..., __args#0=0x7f67e80012e0)
at /usr/include/c++/4.8.2/functional:2071
#9 0x0000000000610059 in std::function<void (st_mysql*)>::operator()(st_mysql*) const (this=0x7f67e8000f00, __args#0=0x7f67e80012e0) at /usr/include/c++/4.8.2/functional:2471
#10 0x000000000060ff6d in std::unique_ptr<st_mysql, std::function<void (st_mysql*)> >::~unique_ptr() (this=0x7f67e8000f00, __in_chrg=<optimized out>) at /usr/include/c++/4.8.2/bits/unique_ptr.h:184
#11 0x000000000060fe42 in csync::MysqlClientImpl::~MysqlClientImpl (this=0x7f67e8000f00, __in_chrg=<optimized out>)
at /data/leopoldfreeman/workspace/syncservice/csync/component/simpleMysqlClient/inc/mysqlClientImpl.h:16
#12 0x000000000060fce1 in csync::SimpleMysqlClient::~SimpleMysqlClient (this=0x7f67e8000fb0, __in_chrg=<optimized out>)
at /data/leopoldfreeman/workspace/syncservice/csync/component/simpleMysqlClient/src/simpleMysqlClient.cpp:17
#13 0x00000000005ea3d2 in std::default_delete<csync::SimpleMysqlClient>::operator() (this=0x7f67f4001230, __ptr=0x7f67e8000fb0) at /usr/include/c++/4.8.2/bits/unique_ptr.h:67
#14 0x00000000005e9a9f in std::unique_ptr<csync::SimpleMysqlClient, std::default_delete<csync::SimpleMysqlClient> >::~unique_ptr (this=0x7f67f4001230, __in_chrg=<optimized out>)
at /usr/include/c++/4.8.2/bits/unique_ptr.h:184
#15 0x00000000005e8ab8 in csync::CsyncDao::~CsyncDao (this=0x7f67f4001230, __in_chrg=<optimized out>) at /data/leopoldfreeman/workspace/syncservice/csync/project/csync/binlogsync/../dao/inc/csyncDao.h:14
#16 0x00000000005e8adc in std::default_delete<csync::CsyncDao>::operator() (this=0x7f67f4001210, __ptr=0x7f67f4001230) at /usr/include/c++/4.8.2/bits/unique_ptr.h:67
#17 0x00000000005e7423 in std::unique_ptr<csync::CsyncDao, std::default_delete<csync::CsyncDao> >::~unique_ptr (this=0x7f67f4001210, __in_chrg=<optimized out>)
at /usr/include/c++/4.8.2/bits/unique_ptr.h:184
#18 0x00000000005ee8af in csync::FileRecProvider::~FileRecProvider (this=0x7f67f4001160, __in_chrg=<optimized out>)
at /data/leopoldfreeman/workspace/syncservice/csync/project/csync/binlogsync/inc/fileRecProvider.h:16
#19 0x00000000005ee8ea in csync::FileRecProvider::~FileRecProvider (this=0x7f67f4001160, __in_chrg=<optimized out>)
at /data/leopoldfreeman/workspace/syncservice/csync/project/csync/binlogsync/inc/fileRecProvider.h:16
#20 0x00000000005d453f in csync::ProviderProxy::~ProviderProxy (this=0x7f67f4000e70, __in_chrg=<optimized out>)
at /data/leopoldfreeman/workspace/syncservice/csync/project/csync/binlogsync/src/providerProxy.cpp:43
#21 0x00000000005ced86 in std::default_delete<csync::ProviderProxy>::operator() (this=0x7f67f4001098, __ptr=0x7f67f4000e70) at /usr/include/c++/4.8.2/bits/unique_ptr.h:67
#22 0x00000000005ce606 in std::unique_ptr<csync::ProviderProxy, std::default_delete<csync::ProviderProxy> >::reset (this=0x7f67f4001098, __p=0x7f67f4000e70)
at /usr/include/c++/4.8.2/bits/unique_ptr.h:262
#23 0x00000000005cdbf4 in csync::BinlogProviderThread::run (this=0x7f67f4000fa0) at /data/leopoldfreeman/workspace/syncservice/csync/project/csync/binlogsync/src/binlogProviderThread.cpp:171
#24 0x000000000061a1ad in parrot::ThreadBase::entryFunc (this=0x7f67f4000fa0) at /data/leopoldfreeman/workspace/syncservice/csync/base/sys/src/threadBase.cpp:48
#25 0x000000000061cb55 in std::_Mem_fn<void (parrot::ThreadBase::*)()>::operator()<, void>(parrot::ThreadBase*) const (this=0x7f67f40012c8, __object=0x7f67f4000fa0)
at /usr/include/c++/4.8.2/functional:601
#26 0x000000000061caa5 in std::_Bind_simple<std::_Mem_fn<void (parrot::ThreadBase::*)()> (parrot::ThreadBase*)>::_M_invoke<0ul>(std::_Index_tuple<0ul>) (this=0x7f67f40012c0)
at /usr/include/c++/4.8.2/functional:1732
#27 0x000000000061c9ad in std::_Bind_simple<std::_Mem_fn<void (parrot::ThreadBase::*)()> (parrot::ThreadBase*)>::operator()() (this=0x7f67f40012c0) at /usr/include/c++/4.8.2/functional:1720
#28 0x000000000061c946 in std::thread::_Impl<std::_Bind_simple<std::_Mem_fn<void (parrot::ThreadBase::*)()> (parrot::ThreadBase*)> >::_M_run() (this=0x7f67f40012a8) at /usr/include/c++/4.8.2/thread:115
#29 0x00007f680a1a4220 in ?? () from /lib64/libstdc++.so.6
#30 0x00007f680a602dc5 in start_thread () from /lib64/libpthread.so.0
#31 0x00007f680990bced in clone () from /lib64/libc.so.6
How to repeat:
1. Write a simple client, and connect to server.
2. Use timeout to disconnect the connection.
3. Close the client.