Monday, September 10, 2012

Boost.Python: python: malloc(): smallbin double linked list corrupted

Today I ran into the following error when using boost.python to load C++ dynamic library:
python: malloc(): smallbin double linked list corrupted

Some googling indicate that kvm bug is the cause. However, I do not use kvm.
Finally, I find the problem:
The .so file for python would require use of another dynamic library which contains the actual implementation of the classes. However, the header file to compile the two .so files are unsynchronized, which leads to the statck corruption.

This is a lesson learned: don't use two versions of header files.

Thursday, December 1, 2011