[Help-gnutls] multiple "gnutlses" in single binary

Nikos Mavrogiannopoulos nmav at gnutls.org
Fri Jun 20 17:54:45 CEST 2008


Arkadiusz Miskiewicz wrote:
> Hello,
> 
> Take a look at this example. 
> 
> There is one program (let be it php interpreter) that is able to load external 
> modules (so modules).
> Now we have two external modules - curl and postgresql [1]. Assume both curl 
> and postgresql use external libraries (libcurl and libpq) that internally 
> also use gnutls.
> Both these libraries initialize and deinitialize gnutls on it's own. 
> Separately they work fine.
> Now it php loads them both at the same time then gnutls initialization happens 
> twice (once called by curl module and second time by postgres module) and the 
> same happens for deinitialization. In openssl for example double deinit 
> causes segfault and is now allowed (a real problem with php + modules btw).
> How things look in gnutls? I assume init/deinit also can't be called multiple 
> times safely, right?

No there is no problem as long as they are called in a thread safe way.

regards,
Nikos





More information about the Gnutls-help mailing list