python-lxc segfaults when calling get_ips()

Bug #1550912 reported by Evgeni Golov
22
This bug affects 3 people
Affects Status Importance Assigned to Milestone
ansible (Ubuntu)
Invalid
Undecided
Unassigned
lxc (Ubuntu)
Invalid
Undecided
Unassigned
python-lxc (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Ohai,

it seems liblxc broke ABI and python-lxc will segfault with something as simple as:
>>> import lxc
>>> c = lxc.Container(name='foo')
>>> c.get_ips()
Segmentation fault (core dumped)

It does not matter if the container "foo" actually exists, is running or not.
A rebuild helps.

Revision history for this message
Stéphane Graber (stgraber) wrote :

Hmm, that particular simple didn't move or change...

Revision history for this message
Stéphane Graber (stgraber) wrote :

I just tested here with using python3-lxc from trusty (LXC 1.0.8) to interact with liblxc1 2.0.0 calling get_ips, that worked fine.

root@athos:~# python3
Python 3.4.3 (default, Oct 14 2015, 20:28:29)
[GCC 4.8.4] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import lxc
>>> lxc.Container("jenkins01", "/var/lib/lxd/containers").get_ips()
('10.0.3.1', '172.17.20.37', '2607:f2c0:f00f:2720:216:3eff:fe12:99ae')
>>>

Downgrade python3-lxc:

root@athos:~# python3
Python 3.4.3 (default, Oct 14 2015, 20:28:29)
[GCC 4.8.4] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import lxc
>>> lxc.Container("jenkins01", "/var/lib/lxd/containers").get_ips()
('10.0.3.1', '172.17.20.37', '2607:f2c0:f00f:2720:216:3eff:fe12:99ae')
>>>

We did have an actual ABI break back around 1.1 but that was fixed and we absolutely intend to have our ABI be backward compatible.

Revision history for this message
Evgeni Golov (evgeni) wrote :

Interesting. Can you try python-lxc and lxc from Xenial? Or maybe python-lxc is just misscompiled for the break you had in 1.1?

Revision history for this message
Evgeni Golov (evgeni) wrote :

This also has been reported at https://github.com/lxc/python2-lxc/issues/8

Revision history for this message
Evgeni Golov (evgeni) wrote :

ping? this currently breaks Ansible's LXC support on 16.04

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in ansible (Ubuntu):
status: New → Confirmed
Changed in python-lxc (Ubuntu):
status: New → Confirmed
Revision history for this message
Stijn Tintel (stintel) wrote :

A simple rebuild of python-lxc solves this problem on 16.04. Please rebuild and push to repo.

Revision history for this message
Evgeni Golov (evgeni) wrote :

@stgraber, uhm, just noticed, you call python3. this report is about the python2 version :)

Revision history for this message
Stéphane Graber (stgraber) wrote :

Well, the report was initially reporting an ABI break, my python3 example was to show that it wasn't :)

Anyway, just pushed a no-change rebuild of python-lxc to Xenial now. Looking at the changelog, the previous rebuild indeed happened right after 1.1.0 which is when we had the accidental ABI break, 1.1.1 fixed this and so broke the newer symbols in python-lxc.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package python-lxc - 0.1-0ubuntu6

---------------
python-lxc (0.1-0ubuntu6) xenial; urgency=medium

  * No change rebuild for fixed LXC ABI.
    LXC 1.1.0 released with a minor accidental ABI break which was fixed
    very shortly afterwards (in 1.1.1), current python-lxc unfortunately got
    built against that broken ABI and now that the problem has been
    resolved, is itself breaking. (LP: #1550912)

 -- Stéphane Graber <email address hidden> Sat, 09 Apr 2016 09:29:34 -0400

Changed in python-lxc (Ubuntu):
status: Confirmed → Fix Released
Joshua Powers (powersj)
Changed in lxc (Ubuntu):
status: New → Invalid
Changed in ansible (Ubuntu):
status: Confirmed → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.