1 |
Mark Haney posted on Fri, 28 Aug 2009 14:34:52 -0400 as excerpted: |
2 |
|
3 |
> I've just upgraded to 4.3.0 and I've got a question. On my 'taskbar', |
4 |
> if an app crashes (like Firefox just did trying to play a flash video) |
5 |
> I'm getting a 'button' on the taskbar of the app that just won't go |
6 |
> away. I have 2 currently, one from evolution and one from Firefox. |
7 |
> |
8 |
> Does anyone know how to make those go away? Is anyone else seeing this |
9 |
> problem? |
10 |
|
11 |
I haven't seen the problem and don't really know how to make them go away |
12 |
(well, I do if it's as I expect, but the cure is likely to be considered |
13 |
worse than the problem), but I think I know what's happening: |
14 |
|
15 |
Background: In Linux (and I'd suspect most Unixen tho I have no |
16 |
experience or knowledge other than Linux to back that up), every |
17 |
application has a parent. If the parent "disowns" the application, then |
18 |
the application's parent becomes init itself, init being the first |
19 |
userland application started by the kernel, with various functions... |
20 |
|
21 |
When an application terminates, the kernel keeps its context around so |
22 |
the parent can make use of various information from its former child |
23 |
process. When the parent is done, it (according to my understanding) |
24 |
tells the kernel it can clean up what's left, and that's when the rest of |
25 |
the process cleanup takes place, including release of any memory the |
26 |
process leaked and didn't properly release previously, etc. |
27 |
|
28 |
Processes that have terminated but that the parent process has not yet |
29 |
cleaned up are said to be "zombie" processes. Once in awhile, if you |
30 |
have the process status column displayed in top or (I think) ksysguard |
31 |
(aka system monitor, I said "I think" because I'm not sure ksysguard |
32 |
exposes that info, but I think it does, as an optional column), or if you |
33 |
enable a status option for ps, you'll see such zombie processes, normally |
34 |
marked with a "z". (FWIW, the most common status is sleeping, the |
35 |
application is waiting for something and is sleeping until it happens, |
36 |
this is normally denoted with "s".) |
37 |
|
38 |
Normally, zombies are reasonably rare, and don't show up often, because |
39 |
the state lasts only a very short period (fractions of a second) if the |
40 |
parent harvests its children and cleans up properly (telling the kernel |
41 |
it's OK to do so), but some processes aren't normally equipped to manage |
42 |
children as they don't expect to launch any, and thus don't harvest the |
43 |
zombies if for some reason they /do/ launch one. In other instances, the |
44 |
child may have terminated abnormally and for various reasons the parent |
45 |
isn't prepared to harvest what it was left with. |
46 |
|
47 |
Unfortunately, because the kernel can't clean up the zombies until the |
48 |
parent says it can, if the parent doesn't give permission, the zombies |
49 |
just sit there... until the parent itself terminates. |
50 |
|
51 |
That's therefore the way such zombies are ultimately cleaned up, the |
52 |
parent terminates and the zombies are cleaned up as the parent is cleaned |
53 |
up. But as I said, the cure may well be considered worse than the |
54 |
problem, if the parent is a critical part of X or KDE itself. In that |
55 |
case, to cleanup, you'd have to shutdown KDE (and/or X) and either |
56 |
continue at the text console or respawn *dm if you have a graphical X |
57 |
login manager. That's not always convenient, and unfortunately, it seems |
58 |
such zombies appear at the least convenient times. |
59 |
|
60 |
I'm not positive what you're seeing is zombie processes, but it does |
61 |
sound like it. Note that both of the apps in question are non-kde. KDE |
62 |
has it's own methods of dealing with kde apps that crash, but may not be |
63 |
prepared to cope with crashing gtk/gnome apps, which both firefox and |
64 |
evolution are. Ultimately, the easiest solution (certainly from KDE's |
65 |
perspective, the firefox and evolution devs I'm sure don't find it to |
66 |
easy or the problem wouldn't be occurring) is probably to fix those apps |
67 |
so they don't crash in the first place. |
68 |
|
69 |
-- |
70 |
Duncan - List replies preferred. No HTML msgs. |
71 |
"Every nonfree program has a lord, a master -- |
72 |
and if you use the program, he is your master." Richard Stallman |