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 687074 - don't mutilate the shared session bus
don't mutilate the shared session bus
Status: RESOLVED FIXED
Product: gvfs
Classification: Core
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Tomas Bzatek
gvfs-maint
Depends on:
Blocks: 681887
 
 
Reported: 2012-10-28 22:56 UTC by Matthias Clasen
Modified: 2012-11-08 09:05 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
proxy volume monitor: Don't disable exit_on_close on session bus (986 bytes, patch)
2012-10-31 13:43 UTC, Tomas Bzatek
committed Details | Review
proxy volume monitor: Get session bus on demand (6.25 KB, patch)
2012-10-31 13:51 UTC, Tomas Bzatek
committed Details | Review

Description Matthias Clasen 2012-10-28 22:56:14 UTC
This code in gproxyvolumemonitor.c is evil:

  the_session_bus = g_bus_get_sync (G_BUS_TYPE_SESSION, NULL, &error);
  if (error != NULL)
    {
      g_printerr ("cannot connect to the session bus: %s (%s, %d)\n",
                  error->message, g_quark_to_string (error->domain), error->code);
      g_error_free (error);
      goto out;
    }
  g_dbus_connection_set_exit_on_close (the_session_bus, FALSE);


It changes the exit-on-close behaviour of the shared session bus connection.
I just spent a few hours tracking down why tracker-miner-fs is not dying when its session bus connection goes away - this is why.


g_proxy_volume_monitor_teardown_session_bus_connection looks evil too - it closes the shared session bus connection, which is equally bad.

Finally, Colin points out that we should probably remove the g_getenv ("DBUS_SESSION_BUS_ADDRESS") and patch callers to setenv (GIO_USE_VFS=local)
Comment 1 Tomas Bzatek 2012-10-31 13:43:27 UTC
Created attachment 227729 [details] [review]
proxy volume monitor: Don't disable exit_on_close on session bus

(In reply to comment #0)
> This code in gproxyvolumemonitor.c is evil:
> 
>   the_session_bus = g_bus_get_sync (G_BUS_TYPE_SESSION, NULL, &error);
>   if (error != NULL)
>     {
>       g_printerr ("cannot connect to the session bus: %s (%s, %d)\n",
>                   error->message, g_quark_to_string (error->domain),
> error->code);
>       g_error_free (error);
>       goto out;
>     }
>   g_dbus_connection_set_exit_on_close (the_session_bus, FALSE);
> 
> 
> It changes the exit-on-close behaviour of the shared session bus connection.
> I just spent a few hours tracking down why tracker-miner-fs is not dying when
> its session bus connection goes away - this is why.

Agree, this is evil. Again a leftover from the old code where it was working in a different way.

I've checked the rest of the code, this is the last occurence, only fuse daemon requires the call since it's wrapped in a fuse mainloop.
Comment 2 Tomas Bzatek 2012-10-31 13:51:08 UTC
Created attachment 227730 [details] [review]
proxy volume monitor: Get session bus on demand

(In reply to comment #0)
> g_proxy_volume_monitor_teardown_session_bus_connection looks evil too - it
> closes the shared session bus connection, which is equally bad.

This patch changes the way session bus is connected to. Instead of connect & use as global/static instance, let's keep the work on proxies. This also changes the way we report errors, instead of explicit connect attempt on module load and reporting error immediately, we keep error reporting on proxies. Shouldn't make any difference.

At the end, g_proxy_volume_monitor_teardown_session_bus_connection() was renamed to g_proxy_volume_monitor_unload_cleanup().
Comment 3 Tomas Bzatek 2012-10-31 13:55:09 UTC
(In reply to comment #0)
> Finally, Colin points out that we should probably remove the g_getenv
> ("DBUS_SESSION_BUS_ADDRESS") and patch callers to setenv (GIO_USE_VFS=local)

That would be great, however tracking users is difficult as nearly everybody use GIO nowadays. Do we want to go the risky way? This is not easy to find out, see the discussion in bug 526454. Looks more like a GnomeGoal to me.
Comment 4 Matthias Clasen 2012-10-31 14:32:22 UTC
Review of attachment 227730 [details] [review]:

Looks great to me, thanks.
Comment 5 Matthias Clasen 2012-10-31 14:35:49 UTC
(In reply to comment #3)
> (In reply to comment #0)
> > Finally, Colin points out that we should probably remove the g_getenv
> > ("DBUS_SESSION_BUS_ADDRESS") and patch callers to setenv (GIO_USE_VFS=local)
> 
> That would be great, however tracking users is difficult as nearly everybody
> use GIO nowadays. Do we want to go the risky way? This is not easy to find out,
> see the discussion in bug 526454. Looks more like a GnomeGoal to me.

Fine with me to leave that as is for now.
Comment 6 Tomas Bzatek 2012-11-01 13:48:20 UTC
Committed both patches to master and a lighter variant of the second patch also in stable gnome-3-6 branch.
Comment 7 fritz.heinrichmeyer 2012-11-08 09:05:18 UTC
leftover tracker-miner-fs processes break the ability to shutdown respective reboot into windows/gaming operating system for non administators and non hackers as the system behaves as there would be still another user session.

Usability in a "family environment" is degraded by this bug.

I hope this bug will vanish in gnome-3.6.2 .