After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 644402 - gnome-shell leaving gnome-control-center zombies
gnome-shell leaving gnome-control-center zombies
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: general
2.91.x
Other Linux
: Normal normal
: ---
Assigned To: Dan Winship
gnome-shell-maint
: 644548 644685 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2011-03-10 15:05 UTC by Jeff Layton
Modified: 2011-03-17 13:13 UTC
See Also:
GNOME target: 3.0
GNOME version: ---


Attachments
placeDisplay: Remove network places (2.00 KB, patch)
2011-03-10 18:44 UTC, Colin Walters
committed Details | Review
Remove broken ShellAppSystem API and all consumers (10.97 KB, patch)
2011-03-10 18:45 UTC, Colin Walters
needs-work Details | Review
Add shell_global_report_async_nonfatal() (5.30 KB, patch)
2011-03-15 23:10 UTC, Colin Walters
reviewed Details | Review
ShellApp: Report error when we fail to run an app (1.89 KB, patch)
2011-03-15 23:10 UTC, Colin Walters
committed Details | Review
Remove broken ShellAppSystem API and all consumers (10.42 KB, patch)
2011-03-15 23:10 UTC, Colin Walters
committed Details | Review

Description Jeff Layton 2011-03-10 15:05:45 UTC
Whenever I open the "System Settings" panel from the menu, gnome-shell spawns a gnome-control-center process. It never reaps the exit status from them however, so they end up as zombies:

jlayton   8094  8007  0 Mar09 ?        00:06:28 /usr/bin/gnome-shell
jlayton  11727  8094  0 Mar09 ?        00:00:00 [gnome-control-c] <defunct>
jlayton  11768  8094  0 Mar09 ?        00:00:00 [gnome-control-c] <defunct>
jlayton  16429  8094  0 Mar09 ?        00:00:01 [gnome-control-c] <defunct>
jlayton  16882  8094  0 Mar09 ?        00:00:00 [gnome-control-c] <defunct>
jlayton  18102  8094  0 Mar09 ?        00:00:00 [gnome-control-c] <defunct>
jlayton  18433  8094  0 Mar09 ?        00:00:00 [gnome-control-c] <defunct>
jlayton  18890  8094  0 Mar09 ?        00:00:00 [gnome-control-c] <defunct>
jlayton  23712  8094  0 09:23 ?        00:00:00 [gnome-control-c] <defunct>
Comment 1 Dan Winship 2011-03-10 16:54:34 UTC
This is because shell_app_info_launch_full() is passing G_SPAWN_DO_NOT_REAP_CHILD, and then not setting up a child watch.

