[collectd] Ohhhh jeeee, libgcrypt 1.4.1 + collectd 4.7.2

Sebastian Harl sh at tokkee.org
Mon Aug 31 20:06:23 CEST 2009

Hi Luke,

On Mon, Aug 31, 2009 at 10:31:30AM -0700, Luke Heberling wrote:
> On Monday 31 August 2009 09:03:37 Sebastian Harl wrote:
> > Hrm … from a quick look at the libcrypt documentation I suppose we need
> > to call gcry_control() using the 'GCRYCTL_INIT_SECMEM' command to
> > explicitly initialize the secure memory. Sounds like this was required
> > in libgcrypt 1.4.1 but is handled automatically in later versions.
> also looks like there's some special initialization necessary for threads. I 
> doubt that this is handled by the new default behavior in 1.4.4. Don't know 
> that it's truly necessary if the network plugin is the only plugin using 
> gcrypt.

Well, the 'network' plugin may be accessed from multiple threads (by
using its 'write' callback), so, yes, we need that. Nice catch!

> Here's a patch that works for me with 1.4.1.
> I followed an example for pthread initialization and  initialized gcry to 32k, 
> only since that's apparently the default that's used in 1.4.3.

It might even make sense to make that configurable (I'm thinking about
people who've complained about "large" amounts of VM being allocated).

> I did it in network.c's module_register function. Kind of an abuse, I
> know.

I think this could safely be moved to the plugin's init function. The
sockets are set up there as well, so gcrypt should not be used before
the plugin has been initialized. Florian, did I miss anything?


Sebastian "tokkee" Harl +++ GnuPG-ID: 0x8501C7FC +++ http://tokkee.org/

Those who would give up Essential Liberty to purchase a little Temporary
Safety, deserve neither Liberty nor Safety.         -- Benjamin Franklin

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: Digital signature
Url : http://mailman.verplant.org/pipermail/collectd/attachments/20090831/f0126964/attachment.pgp 

More information about the collectd mailing list