gnutls_handshake crash on multithreading

Vasiliy Ivanov vivanov at te.net.ua
Tue Feb 16 20:46:54 CET 2010


No, it's my own structure(see below).
It works at program start, but no methods are called at gnutls_handshake processing.

static int boost_mutex_init(void **priv)
{
	boost::mutex *lock = new boost::mutex();
	if (!lock)
		return ENOMEM;
	*priv = lock;
	return 0;
}

static int boost_mutex_destroy(void **lock)
{
	delete reinterpret_cast<boost::mutex*>(*lock);
	return 0;
}

static int boost_mutex_lock(void **lock)
{
	reinterpret_cast<boost::mutex*>(*lock)->lock();
	return 0;
}

static int boost_mutex_unlock(void **lock)
{
	reinterpret_cast<boost::mutex*>(*lock)->unlock();
	return 0;
}
//static struct gcry_thread_cbs gcry_threads_other;
static struct gcry_thread_cbs gcry_threads_boost =
{ 
	GCRY_THREAD_OPTION_USER, 
	NULL,
	boost_mutex_init, 
	boost_mutex_destroy,
	boost_mutex_lock, 
	boost_mutex_unlock
};



-----Original Message-----
From: tlillqvist at gmail.com [mailto:tlillqvist at gmail.com] On Behalf Of Tor Lillqvist
Sent: Tuesday, February 16, 2010 3:03 PM
To: Vasiliy Ivanov
Cc: Simon Josefsson; bug-gnutls at gnu.org
Subject: Re: gnutls_handshake crash on multithreading

>                gcry_control( GCRYCTL_SET_THREAD_CBS, 
> &gcry_threads_boost );

> I use .dll with .lib file linked.

Where does gcry_threads_boost come from, if from a DLL are you sure it is imported correctly?

--tml






More information about the Gnutls-devel mailing list