Bug#934791: libgtk-3-0: complains when attempting to register already registered client

2019-08-20 Thread Simon McVittie
Control: reassign -1 caja

On Fri, 16 Aug 2019 at 23:53:52 +, brian m. carlson wrote:
> On 2019-08-15 at 07:34:00, Simon McVittie wrote:
> > Control: tags -1 + moreinfo
> > 
> > On Wed, 14 Aug 2019 at 23:48:09 +, brian m. carlson wrote:
> > > GTK+ produces the following warning when attempting to register a client
> > > with the session manager and the client is already registered:
> > > 
> > >   (caja:3729): Gtk-WARNING **: 02:59:57.229: Failed to register client: 
> > > GDBus.Error:org.gnome.SessionManager.AlreadyRegistered: Unable to 
> > > register client
> > 
> > Under what circumstances does this occur? I see the program in question
> > is caja. What desktop environment is this in, and how can this bug be
> > reproduced?
> 
> This is in MATE with a typical mate-session startup. This message gets
> logged to ~/.xsession-errors, and it's trivially reproducible by running
> "killall caja". I believe I've seen it before when running from the
> command line, but I can't seem to reproduce that now.

This appears to be specific to caja. It looks as though it is registering
itself with the session manager twice: once via XSMP, and once via
GtkApplication's D-Bus API (as requested via the "register-session": TRUE
property at construct-time). I suspect that mate-session might not have
any reliable way to tell whether the two registrations are coming from
the same process (which would maybe be OK, albeit redundant) or whether
they are coming from different processes specifying the same opaque
"startup ID" (which would presumably result in the session manager having
difficulty managing them both separately). The D-Bus registration comes
from a D-Bus unique name, which can be resolved to a process ID by asking
the dbus-daemon; I don't know whether the XSMP registration carries similar
information or not.

I can reproduce this in a MATE desktop session in a VM. Other MATE apps
like atril and pluma don't seem to do this.

I can also reproduce it in a GNOME desktop session (with gnome-session
instead of mate-session) by running caja, but not by running nautilus,
the GNOME app from which caja was derived.

> > I don't know the session manager API well enough to know immediately
> > whether this message indicates a bug in the session manager, the
> > application, GTK, or something else.
> 
> I see this much like reporting an ENOENT with unlink(2): what you wanted
> has already been done, so barring some specific circumstance where you
> know it will be a problem, there's no reason to report an error.

That's a good analogy: whether unlink(2) should be idempotent depends
on how it is being used. If you want it to be idempotent, then ENOENT
can be ignored, but if you are not expecting it to fail (for example
if you are using creation and deletion of a file as part of a locking
protocol), then it indicates a problem. That's why we have both rm, which
complains about ENOENT, and rm -f, which does not. A better analogy is
perhaps mkdir(2) rather than unlink: GtkApplication has been asked to
(tell the session manager to) create a record of its presence in the
session, but when it tried to do so, it received an error response
indicating that a record of the same startup ID already exists. Again,
callers of mkdir sometimes need to ignore EEXIST and sometimes need to
treat it as a problem, depending on precisely what they are doing.

If the maintainers of MATE's session manager do not consider it to be
problematic for the same application to register itself with the same
"startup ID" in two parallel ways, one option would be for mate-session to
respond to this situation with a D-Bus successful reply message instead
of with an error. (However, as noted above, it might not be practical for
mate-session to determine whether an XSMP registration and a D-Bus
registration are in fact describing the same process.)

On receiving an error, it seems reasonable for GTK to diagnose a potential
problem: it was asked to register using an opaque startup ID that was
meant to be unique, but got an error response from the session manager
when it tried to do so, indicating that the startup ID is already in use
to identify some other session manager client (which it appears may have
been because the same caja process also registered itself in parallel
using the same startup ID, EggSmClient and XSMP, but GtkApplication can't
know whether the process in which it is hosted is participating in XSMP
orthogonal to its use of GtkApplication with register-session set to TRUE).

smcv



Bug#934791: libgtk-3-0: complains when attempting to register already registered client

2019-08-16 Thread brian m. carlson
On 2019-08-15 at 07:34:00, Simon McVittie wrote:
> Control: tags -1 + moreinfo
> 
> On Wed, 14 Aug 2019 at 23:48:09 +, brian m. carlson wrote:
> > GTK+ produces the following warning when attempting to register a client
> > with the session manager and the client is already registered:
> > 
> >   (caja:3729): Gtk-WARNING **: 02:59:57.229: Failed to register client: 
> > GDBus.Error:org.gnome.SessionManager.AlreadyRegistered: Unable to register 
> > client
> 
> Under what circumstances does this occur? I see the program in question
> is caja. What desktop environment is this in, and how can this bug be
> reproduced?

This is in MATE with a typical mate-session startup. This message gets
logged to ~/.xsession-errors, and it's trivially reproducible by running
"killall caja". I believe I've seen it before when running from the
command line, but I can't seem to reproduce that now.

I unfortunately don't have a fresh session to test against, and MATE
isn't likely to run nicely in a Docker container, which is my usual test
environment for bugs.

> (I assume it's either GNOME, one of the various GNOME forks, or XFCE,
> based on the D-Bus APIs used in the function that contains that warning.)
> 
> I don't know the session manager API well enough to know immediately
> whether this message indicates a bug in the session manager, the
> application, GTK, or something else.

