How to test/troubshoot an extension (pylibconfig)?

G

Grant Edwards

I'm trying to use python bindings for libconfig. There appear to be
three very slightly different bindings:

http://code.google.com/p/python-libconfig/
http://wiki.github.com/cnangel/python-libconfig/
http://github.com/azeey/python-libconfig/

I'm using the latter with libconfig 1.4.5

http://www.hyperrealm.com/libconfig/

The python bindings appear to come with test cases, but I can't figure
out how to run them. From reading the Python docs, it would appear
that this should do something useful, but it doesn't:

$ python -m unittest pylibconfig

----------------------------------------------------------------------
Ran 0 tests in 0.000s


Trying to run the test script directory doesn't work either:

$ python tests/test.py
Traceback (most recent call last):
File "tests/test.py", line 8, in <module>
from x64.pylibconfig import Config
ImportError: No module named x64.pylibconfig

Importing the module seems to be OK, but creating an instance barfs:

Python 2.6.5 (release26-maint, Jun 22 2010, 12:58:11)
[GCC 4.3.4] on linux2
Type "help", "copyright", "credits" or "license" for more information.
*** glibc detected *** /usr/bin/python2.6: corrupted double-linked list: 0x08065c48 ***


Where to go from here?
 
G

Grant Edwards

I'm trying to use python bindings for libconfig. There appear to be
three very slightly different bindings:

http://code.google.com/p/python-libconfig/
http://wiki.github.com/cnangel/python-libconfig/
http://github.com/azeey/python-libconfig/

I'm using the latter with libconfig 1.4.5

http://www.hyperrealm.com/libconfig/
[...]

Importing the module seems to be OK, but creating an instance barfs:

Python 2.6.5 (release26-maint, Jun 22 2010, 12:58:11)
[GCC 4.3.4] on linux2
Type "help", "copyright", "credits" or "license" for more information.
*** glibc detected *** /usr/bin/python2.6: corrupted double-linked list: 0x08065c48 ***

Oops. Those Python bindings are for version 1.3.2 of libconfig (which
does work). They don't work with the current version of libconfig. I
guess it's time to figure out how boost works...
 
G

Grant Edwards

Oops. Those Python bindings are for version 1.3.2 of libconfig (which
does work). They don't work with the current version of libconfig.

I've stripped the python bindings down to a minimal point, and I've
decided there may be a memory corruption problem in the 1.4.5 version
of the library. Here's the current boost binding:

---------------------------------pylibconfig.cc------------------------------
#include <boost/python.hpp>
#include <libconfig.h++>

using namespace boost::python;
using namespace libconfig;

class pyConfig
{
public:
pyConfig()
{
config = new Config();
}

~pyConfig ()
{
delete config;
}

private:
Config *config;
};

BOOST_PYTHON_MODULE(pylibconfig)
{
class_<pyConfig>("Config");
}
---------------------------------pylibconfig.cc------------------------------


That builds without warnings and installs fine, but attempting to
actually create an instance of the class in Python causes a glibc
memory corruption message:

Python 2.6.5 (release26-maint, Jun 22 2010, 12:58:11)
[GCC 4.3.4] on linux2
Type "help", "copyright", "credits" or "license" for more information. *** glibc detected *** /usr/bin/python2.6: corrupted double-linked list: 0x08065c48 ***

Am I correct in concluding it has to be a memory corruption problem in
the library itself?
 
G

Grant Edwards

Python 2.6.5 (release26-maint, Jun 22 2010, 12:58:11)
[GCC 4.3.4] on linux2
Type "help", "copyright", "credits" or "license" for more information.*** glibc detected *** /usr/bin/python2.6: corrupted double-linked list: 0x08065c48 ***

Am I correct in concluding it has to be a memory corruption problem in
the library itself?

Nope. That problem was cause by having two versions of the library
installed -- one under /usr and the other under /usr/local.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,066
Latest member
VytoKetoReviews

Latest Threads

Top