Apps are not terminating correctly when using LXC based containers

Bug #1558588 reported by Andrea Bernabei
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Libertine
Status tracked in Devel
Devel
Fix Released
High
Christopher Townsend
Trunk
Fix Released
High
Christopher Townsend
libertine (Ubuntu)
Fix Released
High
Christopher Townsend

Bug Description

Environment:
Xenial 16.04

ii liblxc1 2.0.0~rc10-0ubuntu2 amd64 Linux Containers userspace tools (library)
rc lxc 1.1.4-0ubuntu1.1 amd64 Linux Containers userspace tools
ii lxc-common 2.0.0~rc10-0ubuntu2 amd64 Linux Containers userspace tools (common tools)
ii lxc-templates 2.0.0~rc10-0ubuntu2 amd64 Linux Containers userspace tools (templates)
ii lxc1 2.0.0~rc10-0ubuntu2 amd64 Linux Containers userspace tools
ii lxcfs 2.0.0~rc5-0ubuntu1 amd64 FUSE based filesystem for LXC
ii python3-libertine-lxc 0.99.11+16.04.20160302-0ubuntu1-0~181+201603151607~ubuntu16.04.1 amd64 Python3 scripts for the Libertine application sandbox
ii python3-lxc 2.0.0~rc10-0ubuntu2 amd64 Linux Containers userspace tools (Python 3.x bindings)
pc unity8-lxc 1.0.5-0~79~201510271721~ubuntu15.04.1 all Unity8 LXC integration

How to reproduce:
1) Create an LXC container following https://wiki.ubuntu.com/Touch/Libertine
2) install gedit
3) Launch gedit
4) close gedit
5) launch it again

Expected outcome:
Gedit runs

Actual outcome:
Gedit only runs exactly once every 2 tries. I run, then close, then run again, no luck, I only get the spinner.
It doesn't matter how long I wait between runs, the first time it runs, the second it fails, the third it runs again.

unity8.log of a failed run:
http://pastebin.ubuntu.com/15407433/

Related branches

Revision history for this message
Andrea Bernabei (faenil) wrote :

log of a successful run:
http://pastebin.ubuntu.com/15407908/

It seems Unity8 believes that the app is still running even though it's not.

Here's what happens when I close the RUNNING app, then wait a bit, then start it again (and it fails):
http://pastebin.ubuntu.com/15407927/

Revision history for this message
Christopher Townsend (townsend) wrote :

Hi Andrea,

Could you provide the output of ps -aef after you kill the app the first time? Seems things aren't getting cleaned up correctly, but I'd like to make sure.

Thanks!

Revision history for this message
Andrea Bernabei (faenil) wrote :

While running
➜ ~ ps -aef | grep gedit
design 4915 3538 0 17:54 ? 00:00:00 /usr/bin/python3 /usr/bin/libertine-launch libertine-test gedit
design 4920 4915 2 17:54 ? 00:00:00 Xmir -title @ -displayfd 3 -mir libertine-test_gedit_0.0
100000 5345 4915 0 17:54 ? 00:00:00 sudo -E -u design gedit
design 5346 5345 0 17:54 ? 00:00:00 gedit

After closing
➜ ~ ps -aef | grep gedit
design 4915 3538 0 17:54 ? 00:00:00 /usr/bin/python3 /usr/bin/libertine-launch libertine-test gedit

Revision history for this message
Christopher Townsend (townsend) wrote :

Ok, seems part of the process tree is hanging around. For my reproduction efforts, are you closing by pressing the "X" on the window or going to File->Quit in Gedit?

Thanks!

Changed in libertine:
status: New → Triaged
importance: Undecided → High
Revision history for this message
Andrea Bernabei (faenil) wrote :

X on the window :)

Revision history for this message
Christopher Townsend (townsend) wrote :

Thanks! Ok, I can definitely reproduce. On to debugging...

summary: - Gedit starts exactly once every two attempts
+ Apps are not terminating correctly when using LXC based containers
Changed in libertine:
assignee: nobody → Christopher Townsend (townsend)
Changed in libertine (Ubuntu):
status: New → Triaged
importance: Undecided → High
Revision history for this message
Libertine CI Bot (libertine-ci-bot) wrote :

Fix committed into lp:libertine at revision 182, scheduled for release in libertine, milestone Unknown

Changed in libertine:
status: In Progress → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package libertine - 0.99.12+16.04.20160321-0ubuntu1

---------------
libertine (0.99.12+16.04.20160321-0ubuntu1) xenial; urgency=medium

  [ Chris Townsend ]
  * Enable feature to add and remove extra archives in the container. This is
    for PPA's only right now. (LP: #1541901)
  * When killing processes in the container, need to wait() after terminating
    processes and to actually terminate and wait() on the main process. Caused
    app launching issues in LXC based containers. (LP: #1558588)

  [ Stephen M. Webb ]
  * add multiarch support to chroot containers too. (LP: #1556303)

  [ CI Train Bot ]
  * No-change rebuild.

 -- Christopher Townsend <email address hidden> Mon, 21 Mar 2016 12:59:04 +0000

Changed in libertine (Ubuntu):
status: Triaged → Fix Released
Changed in libertine (Ubuntu):
assignee: nobody → Christopher Townsend (townsend)
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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