[pulseaudio-tickets] [Bug 89532] New: [PATCH] dbus I/O is not dispatched
bugzilla-daemon at freedesktop.org
bugzilla-daemon at freedesktop.org
Wed Mar 11 05:37:24 PDT 2015
https://bugs.freedesktop.org/show_bug.cgi?id=89532
Bug ID: 89532
Summary: [PATCH] dbus I/O is not dispatched
Product: PulseAudio
Version: unspecified
Hardware: Other
OS: All
Status: NEW
Severity: normal
Priority: medium
Component: core
Assignee: pulseaudio-bugs at lists.freedesktop.org
Reporter: dh.herrmann at gmail.com
QA Contact: pulseaudio-bugs at lists.freedesktop.org
CC: lennart at poettering.net
Created attachment 114218
--> https://bugs.freedesktop.org/attachment.cgi?id=114218&action=edit
Fix set_nice() to use private bus connections
Hi
In src/pulsecore/core-util.c:set_nice() we currently use a temporary
dbus-connection to set the nice-level via rtkit. However, we never close that
connection. This is fine, as the connection is shared and dbus-core will manage
it. But no other part of pulseaudio (with one exception, see below) uses the
libdbus1 managed connections. Therefore, we effectively end up with an unused
dbus-connection that is not integrated into any main-loop. dbus-daemon will
send bus-notifications to the connection (as libdbus1 installs matches for
those by default (it has to!)) until the outgoing queue is full. Thus, we waste
several KBs (or MBs? I didn't look it up) of memory for a message queue that is
never dispatched.
If you look at set_scheduler() in the same file, you see the only other user of
libdbus1 without pa_dbus. However, it correctly uses a private bus connection
via dbus_get_bus_private(). It also correctly closes _and_ unref's it after
it's done.
Note that you cannot call dbus_connection_close() on shared connections.
Therefore, I recommend fixing set_nice() to work exactly like set_scheduler().
An untested patch is attached. I don't have any clue what the rtkit stuff does,
so I cannot really test it. I hope you guys can give it a try.
Thanks
David
--
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/pulseaudio-bugs/attachments/20150311/72952c91/attachment.html>
More information about the pulseaudio-bugs
mailing list