Paul Salters | 15 May 2012 09:54
Picon

Problem with libgcrypt maybe because of libgnutls

Dear mailinglist members,

I have an problem with my application. My application is using the
xmlrpc-c library (http://xmlrpc-c.sourceforge.net/) that library is
using the curl library which is using the gnutls library which is
using libgcrypt. (So far so good?)

My application is multi-threaded most of the time it runs fine but
sometimes i get the following error message: ""ath.c:193:
_gcry_ath_mutex_lock: Assertion '*lock == ((ath_mutex_t) 0)' failed".
Of course I have checked if the different library's are thread safe.
All claim to be thread safe. Also i have asked the xmlrpc-c developer
if he saw this problem before. But unfortunately he did not see this
problem before. I have searched Google and it looks like it's a
problem with libgcrypt. This error message can be found at curl
mailinglists and other mailinglists but that is from an few years ago.
So maybe this is an other problem?

I have posted the same question at the curl mailinglist but I think it
has maybe something to do with the libgnutls version in combination
with the libgcrypt version. But I am not that experienced c(++)
developer (in fact I am a student). So I hope you can point me in the
right direction.

I am using Debian stable as my OS. Which has the following versions installed.

xmlrpc-c: 1.25.15
libcurl4-gnutls-dev: 7.21.0-2.1+squeeze2
libgnutls-dev: 2.8.6-1+squeeze2
libgcrypt11-dev (1.4.5-2)
(Continue reading)

Nikos Mavrogiannopoulos | 16 May 2012 11:18

Re: Problem with libgcrypt maybe because of libgnutls

On Tue, May 15, 2012 at 9:54 AM, Paul Salters <psalters <at> gmail.com> wrote:
> Dear mailinglist members,
>
> I have an problem with my application. My application is using the
> xmlrpc-c library (http://xmlrpc-c.sourceforge.net/) that library is
> using the curl library which is using the gnutls library which is
> using libgcrypt. (So far so good?)

Hello,
 Libgcrypt requires mutex locks to be setup by the end application. I
don't know if curl does it already for you, but if it doesn't you
should set them up.
If you use gnutls 2.12.0 or later you need not to perform any of these
actions because the system mutexes are used by default.

regards,
Nikos
Paul Salters | 16 May 2012 11:33
Picon

Re: Problem with libgcrypt maybe because of libgnutls

On 16 May 2012 11:18, Nikos Mavrogiannopoulos <nmav <at> gnutls.org> wrote:
> On Tue, May 15, 2012 at 9:54 AM, Paul Salters <psalters <at> gmail.com> wrote:
>> Dear mailinglist members,
>>
>> I have an problem with my application. My application is using the
>> xmlrpc-c library (http://xmlrpc-c.sourceforge.net/) that library is
>> using the curl library which is using the gnutls library which is
>> using libgcrypt. (So far so good?)
>
> Hello,
>  Libgcrypt requires mutex locks to be setup by the end application. I
> don't know if curl does it already for you, but if it doesn't you
> should set them up.
> If you use gnutls 2.12.0 or later you need not to perform any of these
> actions because the system mutexes are used by default.
>
> regards,
> Nikos

Thank you for answer!

I have add the following lines of code to my application.

GCRY_THREAD_OPTION_PTHREAD_IMPL;
gcry_control (GCRYCTL_SET_THREAD_CBS, &gcry_threads_pthread);
gnutls_global_init();

But the error still remains.

Regards,
(Continue reading)

Nikos Mavrogiannopoulos | 16 May 2012 11:44

Re: Problem with libgcrypt maybe because of libgnutls

On Wed, May 16, 2012 at 11:33 AM, Paul Salters <psalters <at> gmail.com> wrote:

> Thank you for answer!
> I have add the following lines of code to my application.
> GCRY_THREAD_OPTION_PTHREAD_IMPL;
> gcry_control (GCRYCTL_SET_THREAD_CBS, &gcry_threads_pthread);
> gnutls_global_init();
> But the error still remains.

In that case you may have to debug the issue further and see why the
locks were not initialized and discuss with the libgcrypt guys. We
have dropped support of libgcrypt in our new releases, so what I can
do is to suggest that you use gnutls 2.12.x or even 3.0.x that do not
have such requirements.

regards,
Nikos
Paul Salters | 16 May 2012 11:48
Picon

Re: Problem with libgcrypt maybe because of libgnutls

On 16 May 2012 11:44, Nikos Mavrogiannopoulos <nmav <at> gnutls.org> wrote:
> In that case you may have to debug the issue further and see why the
> locks were not initialized and discuss with the libgcrypt guys. We
> have dropped support of libgcrypt in our new releases, so what I can
> do is to suggest that you use gnutls 2.12.x or even 3.0.x that do not
> have such requirements.
>
> regards,
> Nikos

Ok. I have posted the message on the libgcrypt mailinglist. Nice to
hear that I am not doing anything wrong :) I have tested my
application with newer versions of your lib. And that works indeed
perfectly.  But I would like to use this version because I am using
Debian stable.

Thank you for your help!

Regards,

Paul Salters

Gmane