Crash in testImportKeyring (test_gpghandler) causes test failures
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Launchpad itself |
Fix Released
|
Medium
|
James Henstridge |
Bug Description
testImportKeyring causes a crash on some systems with the following message:
*** glibc detected *** double free or corruption (!prev): 0x08e15440 ***
Abort
The crash does not occur on every machine but is occurring on the new PQM machine, preventing merges.
The stack traces for the crash is caused by cleaning up the state for an op_keylist() operation when freeing a GPGME context. In particular, it is freeing a GPGME key object.
The Pyme wrapper for GPGME is a fairly primitive swig wrapper, and it appears to have many memory management issues (although most of the places I looked seem like they would cause leaks rather than double-frees).
Since no proper destructors are registered for things like gpgme_key_t, swig may free instances with free() if it thinks that the Python wrapper owns the underlying C instance. This is quite possibly the cause of the bug, since gpgme_key_t looks like it is supposed to be reference counted.
Fixing the memory management is quite an involved job, and would likely involve rewriting portions of the code.
One option to consider would be to identify the portions of the gpgme API we use, and creating a new binding that initially only covers those portions.
Changed in launchpad: | |
status: | New → Accepted |
So do you suggest 2 options: rewrite part of the pyme or write our own gpgme python wrapper.
Personnaly I'd suggest the first. May we collect some experience and or efforts from upstream maintainer (Igor) before decide ?