>Debug.ListCallStack /T:No /ShowByteOffset:No /ShowValues:No /ShowExternalCode:Yes
|
Index Function
|
--------------------------------------------------------------------------------
|
1 ntdll.dll!_ZwWaitForSingleObject@12()
|
2 mswsock.dll!_SockWaitForSingleObject@16()
|
3 mswsock.dll!_WSPRecv@36()
|
4 ws2_32.dll!_recv@16()
|
*5 mysqld.exe!yaSSL::Socket::wait()
|
6 mysqld.exe!yaSSL::DoProcessReply(ssl)
|
7 mysqld.exe!yaSSL::processReply(ssl)
|
8 mysqld.exe!yaSSL::receiveData(ssl, data, peek)
|
9 mysqld.exe!yaSSL_peek(ssl, buffer, sz)
|
10 mysqld.exe!yaSSL_pending(ssl)
|
11 mysqld.exe!vio_ssl_has_data(vio)
|
12 mysqld.exe!threadpool_process_request(thd)
|
13 mysqld.exe!io_completion_callback(instance, context, overlapped, io_result, nbytes, io)
|
|
---------------------------------------------------------------------------------
|
1 mysqld.exe!vio_read(vio, buf, size)
|
2 mysqld.exe!yassl_recv(ptr, buf, len, flag)
|
3 mysqld.exe!yaSSL::Socket::receive(buf, sz, flags)
|
4 mysqld.exe!yaSSL::DoProcessReply(ssl)
|
5 mysqld.exe!yaSSL::processReply(ssl)
|
6 mysqld.exe!yaSSL::receiveData(ssl, data, peek)
|
7 mysqld.exe!yaSSL_peek(ssl, buffer, sz)
|
8 mysqld.exe!yaSSL_pending(ssl)
|
9 mysqld.exe!vio_ssl_has_data(vio)
|
10 mysqld.exe!threadpool_process_request(thd)
|
11 mysqld.exe!io_completion_callback(instance, context, overlapped, io_result, nbytes, io)
|
The actual reason why the connection is lost seems to be a bug in yassl's implementation of SSL_pending(), which is called inside vio_ssl_has_data().
The socket is doing blocking recv() inside this function, and runs into net_read_timeout after a while. After that, connection breaks.
Doing blocking reads inside vio_ssl_has_data (or SSL_pending) does not sound like a great idea.
Below is the callstack of the blocking recv() calls
>Debug.ListCallStack /T:No /ShowByteOffset:No /ShowValues:No /ShowExternalCode:Yes
Index Function
--------------------------------------------------------------------------------
1 ntdll.dll!_ZwWaitForSingleObject@12()
2 mswsock.dll!_SockWaitForSingleObject@16()
3 mswsock.dll!_WSPRecv@36()
4 ws2_32.dll!_recv@16()
*5 mysqld.exe!yaSSL::Socket::wait()
6 mysqld.exe!yaSSL::DoProcessReply(ssl)
7 mysqld.exe!yaSSL::processReply(ssl)
8 mysqld.exe!yaSSL::receiveData(ssl, data, peek)
9 mysqld.exe!yaSSL_peek(ssl, buffer, sz)
10 mysqld.exe!yaSSL_pending(ssl)
11 mysqld.exe!vio_ssl_has_data(vio)
12 mysqld.exe!threadpool_process_request(thd)
13 mysqld.exe!io_completion_callback(instance, context, overlapped, io_result, nbytes, io)
---------------------------------------------------------------------------------
1 mysqld.exe!vio_read(vio, buf, size)
2 mysqld.exe!yassl_recv(ptr, buf, len, flag)
3 mysqld.exe!yaSSL::Socket::receive(buf, sz, flags)
4 mysqld.exe!yaSSL::DoProcessReply(ssl)
5 mysqld.exe!yaSSL::processReply(ssl)
6 mysqld.exe!yaSSL::receiveData(ssl, data, peek)
7 mysqld.exe!yaSSL_peek(ssl, buffer, sz)
8 mysqld.exe!yaSSL_pending(ssl)
9 mysqld.exe!vio_ssl_has_data(vio)
10 mysqld.exe!threadpool_process_request(thd)
11 mysqld.exe!io_completion_callback(instance, context, overlapped, io_result, nbytes, io)