On Gonk ICS we're seeing an interesting race condition in the emulator: the B2G SMS database service is initialized at startup and immediately initializes an IndexedDB instance. IndexedDB happens to query the Directory Service for ProfD *off the main thread*. This usually works out fine so long as the Directory Service's cache has been primed (e.g. something has already queried for ProfD). In this case, however, we're seeing that the IndexedDB thread is racing the main thread and fails to look up ProfD.
Created attachment 613261 [details] [diff] [review] v1
E/GeckoConsole( 108): Attempt to use JS function on a different thread calling nsIDirectoryServiceProvider.getFile. JS objects may not be shared across threads
Backout merged: https://hg.mozilla.org/mozilla-central/rev/a235528adace
Created attachment 613832 [details] [diff] [review] v2 Now with the proper Services.jsm import. The missing import was preventing the SmsDatabaseService from initializing the database, so it kind of fixed the freezing problem, but not in a very useful way. mwu, would you mind testing this new patch with the missing import added, to see if it still fixes the problem?
Turns out, the provided patch doesn't fix the freeze, but it *does* fix the off-thread error. So I'm morphing this bug to just deal with that and filed the cloned bug 744300 to deal with the freeze.
Comment on attachment 613832 [details] [diff] [review] v2 (Canceling feedback request, got feedback from mwu over IRC. Will commit this patch as it already has r+.)