-
-
Notifications
You must be signed in to change notification settings - Fork 73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Session dbus daemon is quickly saturated with match rules, exceeding configuration limits. #233
Comments
There are downstream reports about this issue:
Best regards. |
@ProMarbler14 Are you still able to reproduce the issue ? On Debian, the user has indicated that the issue has been solved by an upgrade. Best regards. |
I get those dbus spams all the time, mate-terminal 1.20.0, Fedora 27. That debian reporter didn't say whether he is still using mate-terminal. |
I have similar issue on Fedora 28, also had it on 27 and 26 I'm using mate-terminal-1.20.0-2.fc28.x86_64 at the moment |
i'm seeing the same. i just now traced it to mate-terminal. this is ubuntu 18.04 amd64 with ubuntu's 1.20.1 build. apps that connect to d-bus and/or spawn a service (in this case org.freedesktop.Notifications) seem to trigger this, at least in part. connection ':1.51' is mate-terminal, according to the
|
i keep seeing this so decided to take a look at what my session dbus has in memory using
so, maybe something to do with dconf? |
okay, i found the commit(s):
the commit which introduced the g_settings_new leak for every keystroke is 7ebc9d1 "add the abbility to switch tabs using [ctrl+tab] and [ctrl+shift+tab]" 294ce36 is probably leaking to a lesser extent as well, but i haven't tested it. this newly added callback is invoked for every keypress which then creates a new handle to org.mate.terminal.global, which matches up with the memory dump i took of dbus-daemon. i confirmed this is the cause by reverting 7ebc9d1 and recompiling. i had a root terminal open like so, and was able to see the leak happening in real-time. pid 1532 here is my session dbus instance.
@sc0w should maybe the GSettingsObject be cached between callback invocations and/or this commit otherwise refactored? since ctrl+page up/page down already worked to switch tabs, should that same mechanism be used here or is there something i'm missing? it seems there must be a more efficient way to do this than entering that callback on every keypress, regardless of if it's leaking memory or not. |
how to reproduce this issue step by step? where is that logs? I can't see that with |
@sc0w by default on at least ubuntu, there is a setting in /usr/share/dbus-1/session.conf if you wanted to trigger it sooner for debugging purposes, obviously you could lower 50000 to another number. i gave a i looked further into how all the other key shortcuts are done. they are defined in terminal-accels.c. i think any other keyboard shortcuts should be added to that existing framework, including this one. that way we're not wasting cpu cycles setting up (and tearing down, if the leak was fixed) a dbus connection with every keystroke. i'm not sure if there's an existing place in the codebase to handle mouse clicks, but if so i think 294ce36 should be migrated to use that as well, since it is also leaking. |
Same issue. I tried the simple fix of adding ctrl-tab to the accelerator configuration, and of course that didn't work because something (gtk? vte?) is eating the modifier. After poking around I think that @sc0w's implementation is close to being the only feasible way of implementing this. Caching the setting value is probably the best option here. |
Please test #241 |
Expected behavior
The session's dbus daemon should not be saturated with match rules for a single connection just by using the terminal emulator.
Actual behavior
The session's dbus daemon receives repeated AddMatch method calls (?) for every keypress the terminal receives. After being used for a while, the system journal log becomes spammed with warnings like this:
[session uid=1000 pid=552] Connection ":1.33" is not allowed to add more match rules (increase limits in configuration file if required; max_match_rules_per_connection=50000)
Observing the session message bus with dbus-monitor reveals repeated messages like this:
method call time=1521644024.563761 sender=:1.32 -> destination=org.freedesktop.DBus serial=724 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=AddMatch string "type='signal',interface='ca.desrt.dconf.Writer',path='/ca/desrt/dconf/Writer/user',arg0path='/org/mate/terminal/global/'" method return time=1521644024.563816 sender=org.freedesktop.DBus -> destination=:1.32 serial=714 reply_serial=724
Steps to reproduce the behavior
Open a terminal window and start pressing/typing keys, including meta keys like shift.
MATE general version
1.20.0
Package version
1.20.0
Linux Distribution
Arch Linux
Link to downstream report of your Distribution
currently none
The text was updated successfully, but these errors were encountered: