Closed Bug 624300 Opened 15 years ago Closed 15 years ago

Attempting to initialize a storage connection from a background thread reads to an attempt to read the toolkit.storage.synchronous preference from a background thread (leading to warning "Invalid use of the preferences on a background thread")

Categories

(Core :: SQLite and Embedded Database Bindings, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 580790

People

(Reporter: ehsan.akhgari, Assigned: ehsan.akhgari)

Details

Attachments

(1 file)

Here is an example: #0 nsPrefService::CheckAndLogBackgroundThreadUse () at /Users/ehsanakhgari/moz/mozilla-central/modules/libpref/src/nsPrefService.cpp:983 #1 0x0000000100fb025d in nsPrefBranch::GetIntPref (this=0x100c39bc0, aPrefName=0x112f53433 "toolkit.storage.synchronous", _retval=0x124bb9720) at /Users/ehsanakhgari/moz/mozilla-central/modules/libpref/src/nsPrefBranch.cpp:235 #2 0x0000000100fb9f64 in nsPrefService::GetIntPref (this=0x100c2c7e0, aPrefName=0x112f53433 "toolkit.storage.synchronous", _retval=0x124bb9720) at nsPrefService.h:62 #3 0x0000000112f274d4 in mozilla::storage::Connection::initialize (this=0x12480a2f0, aDatabaseFile=0x1226b8050, aVFSName=0x0) at /Users/ehsanakhgari/moz/mozilla-central/storage/src/mozStorageConnection.cpp:474 #4 0x0000000112f214b6 in mozilla::storage::Service::OpenDatabase (this=0x11936df20, aDatabaseFile=0x1226b8050, _connection=0x124bb9af0) at /Users/ehsanakhgari/moz/mozilla-central/storage/src/mozStorageService.cpp:454 #5 0x000000011713c1ad in nsUrlClassifierDBServiceWorker::OpenDb (this=0x1226b8250) at /Users/ehsanakhgari/moz/mozilla-central/toolkit/components/url-classifier/src/nsUrlClassifierDBService.cpp:3391 #6 0x000000011713da53 in nsUrlClassifierDBServiceWorker::BeginUpdate (this=0x1226b8250, observer=0x123880c60, tables=@0x123880d20, clientKey=@0x123880d30) at /Users/ehsanakhgari/moz/mozilla-central/toolkit/components/url-classifier/src/nsUrlClassifierDBService.cpp:2921 #7 0x00000001008f97c9 in NS_InvokeByIndex_P (that=0x1226b8250, methodIndex=6, paramCount=3, params=0x123880c80) at /Users/ehsanakhgari/moz/mozilla-central/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_x86_64_unix.cpp:208 #8 0x00000001008e3f8c in nsProxyObjectCallInfo::Run (this=0x123880cd0) at /Users/ehsanakhgari/moz/mozilla-central/xpcom/proxy/src/nsProxyEvent.cpp:181 #9 0x00000001008d6bec in nsThread::ProcessNextEvent (this=0x1226b7df0, mayWait=1, result=0x124bb9e3c) at /Users/ehsanakhgari/moz/mozilla-central/xpcom/threads/nsThread.cpp:633 #10 0x000000010084de52 in NS_ProcessNextEvent_P (thread=0x1226b7df0, mayWait=1) at nsThreadUtils.cpp:250 #11 0x00000001008d7676 in nsThread::ThreadFunc (arg=0x1226b7df0) at /Users/ehsanakhgari/moz/mozilla-central/xpcom/threads/nsThread.cpp:278 #12 0x0000000100b580d7 in _pt_root (arg=0x1226b8130) at /Users/ehsanakhgari/moz/mozilla-central/nsprpub/pr/src/pthreads/ptthread.c:187 #13 0x00007fff82a29536 in _pthread_start () #14 0x00007fff82a293e9 in thread_start () This will pollute the output needlessly. We should just not ask the pref service for the preference if we're in a background thread.
Attached patch Patch (v1)Splinter Review
Assignee: nobody → ehsan
Status: NEW → ASSIGNED
Attachment #502405 - Flags: review?(sdwilsh)
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Resolution: --- → DUPLICATE
Attachment #502405 - Flags: review?(sdwilsh)
Product: Toolkit → Core
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: