Closed
Bug 797120
Opened 12 years ago
Closed 12 years ago
Assertion failure: _mOwningThread.GetThread() == PR_GetCurrentThread() (ValueObserver not thread-safe), at /Volumes/2mac/gaia/isrc/modules/libpref/src/Preferences.cpp:131
Categories
(Core :: Graphics, defect)
Tracking
()
RESOLVED
FIXED
mozilla19
People
(Reporter: gwagner, Assigned: jgilbert)
References
Details
Attachments
(4 files, 3 obsolete files)
693 bytes,
patch
|
roc
:
review-
|
Details | Diff | Splinter Review |
1.50 KB,
patch
|
Details | Diff | Splinter Review | |
12.63 KB,
text/plain
|
Details | |
3.44 KB,
patch
|
bjacob
:
review+
|
Details | Diff | Splinter Review |
I see this during shutdown of the b2g desktop build.
Reporter | ||
Updated•12 years ago
|
Assignee: nobody → anygregor
Reporter | ||
Comment 1•12 years ago
|
||
Reporter | ||
Comment 2•12 years ago
|
||
The backtrace: http://pastebin.mozilla.org/1855092
Reporter | ||
Comment 3•12 years ago
|
||
Comment on attachment 667171 [details] [diff] [review] patch This fixes the problem but I am not 100% sure if this is the right fix.
Attachment #667171 -
Flags: review?(roc)
Comment on attachment 667171 [details] [diff] [review] patch Review of attachment 667171 [details] [diff] [review]: ----------------------------------------------------------------- This is absolutely not the right fix. Preferences are not threadsafe and simply declaring them to be won't fix anything, it will just hide bugs. It looks like something added a preference observer off the main thread. It needs to not do that. nsPrefBranch::AddObserver and nsPrefBranch::RemoveObserver should assert NS_IsMainThread. That will let you catch this bug when it is actually introduced.
Attachment #667171 -
Flags: review?(roc) → review-
Comment 5•12 years ago
|
||
This is the first place where AddObserver is called from the main thread.
Comment 6•12 years ago
|
||
This is the patch I used to get the log above. I made it abort because I was getting a bazillion assertions just waiting for the homescreen to appear.
Your patch is backwards, you want to abort if you're *not* on the main thread.
Comment 8•12 years ago
|
||
Doh! This is the version that aborts on access off the main thread.
Attachment #676192 -
Attachment is obsolete: true
Comment 9•12 years ago
|
||
...and this is the log from running desktop B2G with the above patch.
Attachment #676189 -
Attachment is obsolete: true
Component: General → Graphics
Product: Boot2Gecko → Core
mozilla::gl::GLContext::CanUploadNonPowerOfTwo should absolutely not be calling AddBoolVarCache when off the main thread!!!
Assignee: anygregor → jgilbert
Assignee | ||
Comment 11•12 years ago
|
||
Attachment #676876 -
Flags: review?(bjacob)
Attachment #676876 -
Flags: feedback?(roc)
Attachment #676876 -
Flags: feedback?(roc) → feedback+
Comment 12•12 years ago
|
||
Comment on attachment 676876 [details] [diff] [review] Do caching setup in GLContext::Init Review of attachment 676876 [details] [diff] [review]: ----------------------------------------------------------------- This seems to rely on the assumption that InitWithPrefix is only called on the main thread, which AFAIU isn't the case. The approach we've used in previous similar bugs was to move such must-happen-on-main-thread initialization things to gfxPlatform. See e.g. how at the beginning of InitWithPrefix we query gfxPlatform for WorkAroundDriverBugs(). Indeed gfxPlatform initialization at least is guaranteed to happen on the main thread.
Attachment #676876 -
Flags: review?(bjacob) → review-
Comment 13•12 years ago
|
||
See this patch -- with you reviewed ;-) https://bugzilla.mozilla.org/attachment.cgi?id=613137&action=diff
Comment 14•12 years ago
|
||
Side note: it would be nice if we could have read-only, no-guarantees-in-case-of-race, access to preferences off the main thread. Not having that is causing many such discussions, and is causing us to move more things to the main thread at startup for no real good reason.
Comment 15•12 years ago
|
||
Attachment #676876 -
Attachment is obsolete: true
Attachment #678208 -
Flags: review?(bjacob)
Comment 16•12 years ago
|
||
Comment on attachment 678208 [details] [diff] [review] Do caching setup in GLContext::Init Review of attachment 678208 [details] [diff] [review]: ----------------------------------------------------------------- ::: gfx/gl/GLContext.cpp @@ +641,2 @@ > > if (!sPowerOfTwoPrefCached) { Seems like this CacheCanUploadNPOT should only ever get called once, from gfxPlatform::Init--->GLContext::PlatformSetup. So you could consider either removing this if(), or replacing it by an assertion confirming that we area only doing this once.
Attachment #678208 -
Flags: review?(bjacob) → review+
Comment 18•12 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/6d54c207490e
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla19
You need to log in
before you can comment on or make changes to this bug.
Description
•