Closed
Bug 1008483
Opened 10 years ago
Closed 9 years ago
Camera ReadWrite locks are not hooked up to the deadlock detector
Categories
(Firefox OS Graveyard :: Gaia::Camera, defect)
Firefox OS Graveyard
Gaia::Camera
Tracking
(firefox43 fixed)
RESOLVED
FIXED
FxOS-S5 (21Aug)
Tracking | Status | |
---|---|---|
firefox43 | --- | fixed |
People
(Reporter: bent.mozilla, Assigned: royang51)
References
Details
Attachments
(1 file)
12.56 KB,
patch
|
aosmond
:
review+
|
Details | Diff | Splinter Review |
I'm a bit skeptical that our old-as-the-hills NSPR RW locks are a) well-tested, or b) performant, but in any case the current RwLockAutoEnterRead/RwLockAutoEnterWrite are not hooked up to the deadlock detector.
Comment 1•10 years ago
|
||
Mike, it seems like bug 909542 added RwLockAutoEnterRead and RwLockAutoEnterWrite, but the patch is huge and it's not clear to me why these locks are used and what properties of them you're relying on. Can you please help me understand what these are trying to achieve?
Thanks!
Assignee: nobody → ehsan
Flags: needinfo?(mhabicher)
Comment 2•10 years ago
|
||
Ehsan, they're being used for two purposes:
1. to protect the parameters database at the heart of GonkCameraParameters; and
2. to protect the array of CameraControlListeners in CameraControlImpl.
In the latter case, multiple listener-bound events may be fired from multiple threads within the camera driver, triggering callbacks that could try to modify the listener list. The camera driver threading model is not well documented or even standard across platforms, and using a RW-lock makes sure the readers don't deadlock.
Flags: needinfo?(mhabicher)
Comment 3•10 years ago
|
||
(In reply to Mike Habicher [:mikeh] from comment #2)
> Ehsan, they're being used for two purposes:
> 1. to protect the parameters database at the heart of GonkCameraParameters;
> and
> 2. to protect the array of CameraControlListeners in CameraControlImpl.
>
> In the latter case, multiple listener-bound events may be fired from
> multiple threads within the camera driver, triggering callbacks that could
> try to modify the listener list. The camera driver threading model is not
> well documented or even standard across platforms, and using a RW-lock makes
> sure the readers don't deadlock.
Hmm, my question was more specifically about the usage of RW-locks versus normal locks. What do the RW-locks buy you? As far as I can see, you would be able to use normal locks for both #1 and #2 above...
Flags: needinfo?(mhabicher)
Comment 4•10 years ago
|
||
ping?
Comment 5•10 years ago
|
||
Bug 1139027 removes the RW lock around GonkCameraParameters and replaces it with a standard mutex. The RW lock around the listeners in CameraControlImpl remains.
Blocks: camera-backlog
Depends on: 1139027
Comment 6•9 years ago
|
||
royang: Can you take a look at this?
Assignee: ehsan → royang51
Flags: needinfo?(bugzilla)
Updated•9 years ago
|
Status: NEW → ASSIGNED
Updated•9 years ago
|
Component: DOM: Device Interfaces → Gaia::Camera
Product: Core → Firefox OS
Version: Trunk → unspecified
Attachment #8631931 -
Flags: review?(aosmond)
Comment 8•9 years ago
|
||
Comment on attachment 8631931 [details] [diff] [review]
bug1008483, v1
Review of attachment 8631931 [details] [diff] [review]:
-----------------------------------------------------------------
Sorry about the delay on this. Tried it out, looks good to me!
Attachment #8631931 -
Flags: review?(aosmond) → review+
Keywords: checkin-needed
Comment 10•9 years ago
|
||
Keywords: checkin-needed
Comment 12•9 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
status-firefox43:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → FxOS-S5 (21Aug)
Comment 13•9 years ago
|
||
Comment on attachment 8631931 [details] [diff] [review]
bug1008483, v1
Review of attachment 8631931 [details] [diff] [review]:
-----------------------------------------------------------------
::: dom/camera/CameraControlImpl.cpp
@@ -5,5 @@
> #include "CameraControlImpl.h"
> #include "base/basictypes.h"
> #include "mozilla/Assertions.h"
> #include "mozilla/unused.h"
> -#include "nsPrintfCString.h"
Why did you remove it ?
My local build fails:
In file included from /Users/varga/Sources/Mozilla/obj-ff-dbg/dom/camera/Unified_cpp_dom_camera0.cpp:2:
/Users/varga/Sources/Mozilla/dom/camera/CameraControlImpl.cpp:350:7: error:
unknown type name 'nsPrintfCString'
nsPrintfCString msg("Camera control API(%d) failed with 0x%x", mCo...
^
/Users/varga/Sources/Mozilla/dom/camera/CameraControlImpl.cpp:373:3: error:
unknown type name 'nsPrintfCString'
nsPrintfCString msg("Failed to dispatch camera control message (0x%x)", rv);
^
2 errors generated.
Comment 14•9 years ago
|
||
Reopened due to build break (although not locally for me on the try servers, I can see in theory how it might be a problem...).
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Status: REOPENED → RESOLVED
Closed: 9 years ago → 9 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•