From: Grant Edwards on
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.

>>> import pylibconfig

>>> conf = pylibconfig.Config()
*** glibc detected *** /usr/bin/python2.6: corrupted double-linked list: 0x08065c48 ***


Where to go from here?

--
Grant Edwards grant.b.edwards Yow! Do you like "TENDER
at VITTLES"?
gmail.com
From: Grant Edwards on
On 2010-07-07, Grant Edwards <invalid(a)invalid.invalid> wrote:

> 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.
>
> >>> import pylibconfig
>
> >>> conf = pylibconfig.Config()
> *** 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...

--
Grant Edwards grant.b.edwards Yow! ... I think I'd
at better go back to my DESK
gmail.com and toy with a few common
MISAPPREHENSIONS ...
From: Grant Edwards on
On 2010-07-07, Grant Edwards <invalid(a)invalid.invalid> wrote:

> 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.
>>> import pylibconfig
>>> conf = pylibconfig.Config()
*** 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?

--
Grant Edwards grant.b.edwards Yow! I want the presidency
at so bad I can already taste
gmail.com the hors d'oeuvres.
From: Grant Edwards on
On 2010-07-08, Grant Edwards <invalid(a)invalid.invalid> wrote:
> On 2010-07-07, Grant Edwards <invalid(a)invalid.invalid> wrote:
>
>> 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.

> 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.
> >>> import pylibconfig
> >>> conf = pylibconfig.Config()
> *** 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.

--
Grant Edwards grant.b.edwards Yow! Gee, I feel kind of
at LIGHT in the head now,
gmail.com knowing I can't make my
satellite dish PAYMENTS!