help-gnutls
[Top][All Lists]
Advanced

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

Re: Assertion failure and access violation error in gnutls


From: Nikos Mavrogiannopoulos
Subject: Re: Assertion failure and access violation error in gnutls
Date: Tue, 01 Feb 2011 18:55:15 +0100
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.13) Gecko/20101208 Thunderbird/3.1.7

On 02/01/2011 08:59 AM, address@hidden wrote:
> Hello,
> 
> I am writing a proxy code for windows based clients. The browser connects
> to the HTTP proxy via localhost and port. The proxy initiates the tls
> session between the client proxy and backend server. The handshake happens
> between the client proxy and backend server and encrypted data flows. The
> browser only receives and sends non-encrypted data to and from client
> proxy.
> The client proxy uses libgnutls for tls functionality which internally
> uses libgcrypt.
> 1. Assertion failed in file ath.c line 193. Expression:
*lock==MUTEX_Unlocked

The problems you describe are due to memory corruption due to
lack of locks. I'd suggest the you try the implicit pthread locks
as in:
http://www.gnu.org/software/gnutls/manual/html_node/Multi_002dthreaded-applications.html

(the git version of gnutls uses that, and allows overriding it, if
required).

> int main()
> {
>       if(!g_thread_supported())
>               g_thread_init (NULL);
>       gcry_control(GCRYCTL_SET_THREAD_CBS, &gcry_gthreads_cbs);

>       gcry_control (GCRYCTL_SUSPEND_SECMEM_WARN);
>       gcry_control (GCRYCTL_INIT_SECMEM, 16384, 0);
>       gcry_control (GCRYCTL_RESUME_SECMEM_WARN);
>       gcry_control (GCRYCTL_INITIALIZATION_FINISHED, 0);
Why do you use this stuff?

> The library used for threading is glib. But this also has not resolved the
> problem. Am i doing something wrong during initialization?

I don't see anything obvious, but since you still have the problem
there is something there.

> 
> 2. The second problem I am facing is "access violation reading location"
> in gnutls_handshake(). Sometimes during handshake the debugger stops and
> tells unhandeled exception in clientproxy.exe; access violation reading
> location 0x..... I have no idea how to resolve this. So, please can
> someone help??

If you have a threading issue it is normal to expect memory corruption.
First solve the issue with threads and later check that. If you want
to debug this kind of errors, I'd suggest valgrind.

regards,
Nikos



reply via email to

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