I see this much like reporting an ENOENT with unlink(2): what you wanted
has already been done, so barring some specific circumstance where you
know it will be a problem, there's no reason to report an error.
-- 
brian m. carlson: Houston, Texas, US
OpenPGP: https://keybase.io/bk2204


signature.asc
Description: PGP signature


Bug#934791: libgtk-3-0: complains when attempting to register already registered client

2019-08-15 Thread Simon McVittie
Control: tags -1 + moreinfo

On Wed, 14 Aug 2019 at 23:48:09 +, brian m. carlson wrote:
> GTK+ produces the following warning when attempting to register a client
> with the session manager and the client is already registered:
> 
>   (caja:3729): Gtk-WARNING **: 02:59:57.229: Failed to register client: 
> GDBus.Error:org.gnome.SessionManager.AlreadyRegistered: Unable to register 
> client

Under what circumstances does this occur? I see the program in question
is caja. What desktop environment is this in, and how can this bug be
reproduced?

(I assume it's either GNOME, one of the various GNOME forks, or XFCE,
based on the D-Bus APIs used in the function that contains that warning.)

I don't know the session manager API well enough to know immediately
whether this message indicates a bug in the session manager, the
application, GTK, or something else.

smcv



Bug#934791: libgtk-3-0: complains when attempting to register already registered client

2019-08-14 Thread brian m. carlson
Package: libgtk-3-0
Version: 3.24.10-1
Severity: minor

GTK+ produces the following warning when attempting to register a client
with the session manager and the client is already registered:

  (caja:3729): Gtk-WARNING **: 02:59:57.229: Failed to register client: 
GDBus.Error:org.gnome.SessionManager.AlreadyRegistered: Unable to register 
client

GTK+ should either not attempt to register the client in this case or
should detect that it's already registered and not warn about it to
standard error.

-- System Information:
Debian Release: bullseye/sid
  APT prefers unstable-debug
  APT policy: (500, 'unstable-debug'), (500, 'unstable'), (500, 'testing'), 
(500, 'stable'), (1, 'experimental-debug'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 5.2.0-2-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), 
LANGUAGE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages libgtk-3-0 depends on:
ii  adwaita-icon-theme   3.30.1-1
ii  hicolor-icon-theme   0.17-2
ii  libatk-bridge2.0-0   2.32.0-2
ii  libatk1.0-0  2.32.0-2
ii  libc62.28-10
ii  libcairo-gobject21.16.0-4
ii  libcairo21.16.0-4
ii  libcolord2   1.4.3-4
ii  libcups2 2.2.10-6
ii  libepoxy01.5.3-0.1
ii  libfontconfig1   2.13.1-2
ii  libfreetype6 2.9.1-4
ii  libfribidi0  1.0.5-3.1
ii  libgdk-pixbuf2.0-0   2.38.1+dfsg-1
ii  libglib2.0-0 2.60.6-2
ii  libgtk-3-common  3.24.10-1
ii  libharfbuzz0b2.5.3-1
ii  libjson-glib-1.0-0   1.4.4-2
ii  libpango-1.0-0   1.42.4-7
ii  libpangocairo-1.0-0  1.42.4-7
ii  libpangoft2-1.0-01.42.4-7
ii  librest-0.7-00.8.1-1
ii  libsoup2.4-1 2.64.2-2
ii  libwayland-client0   1.17.0-1
ii  libwayland-cursor0   1.17.0-1
ii  libwayland-egl1  1.17.0-1
ii  libx11-6 2:1.6.7-1
ii  libxcomposite1   1:0.4.4-2
ii  libxcursor1  1:1.2.0-2
ii  libxdamage1  1:1.1.5-1
ii  libxext6 2:1.3.3-1+b2
ii  libxfixes3   1:5.0.3-1
ii  libxi6   2:1.7.9-1
ii  libxinerama1 2:1.1.4-2
ii  libxkbcommon00.8.2-1
ii  libxml2  2.9.4+dfsg1-7+b3
ii  libxrandr2   2:1.5.1-1
ii  shared-mime-info 1.10-1

Versions of packages libgtk-3-0 recommends:
ii  libgtk-3-bin  3.24.10-1

Versions of packages libgtk-3-0 suggests:
ii  gvfs 1.38.1-5
ii  librsvg2-common  2.44.14-1

Versions of packages libgtk-3-0 is related to:
pn  appmenu-gtk3-module   
pn  fcitx-frontend-gtk3   
pn  gcin-gtk3-immodule
pn  gtk-vector-screenshot 
pn  gtk3-engines-xfce 
pn  gtk3-im-libthai   
pn  hime-gtk3-immodule
ii  ibus-gtk3 1.5.19-4+b1
pn  imhangul-gtk3 
ii  libcanberra-gtk3-module   0.30-7
pn  libcaribou-gtk3-module
pn  libgtk3-nocsd0
pn  maliit-inputcontext-gtk3  
pn  packagekit-gtk3-module
pn  scim-gtk-immodule 
pn  topmenu-gtk3  
pn  uim-gtk3  
pn  uim-gtk3-immodule 

-- no debconf information

-- 
brian m. carlson: Houston, Texas, US
OpenPGP: https://keybase.io/bk2204


signature.asc
Description: PGP signature