On Tue, Mar 16, 2010 at 05:50:42PM +0100, Matthias Bolte wrote:
2010/3/16 Dan Kenigsberg <danken(a)redhat.com>:
> I was trying to learn how to use openAuth(uri, auth_cb, flags), and
> got:
>
> Python 2.6.2 (r262:71600, Jan 25 2010, 18:46:47)
> [GCC 4.4.2 20091222 (Red Hat 4.4.2-20)] on linux2
> Type "help", "copyright", "credits" or
"license" for more information.
>>>> import libvirt
>>>> libvirt.openAuth('qemu:///system', lambda x: None, 0)
> Segmentation fault (core dumped)
>
> I guess my lambda expression was not what libvirt expected, but still..
>
> Regards,
>
> Dan.
>
Yes, the python bindings lack proper input validation. If you pass
something unexpected it'll probably segfault.
I've started working on a patch that adds input validation to the
python bindings.
Until then, see examples/python/esxlist.py in the libvirt codebase for
the correct usage of the auth parameter in python.
Thanks.
Since I'm using qemu and trying sasl over unix domain, I've changed
uri = "qemu:///system"
and tried esxlist.py out (on Fedora 12, libvirt-0.7.2-1.fc12.x86_64).
I've got the following in /var/log/messages. Any guesses what went wrong?
Mar 21 18:47:01 myhost python: Bad IPLOCALPORT value
Mar 21 18:47:01 myhost python: abrt: detected unhandled Python exception in
/tmp/esxlist.py
Mar 21 18:47:01 myhost abrtd: Directory 'pyhook-1269190021-25439' creation
detected
Mar 21 18:47:01 myhost abrtd: Executable '/tmp/esxlist.py' doesn't belong to
any package
Mar 21 18:47:01 myhost abrtd: Corrupted or bad crash
/var/cache/abrt/pyhook-1269190021-25439 (res
:4), deleting
Mar 21 18:47:01 myhost abrt[25443]: saved python crash dump of pid 25439 to
/var/cache/abrt/pyhoo
k-1269190021-25439.new