libmicrohttpd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [libmicrohttpd] unit tests using curl, openssl & multithreading


From: Cristian Constantin
Subject: Re: [libmicrohttpd] unit tests using curl, openssl & multithreading
Date: Fri, 8 Jun 2012 17:32:08 +0200
User-agent: Mutt/1.5.21 (2010-09-15)

On Thu, Jun 07, 2012 at 02:20:26PM +0200, Christian Grothoff wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> On 06/06/2012 12:27 PM, Cristian Constantin wrote:
> > hi!
> > 
> > the file:
> > 
> > libmicrohttpd/src/testcurl/https/tls_multi_thread_mode_test.c
> > 
> > tests multithreading capabilities of libmicrohttpd(+tls) with multiple 
> > threads
> > both on the client and on the server side.
> > 
> > the client side is implemented using curl+openssl. since I am getting
> > random crashes in:
> > 
> > sha1_block_data_order () / sha1-x86_64.s (part of openssl)
> > 
> > I am asking myself whether it has to do with (NOT using properly)
> > locking. I had a look and the openssl function which is supposed to
> > set up the locking callback, CRYPTO_set_locking_callback() is NOT used
> > explicitly when setting up curl/openssl.
> > 
> > what do you think?
> 
> Might be.  Some consider linking against OpenSSL from GPL/LGPL code to
> be a license violation, so usually MHD is used with libcurl/gnutls (and
> that's how I test).  In either case, as MHD cannot (and should not) know
> about OpenSSL, it is up to the application to do thread-initialization
> for libraries like OpenSSL.  So I suggest you add the respective calls
> to your application and see if that fixes the issues.

cristian: hi! I have added the mutexes and the callbacks for actually using
them to lock and unlock resources. I have tested for more than 12 hours
and I did not see the crash anylonger; so most likely this was the
problem.

now, as far as I see for properly fixing this, one needs to use
some conditional compilation based on which ssl flavor is used:
curl+openssl or curl+gnutls. m4/libcurl.m4 defines "LIBCURL_FEATURE_SSL"
but does not say which tls library libcurl was linked with...

let me know your oppinion on this.

bye now!
cristian
> 
> 
> Happy hacking!
> 
> Christian
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.10 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
> 
> iEYEARECAAYFAk/QnIoACgkQv2Bwi0hCbH7jwwCfYXQZBjZms2SYycRGGBP7+TgC
> EK4An2KdBbZoEhJLt5HfmoUL501u1rxl
> =zZZr
> -----END PGP SIGNATURE-----



reply via email to

[Prev in Thread] Current Thread [Next in Thread]