Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(39)

Issue 5333003: cashew: do not delete DBus::ObjectProxy objects from D-Bus callbacks (Closed)

Created:
10 years, 1 month ago by Vince Laviano
Modified:
9 years ago
Reviewers:
Daniel Kurtz
CC:
chromium-os-reviews_chromium.org, Vince Laviano, Jason Glasgow
Visibility:
Public.

Description

cashew: do not delete DBus::ObjectProxy objects from D-Bus callbacks This CL resolves a deadlock that causes cashew to hang indefinitely. Deleting a subclass of DBus::ObjectProxy such as Service or Device causes an unregister message to be sent to the bus daemon, and is effectively the same as explicitly sending a D-Bus message from within a D-Bus callback. As such, it can trigger the same libdbus-c++ deadlock that caused issues 8516 and 8486. We avoid this by scheduling deferred deletion of these objects from the main loop. BUG=chromium-os:8892 TEST=manual testing on device (suspend/resume while connected to 3G) Change-Id: I5882bb581a2b3edb440954d1c32a41fef48ac48d Committed: http://chrome-svn/viewvc/chromeos?view=rev&revision=35386a9

Patch Set 1 #

Total comments: 10

Patch Set 2 : Address djkurtz offline review comment #

Patch Set 3 : Address more djkurtz review comments #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+247 lines, -23 lines) Patch
M src/cashew_server.h View 3 chunks +7 lines, -1 line 0 comments Download
M src/cashew_server.cc View 1 chunk +5 lines, -2 lines 0 comments Download
M src/main.cc View 1 2 4 chunks +5 lines, -2 lines 1 comment Download
M src/service.h View 4 chunks +28 lines, -0 lines 0 comments Download
M src/service.cc View 1 2 4 chunks +77 lines, -4 lines 0 comments Download
M src/service_manager.h View 1 2 5 chunks +38 lines, -2 lines 0 comments Download
M src/service_manager.cc View 1 2 5 chunks +87 lines, -12 lines 0 comments Download

Messages

Total messages: 5 (0 generated)
Vince Laviano
10 years, 1 month ago (2010-11-24 01:05:43 UTC) #1
Daniel Kurtz
Can you make a single 'defered object deleter' that can delete any DBus proxy object ...
10 years, 1 month ago (2010-11-24 02:33:46 UTC) #2
Vince Laviano
PTAL http://codereview.chromium.org/5333003/diff/1/src/service.cc File src/service.cc (right): http://codereview.chromium.org/5333003/diff/1/src/service.cc#newcode478 src/service.cc:478: DLOG(INFO) << path_ << ": DeletePendingDevices: deleting device: ...
10 years, 1 month ago (2010-11-24 04:48:34 UTC) #3
Daniel Kurtz
LGTM http://codereview.chromium.org/5333003/diff/9001/src/main.cc File src/main.cc (right): http://codereview.chromium.org/5333003/diff/9001/src/main.cc#newcode51 src/main.cc:51: // doing it directly here to remove some ...
10 years, 1 month ago (2010-11-24 05:05:48 UTC) #4
Vince Laviano
10 years, 1 month ago (2010-11-24 05:14:53 UTC) #5
On Tue, Nov 23, 2010 at 9:05 PM, <djkurtz@chromium.org> wrote:

> LGTM
>
>
> http://codereview.chromium.org/5333003/diff/9001/src/main.cc
> File src/main.cc (right):
>
> http://codereview.chromium.org/5333003/diff/9001/src/main.cc#newcode51
> src/main.cc:51: // doing it directly here to remove some low severity
> races
> Is this still true?


Yes. A signal at the wrong time could allow deletion of the CashewServer or
ServiceManager instances while the main loop is still running despite the
asserts in their dtors that check if the main loop is running.  However,
such deletions would be programming errors that should never occur rather
than events that are expected to occur during normal operation, so I see the
presence of this race as being of low severity. That being said, it's on my
list of things to fix.


>
>
> http://codereview.chromium.org/5333003/
>

Powered by Google App Engine
This is Rietveld 408576698