p11_library_mutex problems on W32
lrn1986 at gmail.com
Mon Apr 1 11:14:44 PDT 2013
-----BEGIN PGP SIGNED MESSAGE-----
p11-kit.exe crashed on me.
Tried to debug it, discovered that it crashes in p11_lock().
Debugged it further.
Turns out, the value gdb prints for &p11_library_mutex changes
depending on which part of the code it's in. It's one value inside
tool.c and any code called from the .exe file, and another in code
called from DllMain.
Then i've noticed that p11_library_mutex is not even exported, because
it doesn't match -export-symbols-regex. Renamed it to
p11_kit_library_mutex. Now it's exported, but p11-kit.exe doesn't
At this point i gave up and hacked a function-based interface to
p11_library_mutex. Then set a break point at p11_kit_library_mutex()
function i wrote - and discovered that even with functional interface
it has two versions of that function - one from the .exe, the other -
from the .dll (and, accordingly, breakpoint was set in 2 locations).
Looked up how p11-kit is linked and (oh, the horror!) discovered that
it's linked to libp11-library.a (statically, obviously). The very file
that does all these mutex-related things. And libp11-kit is linked to
it too. Statically. Which is how they get two versions of everything.
So...what to do? And what was your intention, exactly?
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (MingW32)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
-----END PGP SIGNATURE-----
More information about the p11-glue