Comment 31 for bug 1303676

Revision history for this message
Chris Coulson (chrisccoulson) wrote :

Following on from Jamie's comments, I'm just going to braindump what else we discovered is happening yesterday:

1) appmgr sends SIGSTOP to the process group for the webapp-container
2) The low memory killer comes along and kills the process group leader
3) appmgr considers the app closed, and never continues the remaining processes in their process group, leaving them around forever.

Normally when a process group becomes orphaned and it contains processes that are stopped, the kernel automatically sends SIGHUP and then SIGCONT to all remaining processes in that group. This is sufficient to ensure all remaining processes in the group are cleaned up, and I've verified this is the case on the desktop and the device when launching webbrowser-app manually from a terminal.

However, applications started by Upstart get their own session (thanks to Tyler for spotting this), with the session leader being webbrowser-app (or whatever app you're launching). The process group of the session leader is already orphaned by definition*, and so when the group (and session) leader is killed, the kernel will never send SIGHUP and SIGCONT to the remaining stopped processes.

*A process group is orphaned if the parent of every member is either within the process group or outside of the session.