Hello I am trying to get libvirt-python working in Ubuntu 14.04 64 bit system. I tried installing the binaries from the repo itself: 1. root@test-vm8-109:/home/test# libvirtd --version libvirtd (libvirt) 1.2.2 root@test-vm8-109:/home/test# python Python 2.7.6 (default, Mar 22 2014, 22:59:56) [GCC 4.8.2] on linux2 Type "help", "copyright", "credits" or "license" for more information.>>> import libvirt >>> libvirt.__file__'/usr/lib/python2.7/dist-packages/libvirt.pyc'>>> c = libvirt.virConnect("lxc:///") >>> c.listAllDomains()Segmentation fault (core dumped) 2. Installing the latest libvirt-python from pypi (1.2.13) also has the same issue. This is the gdb bt of the core: [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". Core was generated by `python test.py'. Program terminated with signal SIGSEGV, Segmentation fault. #0 0x00007fd8d91b19a9 in virObjectIsClass () from /usr/lib/libvirt.so.0 (gdb) bt #0 0x00007fd8d91b19a9 in virObjectIsClass () from /usr/lib/libvirt.so.0 #1 0x00007fd8d9268d02 in virConnectListAllDomains () from /usr/lib/libvirt.so.0 #2 0x00007fd8d964db96 in libvirt_virConnectListAllDomains (self=<optimized out>, args=<optimized out>) at libvirt-override.c:2470 #3 0x000000000052c6d5 in PyEval_EvalFrameEx () #4 0x000000000055c594 in PyEval_EvalCodeEx () #5 0x000000000052ca8d in PyEval_EvalFrameEx () #6 0x000000000055c594 in PyEval_EvalCodeEx () #7 0x00000000005b7392 in PyEval_EvalCode () #8 0x0000000000469663 in ?? () #9 0x00000000004699e3 in PyRun_FileExFlags () #10 0x0000000000469f1c in PyRun_SimpleFileExFlags () #11 0x000000000046ab81 in Py_Main () #12 0x00007fd8da894ec5 in __libc_start_main (main=0x46ac3f <main>, argc=2, argv=0x7fff0fcbd218, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fff0fcbd208) at libc-start.c:287 #13 0x000000000057497e in _start () Am I missing something? Regards, Harish
Trying again. Is there another mailer list for libvirt-python related discussions? Regards, Harish On Thu, Mar 19, 2015 at 9:02 PM, Harish Vishwanath <harish.shastry@gmail.com> wrote:> Hello > > I am trying to get libvirt-python working in Ubuntu 14.04 64 bit system. I > tried installing the binaries from the repo itself: > > 1. > > root@test-vm8-109:/home/test# libvirtd --version > libvirtd (libvirt) 1.2.2 > root@test-vm8-109:/home/test# python > Python 2.7.6 (default, Mar 22 2014, 22:59:56) > [GCC 4.8.2] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> import libvirt > >>> libvirt.__file__ > '/usr/lib/python2.7/dist-packages/libvirt.pyc' > >>> c = libvirt.virConnect("lxc:///") > >>> c.listAllDomains() > Segmentation fault (core dumped) > > > 2. Installing the latest libvirt-python from pypi (1.2.13) also has the > same issue. > > > This is the gdb bt of the core: > > [Thread debugging using libthread_db enabled] > Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". > Core was generated by `python test.py'. > Program terminated with signal SIGSEGV, Segmentation fault. > #0 0x00007fd8d91b19a9 in virObjectIsClass () from /usr/lib/libvirt.so.0 > (gdb) bt > #0 0x00007fd8d91b19a9 in virObjectIsClass () from /usr/lib/libvirt.so.0 > #1 0x00007fd8d9268d02 in virConnectListAllDomains () from > /usr/lib/libvirt.so.0 > #2 0x00007fd8d964db96 in libvirt_virConnectListAllDomains > (self=<optimized out>, args=<optimized out>) > at libvirt-override.c:2470 > #3 0x000000000052c6d5 in PyEval_EvalFrameEx () > #4 0x000000000055c594 in PyEval_EvalCodeEx () > #5 0x000000000052ca8d in PyEval_EvalFrameEx () > #6 0x000000000055c594 in PyEval_EvalCodeEx () > #7 0x00000000005b7392 in PyEval_EvalCode () > #8 0x0000000000469663 in ?? () > #9 0x00000000004699e3 in PyRun_FileExFlags () > #10 0x0000000000469f1c in PyRun_SimpleFileExFlags () > #11 0x000000000046ab81 in Py_Main () > #12 0x00007fd8da894ec5 in __libc_start_main (main=0x46ac3f <main>, argc=2, > argv=0x7fff0fcbd218, > init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, > stack_end=0x7fff0fcbd208) > at libc-start.c:287 > #13 0x000000000057497e in _start () > > > Am I missing something? > > Regards, > Harish >
Hi Harish, I believe the proper establishment of a connection should be done by libvirt.open() or libvirt.openAuth() or libvirt.openReadOnly(). All of them will return a functional virConnect instance. I'm not sure this segfault is worth to fix since instantiate a virConnect directly is not an expected usage. Hope this information will help you. Best Regards, Hao Liu +86-010-62608262 ----- Original Message -----> From: "Harish Vishwanath" <harish.shastry@gmail.com> > To: "libvirt-users" <libvirt-users@redhat.com> > Sent: Friday, March 20, 2015 1:11:53 PM > Subject: Re: [libvirt-users] libvirt-python Segfaults > > Trying again. > > Is there another mailer list for libvirt-python related discussions? > > Regards, > Harish > > On Thu, Mar 19, 2015 at 9:02 PM, Harish Vishwanath < harish.shastry@gmail.com > > wrote: > > > > Hello > > I am trying to get libvirt-python working in Ubuntu 14.04 64 bit system. I > tried installing the binaries from the repo itself: > > 1. > > root@test-vm8-109:/home/test# libvirtd --version > libvirtd (libvirt) 1.2.2 > root@test-vm8-109:/home/test# python > Python 2.7.6 (default, Mar 22 2014, 22:59:56) > [GCC 4.8.2] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> import libvirt > >>> libvirt.__file__ > '/usr/lib/python2.7/dist-packages/libvirt.pyc' > >>> c = libvirt.virConnect("lxc:///") > >>> c.listAllDomains() > Segmentation fault (core dumped) > > > 2. Installing the latest libvirt-python from pypi (1.2.13) also has the same > issue. > > > This is the gdb bt of the core: > > [Thread debugging using libthread_db enabled] > Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". > Core was generated by `python test.py'. > Program terminated with signal SIGSEGV, Segmentation fault. > #0 0x00007fd8d91b19a9 in virObjectIsClass () from /usr/lib/libvirt.so.0 > (gdb) bt > #0 0x00007fd8d91b19a9 in virObjectIsClass () from /usr/lib/libvirt.so.0 > #1 0x00007fd8d9268d02 in virConnectListAllDomains () from > /usr/lib/libvirt.so.0 > #2 0x00007fd8d964db96 in libvirt_virConnectListAllDomains (self=<optimized > out>, args=<optimized out>) > at libvirt-override.c:2470 > #3 0x000000000052c6d5 in PyEval_EvalFrameEx () > #4 0x000000000055c594 in PyEval_EvalCodeEx () > #5 0x000000000052ca8d in PyEval_EvalFrameEx () > #6 0x000000000055c594 in PyEval_EvalCodeEx () > #7 0x00000000005b7392 in PyEval_EvalCode () > #8 0x0000000000469663 in ?? () > #9 0x00000000004699e3 in PyRun_FileExFlags () > #10 0x0000000000469f1c in PyRun_SimpleFileExFlags () > #11 0x000000000046ab81 in Py_Main () > #12 0x00007fd8da894ec5 in __libc_start_main (main=0x46ac3f <main>, argc=2, > argv=0x7fff0fcbd218, > init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, > stack_end=0x7fff0fcbd208) > at libc-start.c:287 > #13 0x000000000057497e in _start () > > > Am I missing something? > > Regards, > Harish > > > _______________________________________________ > libvirt-users mailing list > libvirt-users@redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-users