Closed Bug 338028 Opened 18 years ago Closed 18 years ago

Installing extensions accesses observer service from off-thread

Categories

(Core Graveyard :: Installer: XPInstall Engine, defect)

x86
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
mozilla1.8.1beta2

People

(Reporter: bzbarsky, Assigned: mossop)

References

Details

(Keywords: fixed1.8.1)

Attachments

(2 files)

In a debug build, install http://users.blueprintit.co.uk/~dave/content/firefox/nightly/nightly-1.0.3.xpi and note the "nsObserverService not threadsafe" asserts that fire.

We should really fix this; otherwise extension install has a good shot at corrupting nsObserverService internal data structures, which would be unpleasant and might explain the free() errors I get from libc every so often while installing extensions.
Flags: blocking1.9a2?
Flags: blocking1.8.1?
Blocks: 335757
The assertion is being thrown by nsXPInstallManager's attempt to stop observing a topic. There's no danger of corrupting nsObserverService since the call simply fails when it is not on the main thread. Unfortunately ends with old nsXPInstallManagers floating around that then start trying to do things and throw strange info to the EM if a second extension is installed.

This patch simply creates a proxy to the observer service on the main thread to solve this.
Assignee: xpi-engine → mossop.bugzilla
Status: NEW → ASSIGNED
Attachment #225191 - Flags: superreview?(dveditz)
Attachment #225191 - Flags: review?(dveditz)
Flags: blocking1.8.1? → blocking1.8.1+
Target Milestone: --- → mozilla1.8.1beta2
Comment on attachment 225191 [details] [diff] [review]
Create a proxy to the observer service

r/sr=dveditz
Attachment #225191 - Flags: superreview?(dveditz)
Attachment #225191 - Flags: superreview+
Attachment #225191 - Flags: review?(dveditz)
Attachment #225191 - Flags: review+
Whiteboard: [checkin needed]
mozilla/xpinstall/src/nsXPInstallManager.cpp 	1.145
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
Whiteboard: [checkin needed]
Flags: blocking1.9a2?
Attached patch Branch patchSplinter Review
This is exactly the same fix ported to the branch. The differences are caused by the nsIThreadManager landing. Since this does exactly the same as the previous patch I don't believe that there is a need to re-request review.
Attachment #230167 - Flags: superreview+
Attachment #230167 - Flags: review+
Attachment #230167 - Flags: approval1.8.1?
Comment on attachment 230167 [details] [diff] [review]
Branch patch

a=darin on behalf of drivers

NOTE:
You could also use NS_GetProxyForObject to avoid having to get the proxy object manager.
Attachment #230167 - Flags: approval1.8.1? → approval1.8.1+
Whiteboard: [checkin needed (1.8 branch)]
Checked in to MOZILLA_1_8_BRANCH
Keywords: fixed1.8.1
Whiteboard: [checkin needed (1.8 branch)]
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: