Closed Bug 1266033 Opened 8 years ago Closed 8 years ago

|nsDBusHandlerApp| leaks |DBusConnection|

Categories

(Core :: DOM: Navigation, defect)

Unspecified
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla48
Tracking Status
firefox48 --- fixed

People

(Reporter: tzimmermann, Assigned: tzimmermann)

References

Details

(Whiteboard: btpp-active)

Attachments

(4 files)

|nsDBusHandlerApp| acquires [1] a reference to the DBus session bus, but never releases the connection.

[1] https://dxr.mozilla.org/mozilla-central/source/uriloader/exthandler/nsDBusHandlerApp.cpp#90
Cleaning up before doing actual fixes.
Attachment #8743218 - Flags: review?(bzbarsky)
We have seen multi-threading bugs with Bluetooth, where DBus messages where handled on any thread that watched the shared DBus connection. Using a private connection avoids these problems.
Attachment #8743222 - Flags: review?(bzbarsky)
Comment on attachment 8743218 [details] [diff] [review]
[00] Bug 1266033: Fix white-space errors in |nsDBusHandlerApp|

r=me
Attachment #8743218 - Flags: review?(bzbarsky) → review+
Comment on attachment 8743219 [details] [diff] [review]
[01] Bug 1266033: |nsDBusHandlerApp|: Hold reference to |DBusConnection| in |RefPtr|

r=me
Attachment #8743219 - Flags: review?(bzbarsky) → review+
Comment on attachment 8743221 [details] [diff] [review]
[02] Bug 1266033: |nsDBusHandlerApp|: Hold reference to |DBusMessage| in |RefPtr|

r=me
Attachment #8743221 - Flags: review?(bzbarsky) → review+
Comment on attachment 8743222 [details] [diff] [review]
[03] Bug 1266033: |nsDBusHandlerApp|: Use private connection to DBus session bus

r=me I guess, but I have no idea why this is the right thing to do... ;)
Attachment #8743222 - Flags: review?(bzbarsky) → review+
Whiteboard: btpp-active
(In reply to Boris Zbarsky [:bz] from comment #8)
> Comment on attachment 8743222 [details] [diff] [review]
> [03] Bug 1266033: |nsDBusHandlerApp|: Use private connection to DBus session
> bus
> 
> r=me I guess,

Thanks :)

> but I have no idea why this is the right thing to do... ;)

There are other users of the session bus. These modules use the same DBus connection. If they run concurrently on a different thread or modify the connection concurrently, it could interfere with |nsDBusHandlerApp|. As mentioned, we had this with Bluetooth. With the patch applied, |nsDBusHandlerApp| uses it's own, private connection, which won't interfere with other modules.
See Also: → 1267214
You need to log in before you can comment on or make changes to this bug.