Preferences should not be allowed to be accessed off of the main thread in testing the MessageLink

RESOLVED FIXED in Firefox 43

Status

()

defect
RESOLVED FIXED
4 years ago
4 years ago

People

(Reporter: cyu, Assigned: cyu)

Tracking

Trunk
mozilla43
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox43 fixed)

Details

Attachments

(1 attachment)

Refer to https://bugzilla.mozilla.org/show_bug.cgi?id=980419#c8
The pref should only be accessed on the main thread.
Why is this connected to DataStore? bug 949325 ?
Flags: needinfo?(cyu)
(In reply to Andrea Marchesini (:baku) from comment #1)
> Why is this connected to DataStore? bug 949325 ?

It's the result of cloning bug 980419. Unblock 949325 since it's not related to DataStore.
No longer blocks: 949325
Flags: needinfo?(cyu)
Do you have a stacktrace? This isn't a bug in the preferences system: it needs to be moved to the appropriate component.
Flags: needinfo?(cyu)
Component: Preferences: Backend → IPC
Flags: needinfo?(cyu)
I think we can restrict the access to preferences to only on the main thread. This is the one that we care about:
#0  mozilla::ipc::ProcessLink::Open (this=this@entry=0xb2980b60, aTransport=aTransport@entry=0xb29bb4c0, aIOLoop=<optimized out>, aIOLoop@entry=0xb2cbeb20, aSide=aSide@entry=mozilla::ipc::ChildSide) at ipc/glue/MessageLink.cpp:147
#1  0xb3e7349a in mozilla::ipc::MessageChannel::Open (this=this@entry=0xb2986038, aTransport=aTransport@entry=0xb29bb4c0, aIOLoop=0xb2cbeb20, aSide=aSide@entry=mozilla::ipc::ChildSide) at ipc/glue/MessageChannel.cpp:443
#2  0xb3e83b58 in mozilla::ipc::PBackgroundChild::Open (this=this@entry=0xb2986000, aTransport=aTransport@entry=0xb29bb4c0, aOtherPid=aOtherPid@entry=13831, aThread=<optimized out>, aSide=aSide@entry=mozilla::ipc::ChildSide) at /mnt/SSD/data/git/flame-kk/B2G/objdir-gecko/ipc/ipdl/PBackgroundChild.cpp:113
#3  0xb41237be in mozilla::layers::CompositorChild::Create (aTransport=0xb29bb4c0, aOtherPid=13831) at gfx/layers/ipc/CompositorChild.cpp:130
#4  0xb3f85d5a in mozilla::dom::PContentChild::OnMessageReceived (this=0xb6860018, msg__=...) at /mnt/SSD/data/git/flame-kk/B2G/objdir-gecko/ipc/ipdl/PContentChild.cpp:7472
#5  0xb3e7177e in mozilla::ipc::MessageChannel::DispatchAsyncMessage (this=0xb6860050, aMsg=...) at ipc/glue/MessageChannel.cpp:1388
#6  0xb3e77270 in mozilla::ipc::MessageChannel::DispatchMessage (this=this@entry=0xb6860050, aMsg=...) at ipc/glue/MessageChannel.cpp:1308
#7  0xb3e77bc8 in mozilla::ipc::MessageChannel::OnMaybeDequeueOne (this=0xb6860050) at ipc/glue/MessageChannel.cpp:1279
#8  0xb3ce970e in DispatchToMethod<FdWatcher, void (FdWatcher::*)()> (arg=..., method=<optimized out>, obj=<optimized out>) at ipc/chromium/src/base/tuple.h:387
#9  RunnableMethod<FdWatcher, void (FdWatcher::*)(), Tuple0>::Run (this=<optimized out>) at ipc/chromium/src/base/task.h:323
#10 0xb3e706cc in Run (this=<optimized out>) at ../../dist/include/mozilla/ipc/MessageChannel.h:469
#11 mozilla::ipc::MessageChannel::DequeueTask::Run (this=<optimized out>) at ../../dist/include/mozilla/ipc/MessageChannel.h:486
#12 0xb3e63674 in MessageLoop::RunTask (this=0xbecb6050, task=0xb682c378) at ipc/chromium/src/base/message_loop.cc:364
#13 0xb3e660e2 in MessageLoop::DeferOrRunPendingTask (this=<optimized out>, pending_task=...) at ipc/chromium/src/base/message_loop.cc:372
#14 0xb3e67d0e in MessageLoop::DoWork (this=0xbecb6050) at ipc/chromium/src/base/message_loop.cc:459
#15 0xb3e70bf6 in mozilla::ipc::MessagePumpForChildProcess::Run (this=0xb680c618, aDelegate=0xbecb6050) at ipc/glue/MessagePump.cpp:284
#16 0xb3e63602 in MessageLoop::RunInternal (this=this@entry=0xbecb6050) at ipc/chromium/src/base/message_loop.cc:234
#17 0xb3e636b4 in RunHandler (this=0xbecb6050) at ipc/chromium/src/base/message_loop.cc:227
#18 MessageLoop::Run (this=0xbecb6050) at ipc/chromium/src/base/message_loop.cc:201
#19 0xb48ce306 in nsBaseAppShell::Run (this=0xb2933fa0) at widget/nsBaseAppShell.cpp:156
#20 0xb4c60006 in XRE_RunAppShell () at toolkit/xre/nsEmbedFunctions.cpp:785
#21 0xb3e63602 in MessageLoop::RunInternal (this=this@entry=0xbecb6050) at ipc/chromium/src/base/message_loop.cc:234
#22 0xb3e636b4 in RunHandler (this=0xbecb6050) at ipc/chromium/src/base/message_loop.cc:227
#23 MessageLoop::Run (this=this@entry=0xbecb6050) at ipc/chromium/src/base/message_loop.cc:201
#24 0xb4c6058e in XRE_InitChildProcess (aArgc=<optimized out>, aArgv=<optimized out>, aGMPLoader=<optimized out>) at toolkit/xre/nsEmbedFunctions.cpp:621
#25 0xb3f9aaee in content_process_main (argc=8, argc@entry=9, argv=argv@entry=0xb680c550) at ipc/contentproc/plugin-container.cpp:237
#26 0xb3e7393c in mozilla::ipc::ProcLoaderLoadRunner::DoWork (this=<optimized out>) at ipc/glue/ProcessUtils_linux.cpp:434
#27 0xb3e77e9c in ProcLoaderServiceRun (aReservedFds=..., aArgv=<optimized out>, aArgc=1, aFd=<optimized out>, aPeerPid=13831) at ipc/glue/ProcessUtils_linux.cpp:593
#28 XRE_ProcLoaderServiceRun (aPeerPid=13831, aFd=<optimized out>, aArgc=1, aArgv=<optimized out>, aReservedFds=...) at ipc/glue/ProcessUtils_linux.cpp:627
#29 0xb6f4f30a in RunProcesses (aReservedFds=..., argv=0xbecb6be4, argc=1) at b2g/app/B2GLoader.cpp:219
#30 main (argc=1, argv=0xbecb6be4) at b2g/app/B2GLoader.cpp:297

while other off-main-thread accesses like the following we don't really care about in the test case:

#0  mozilla::ipc::ProcessLink::Open (this=this@entry=0xb29b6e00, aTransport=aTransport@entry=0xb29bb528, aIOLoop=<optimized out>, aIOLoop@entry=0xb2cbeb20, aSide=aSide@entry=mozilla::ipc::ChildSide) at ipc/glue/MessageLink.cpp:147
#1  0xb3e7349a in mozilla::ipc::MessageChannel::Open (this=this@entry=0xb2986638, aTransport=aTransport@entry=0xb29bb528, aIOLoop=0xb2cbeb20, aSide=aSide@entry=mozilla::ipc::ChildSide) at ipc/glue/MessageChannel.cpp:443
#2  0xb3e83b58 in mozilla::ipc::PBackgroundChild::Open (this=this@entry=0xb2986600, aTransport=aTransport@entry=0xb29bb528, aOtherPid=aOtherPid@entry=13831, aThread=<optimized out>, aSide=aSide@entry=mozilla::ipc::ChildSide) at /mnt/SSD/data/git/flame-kk/B2G/objdir-gecko/ipc/ipdl/PBackgroundChild.cpp:113
#3  0xb411f05a in mozilla::layers::ConnectSharedBufferManagerInChildProcess (aTransport=0xb29bb528, aOtherPid=13831) at gfx/layers/ipc/SharedBufferManagerChild.cpp:105
#4  0xb3fa5f4c in DispatchToFunction<void (*)(mozilla::hal::SwitchDevice, mozilla::hal::SwitchState), mozilla::hal::SwitchDevice, mozilla::hal::SwitchState> (arg=..., function=<optimized out>) at ipc/chromium/src/base/tuple.h:458
#5  RunnableFunction<void (*)(mozilla::hal::SwitchDevice, mozilla::hal::SwitchState), Tuple2<mozilla::hal::SwitchDevice, mozilla::hal::SwitchState> >::Run (this=<optimized out>) at ipc/chromium/src/base/task.h:433
#6  0xb3e63674 in MessageLoop::RunTask (this=0xb14f9b20, task=0xb29717c0) at ipc/chromium/src/base/message_loop.cc:364
#7  0xb3e660e2 in MessageLoop::DeferOrRunPendingTask (this=<optimized out>, pending_task=...) at ipc/chromium/src/base/message_loop.cc:372
#8  0xb3e67d0e in MessageLoop::DoWork (this=0xb14f9b20) at ipc/chromium/src/base/message_loop.cc:459
#9  0xb3e63c72 in base::MessagePumpDefault::Run (this=0xb2842f28, delegate=0xb14f9b20) at ipc/chromium/src/base/message_pump_default.cc:34
#10 0xb3e63602 in MessageLoop::RunInternal (this=this@entry=0xb14f9b20) at ipc/chromium/src/base/message_loop.cc:234
#11 0xb3e636b4 in RunHandler (this=0xb14f9b20) at ipc/chromium/src/base/message_loop.cc:227
#12 MessageLoop::Run (this=this@entry=0xb14f9b20) at ipc/chromium/src/base/message_loop.cc:201
#13 0xb3e6917a in base::Thread::ThreadMain (this=0xb296f1d0) at ipc/chromium/src/base/thread.cc:170
#14 0xb3e67d3c in ThreadFunc (closure=<optimized out>) at ipc/chromium/src/base/platform_thread_posix.cc:39
#15 0xb6ee4002 in _thread_create_startup (arg=0xb2977680) at mozglue/build/Nuwa.cpp:767
#16 thread_create_startup (arg=0xb2977680) at mozglue/build/Nuwa.cpp:792
#17 0xb6e6522c in __thread_entry (func=0xb6ee3fd1 <thread_create_startup(void*)>, arg=0xb2977680, tls=0xb14f9dd0) at bionic/libc/bionic/pthread_create.cpp:105
#18 0xb6e653c4 in pthread_create (thread_out=0xb296f1d8, attr=<optimized out>, start_routine=0xb6ee3fd1 <thread_create_startup(void*)>, arg=0x78) at bionic/libc/bionic/pthread_create.cpp:224
#19 0xb2985080 in ?? ()
Assignee: nobody → cyu
Attachment #8661733 - Flags: review?(khuey)
url:        https://hg.mozilla.org/integration/b2g-inbound/rev/15cc3c9efd9d0d615edbd2da1b88e8b6f1fa4463
changeset:  15cc3c9efd9d0d615edbd2da1b88e8b6f1fa4463
user:       Cervantes Yu <cyu@mozilla.com>
date:       Thu Sep 17 14:40:23 2015 +0800
description:
Bug 1204405: Don't access prefs off main thread in testing ProcessLink::Open(). r=khuey
https://hg.mozilla.org/mozilla-central/rev/15cc3c9efd9d
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla43
You need to log in before you can comment on or make changes to this bug.