Community
Participate
Working Groups
AIUI, the webkit dbus IPC currently tries to own the dbus namespace "org.eclipse.swt.<PID>" on the session bus. This can't work when an SWT-based application is sandboxed with Flatpak because your PID is only guaranteed to be unique within the sandbox. Because there are usually not many processes running inside the sandbox, it's actually highly likely (but not guaranteed) that a sandboxed process will be given a PID of 2. This makes it entirely within the realm of possibility that two SWT-based applications will try to own the same namespace. Please consider using a private bus for this feature.
I read more about it and I don't think there is really such thing as private bus. At least all webkitgtk extensions I checked use the public one. Closing, please reopen if one has pointers to documentation how this can be done.
There is still the problem that two SWT-based applications can try to own the same dbus name on the session bus due to both applications being extremely likely to have the same PID. PIDs are only unique within the sandbox, so if I have to expose the host session bus to the sandboxes there will be a clash. Also, opening up the host session bus is fine for a development tool like the IDE, but is not a very nice way to deal with other kinds of SWT application.
BTW the advice I got from Flatpak guys was to use a private bus. Epiphany is one example of an application that does this for a web extension: > mbooth, Epiphany is one example > mbooth, much of the magic is here: https://github.com/GNOME/epiphany/blob/68b0f85747a177047a7b49d839895aad54b05309/embed/web-extension/ephy-web-extension.c > mbooth, also: https://github.com/GNOME/epiphany/blob/b570c29ce814f916078b4d5e33252c66af799dc9/embed/ephy-embed-shell.c#L1021-L1061 > so the latter is the UI process making a private dbus server, the former is the web processes connecting to it
(In reply to Mat Booth from comment #3) > BTW the advice I got from Flatpak guys was to use a private bus. Epiphany is > one example of an application that does this for a web extension: > > > mbooth, Epiphany is one example > > mbooth, much of the magic is here: https://github.com/GNOME/epiphany/blob/68b0f85747a177047a7b49d839895aad54b05309/embed/web-extension/ephy-web-extension.c > > mbooth, also: https://github.com/GNOME/epiphany/blob/b570c29ce814f916078b4d5e33252c66af799dc9/embed/ephy-embed-shell.c#L1021-L1061 > > so the latter is the UI process making a private dbus server, the former is the web processes connecting to it Thanks Mat, that's quite valuable
Is it only the webkit DBus that is causing problems? Or all SWT GDBus interaction? Webkit isn't the only use case for DBus, we also use it for OpenFile (bug 528414). Some of my research shows that we should be able to make it private: https://developer.gnome.org/gio//2.44/GDBusServer.html
(In reply to Eric Williams from comment #5) > Is it only the webkit DBus that is causing problems? Or all SWT GDBus > interaction? Webkit isn't the only use case for DBus, we also use it for > OpenFile (bug 528414). > > Some of my research shows that we should be able to make it private: > https://developer.gnome.org/gio//2.44/GDBusServer.html IMHO the OpenFile dbus interface should stay public to allow dbus integration with eclipse not only command line.
(In reply to Alexander Kurtakov from comment #6) > (In reply to Eric Williams from comment #5) > > Is it only the webkit DBus that is causing problems? Or all SWT GDBus > > interaction? Webkit isn't the only use case for DBus, we also use it for > > OpenFile (bug 528414). > > > > Some of my research shows that we should be able to make it private: > > https://developer.gnome.org/gio//2.44/GDBusServer.html > > IMHO the OpenFile dbus interface should stay public to allow dbus > integration with eclipse not only command line. Agreed.
Flatpak guys prompted me again about SWT requiring the sandbox to be exposed for the whole session bus. Any progress on making the webkit IPC use a private bus?
(In reply to Mat Booth from comment #8) > Flatpak guys prompted me again about SWT requiring the sandbox to be exposed > for the whole session bus. > > Any progress on making the webkit IPC use a private bus? Not yet, I hope to have something in Gerrit before the Christmas holidays. I didn't find the time during 4.14.
Gerrit change https://git.eclipse.org/r/153741 was merged to [master]. Commit: http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=558be9a19c6de3c914ccbed0ac541d5c849bf1f5
(In reply to Eclipse Genie from comment #10) > Gerrit change https://git.eclipse.org/r/153741 was merged to [master]. > Commit: > http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/ > ?id=558be9a19c6de3c914ccbed0ac541d5c849bf1f5 In master now.
Verified in Eclipse SDK Version: 2020-03 (4.15) Build id: I20200106-1805 OS: Linux, v.4.15.0-72-generic, x86_64 / gtk 3.22.30, WebKit 2.26.2 Java version: 13.0.1
(In reply to Eclipse Genie from comment #10) > Gerrit change https://git.eclipse.org/r/153741 was merged to [master]. > Commit: > http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/ > ?id=558be9a19c6de3c914ccbed0ac541d5c849bf1f5 For the record: this caused regression in bug 562443.
The change here causes occasional crashes in the JVM when calling jstack, see bug 569853.