U++ framework
Do not panic. Ask here before giving up.

Home » U++ Library support » U++ MT-multithreading and servers » SSL server crash
Re: SSL server crash [message #33726 is a reply to message #33725] Thu, 08 September 2011 20:42 Go to previous messageGo to previous message
mirek is currently offline  mirek
Messages: 14291
Registered: November 2005
Ultimate Member
Zbych wrote on Thu, 08 September 2011 10:33

Hi,

I have a problem with a simple SSL server on linux. After connecting a few clients (for example 5), I start killing them one by one. Server should just close connections, but it crashes inside SetSockError:

void Socket::SetSockError(SOCKET socket, const char *context, int code, const char *errdesc)
{
	String err;
	errorcode = code;
	if(socket != INVALID_SOCKET)
		err << "socket(" << (int)socket << ") / ";
	err << context << ": " << errdesc;
	errordesc = err; //<------------ crash
	is_error = true;
	SetErrorText(err);
}


The question is what I am doing wrong? Maybe I shouldn't use vector in two different threads without protection?



Not sure if that is the cause, but you definitiely should NOT do client.Add in one thread and client.Remove in another, you need mutex serialization for that...

Mirek
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: A new function to Web Package Unicode-Escape-Javascript -> Unicode
Next Topic: Multi-Thread Critial Section Problem
Goto Forum:
  


Current Time: Wed Oct 07 01:54:45 GMT+2 2026

Total time taken to generate the page: 0.01031 seconds