globals in global.c

Ian Goldberg linux at
Fri Nov 4 03:55:59 CET 2005

So we've run into an interesting problem.

gaim can load plugins (.so files).  Two of those plugins,
and, use libgcrypt.

They each call gcry_set_allocation_handler().  [You can see where this is

Of course, only the last one "wins", and both plugins are now using
the last one's allocation handlers.

But worse, at quitting time, if the plugin that "won" is unloaded first,
the global free_func and friends now point to addresses *no longer in
memory*.  The other plugin still has its cleanup to do, and calls
functions in libgcrypt, causing a crash.

Any idea how one might work around this problem?  I suppose linking
libgcrypt *staticly* into the plugin .so might work, at the expense of,
well, the static linking.


   - Ian

More information about the Gcrypt-devel mailing list