Colin, why is it passing that flag?
Comment 2 Colin Walters 2011-03-10 17:25:30 UTC
(In reply to comment #1)
> This is because shell_app_info_launch_full() is passing
> G_SPAWN_DO_NOT_REAP_CHILD, and then not setting up a child watch.
> 
> Colin, why is it passing that flag?

Because we were expecting to find a ShellApp instance, and then _gather_pid_callback would eventually tell ShellWindowTracker to call g_child_watch_add.  But in this case we weren't finding the app, so it was NULL, and would cause a g_return_if_fail, and thus we'd never set up the watch.
Comment 3 Colin Walters 2011-03-10 18:44:33 UTC
Created attachment 183086 [details] [review]
placeDisplay: Remove network places

It hasn't existed in nautilus for a while now, and we don't
have places at all.
Comment 4 Colin Walters 2011-03-10 18:45:38 UTC
Created attachment 183087 [details] [review]
Remove broken ShellAppSystem API and all consumers

In commit 9bd22dc0, I introduced an API to load an arbitrary
.desktop file, not necessarily from the menu path.  It turns
out this function was broken because it created ShellApp instances
that were *different* from ones that were cached normally.

As far as I can tell, we didn't initially use it.  Then later
Util.spawnDesktop was created which used this function.

Remove this broken function and all callers; if we're loading
.desktop files from *outside* the menu path, we can look at
readding.

This patch also kills off Util.spawnDesktop in favor of callers
talking to ShellAppSystem directly - I'd much prefer we move
to reducing the number of layers here.

For example - application launching errors should really be handled
both more generically and better; the code should not live in util.js
to create a system notification. For now, simply logging an exception
to stderr (~/.xsession-errors) is probably fine, actually better even.
Comment 5 Owen Taylor 2011-03-11 22:36:14 UTC
Giving this to danw to review, don't really understand the logic of the utils.spawnDesktop removal. It was added to have a consistent way of launching and error handling throughout the code, and then we go back and don't have such a way? This doesn't seem to me to be progress. If we have some better way we think it should be done, then we should do it now, or live with the current code until we have time to do it. It also seems inappropriately in this patch - the patch looks like it could be split in two trivially.
Comment 6 Dan Winship 2011-03-12 16:41:49 UTC
*** Bug 644548 has been marked as a duplicate of this bug. ***
Comment 7 drago01 2011-03-14 09:13:17 UTC
*** Bug 644685 has been marked as a duplicate of this bug. ***
Comment 8 Dan Winship 2011-03-14 13:05:24 UTC
Comment on attachment 183087 [details] [review]
Remove broken ShellAppSystem API and all consumers

(In reply to comment #5)
> Giving this to danw to review, don't really understand the logic of the
> utils.spawnDesktop removal. It was added to have a consistent way of launching
> and error handling throughout the code, and then we go back and don't have such
> a way? This doesn't seem to me to be progress.

I agree. I made the same comment when Colin posted this to IRC.

>-        Util.spawnDesktop('gnome-datetime-panel');
>+        var app = Shell.AppSystem.get_default().get_app('gnome-datetime-panel.desktop');
>+        app.activate(-1);

also, it seems to me that even if it wasn't going to do error checking, it's still nicer to keep the utility method. Just change what spawnDesktop does internally. (If not, the 'var' should be 'let'.)

>     _onOpenCalendarActivate: function() {
>         this.menu.close();
>         // TODO: pass '-c calendar' (to force the calendar at startup)
>         // TODO: pass the selected day
>-        Util.spawnDesktop('evolution');

not sure why this hasn't been fixed to just use spawn() anyway...
Comment 9 Colin Walters 2011-03-14 14:38:15 UTC
Comment on attachment 183086 [details] [review]
placeDisplay: Remove network places

Attachment 183086 [details] pushed as f079501 - placeDisplay: Remove network places
Comment 10 Colin Walters 2011-03-15 23:10:27 UTC
Created attachment 183475 [details] [review]
Add shell_global_report_async_nonfatal()

Move the "system notification error" handling out of
util.js, and add it to ShellGlobal so we can start
calling it from across the codebase better (including
C).
Comment 11 Colin Walters 2011-03-15 23:10:33 UTC
Created attachment 183476 [details] [review]
ShellApp: Report error when we fail to run an app
Comment 12 Colin Walters 2011-03-15 23:10:40 UTC
Created attachment 183477 [details] [review]
Remove broken ShellAppSystem API and all consumers

In commit 9bd22dc0, I introduced an API to load an arbitrary
.desktop file, not necessarily from the menu path.  It turns
out this function was broken because it created ShellApp instances
that were *different* from ones that were cached normally.

As far as I can tell, we didn't initially use it.  Then later
Util.spawnDesktop was created which used this function.

Remove this broken function and all callers; if we're loading
.desktop files from *outside* the menu path, we can look at
readding.

This patch also kills off Util.spawnDesktop in favor of callers
talking to ShellAppSystem directly, now that the latter reports
errors.
Comment 13 Colin Walters 2011-03-15 23:20:13 UTC
(In reply to comment #8)
>
> >     _onOpenCalendarActivate: function() {
> >         this.menu.close();
> >         // TODO: pass '-c calendar' (to force the calendar at startup)
> >         // TODO: pass the selected day
> >-        Util.spawnDesktop('evolution');
> 
> not sure why this hasn't been fixed to just use spawn() anyway...

I thought we decided elsewhere that all uses of directly executing apps[1] should be via .desktop files, so in this case evolution should have (probably a NoDisplay=true) .desktop file to launch the calendar?

[1] By app I mean apps, not components like "gvfs-open"
Comment 14 Dan Winship 2011-03-16 15:26:01 UTC
Comment on attachment 183475 [details] [review]
Add shell_global_report_async_nonfatal()

I like the code, I don't like the name. "Async nonfatal what?" I'd call the method shell_global_report_error() and the signal report-error. Or "warning" if "error" implies "fatal" to you.
Comment 15 Dan Winship 2011-03-16 15:27:36 UTC
Comment on attachment 183476 [details] [review]
ShellApp: Report error when we fail to run an app

>+              msg = g_strdup_printf (_("Failed to launch '%s'"), shell_app_get_name (app));

freeze break and you need to update POTFILES.in
Comment 16 Dan Winship 2011-03-16 15:31:11 UTC
Comment on attachment 183477 [details] [review]
Remove broken ShellAppSystem API and all consumers

>-        Util.spawnDesktop('gnome-datetime-panel');
>+        var app = Shell.AppSystem.get_default().get_app('gnome-datetime-panel.desktop');
>+        app.activate(-1);

what I said before. It would be simpler to just change spawnDesktop() to do that, rather than adding all that boilerplate. But if you really must remove spawnDesktop(), fix the "var"s to be "let"s.
Comment 17 Colin Walters 2011-03-16 15:39:36 UTC
(In reply to comment #14)
> (From update of attachment 183475 [details] [review])
> I like the code, I don't like the name. "Async nonfatal what?" I'd call the
> method shell_global_report_error() and the signal report-error. Or "warning" if
> "error" implies "fatal" to you.

Well...it's tricky because "warning" and "error" are both overloaded with the programming level ones (g_warning, g_error).  Practically speaking those end up as random crud in ~/.xsession-errors, and I want to distinguish this method from those.  How about _report_async_nonfatal_problem?
Comment 18 Dan Winship 2011-03-16 16:59:55 UTC
"async" is also pretty overloaded, and I don't think we need it in the name of this method. (I'd leave out "nonfatal" too... I think it should generally be assumed that most methods *won't* exit/abort/etc.)

"notify" might be better than "report" to distinguish from "dump into .xsession-errors where no one will ever see it". (And since it does actually use the notification mechanism.)
Comment 19 Colin Walters 2011-03-16 19:06:40 UTC
Attachment 183476 [details] pushed as 4bf1df0 - ShellApp: Report error when we fail to run an app
Attachment 183477 [details] pushed as fea8b6d - Remove broken ShellAppSystem API and all consumers
Comment 20 Matthias Clasen 2011-03-17 11:40:57 UTC
Whats left here ?
Comment 21 Dan Winship 2011-03-17 13:13:20 UTC
nothing