Skip to content
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

Match rules leak when using addSigHandler/removeSigHandler #76

Closed
littlefreaky opened this issue Oct 11, 2019 · 5 comments
Closed

Match rules leak when using addSigHandler/removeSigHandler #76

littlefreaky opened this issue Oct 11, 2019 · 5 comments

Comments

@littlefreaky
Copy link
Contributor

In the DBusConnection class, the method addSigHandler (line 875) adds a match rule to the DBus interface by calling AddMatch unconditionally and puts the handler to the internal map used to keep track of the signal handlers.
The method removeSigHandler (line 779) removes the signal handler from the internal map, but only calls RemoveMatch on the DBus interface if no other handler is in the map which matches the same SignalTuple.

This asymmetry causes a match rule leak when adding and removing multiple signal handlers which result in the same SignalTuple value.
In my case, the application adds and removes handlers depending on state information. After some time, adding new match rules will fail because the maximum number of allowed rules is reached.

@hypfvieh
Copy link
Owner

I changed the addSigHandler (and addGenericSigHandler) method to only add the rule to DBus (calling AddMatch) if no other signal handler was added with that rule before.

Please test and report back.

@littlefreaky
Copy link
Contributor Author

Thank you very much. I've tested the changes in my environment and can no longer reproduce the exceptions.

@weliem
Copy link

weliem commented Oct 24, 2019

Great! I was facing the same issue.

Will there be a new release any time soon?

@hypfvieh
Copy link
Owner

I don't think that I'll create a new release in the near future as version 3.2.0 has been released recently and this is the first and only bugfix since release.
I always wait to collect some bug fixes and improvements before creating a release.

My plan is to wait at least until the end of the year or maybe until mid/end of January 2020.
We will see how many issues will be found and fixed until then.

@weliem
Copy link

weliem commented Oct 25, 2019

Ok, understandable...no problem

@hypfvieh hypfvieh closed this as completed Nov 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants