Closed Bug 181160 Opened 19 years ago Closed 14 years ago

ASSERTION: nsStandardURL not thread-safe: 'owningThread == NS_CurrentThread()', file i:/build/mozilla/xpcom/glue/

Categories

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

x86
Windows 2000
defect

Tracking

(Not tracked)

RESOLVED FIXED
mozilla1.9beta1

People

(Reporter: timeless, Assigned: mossop)

References

Details

(Keywords: assertion)

Attachments

(1 file)

cvs build from today w/ de-AT localiation from a few days ago.
ran mozilla
installed latest de-AT from mozilla.kairo.at

*** Chrome Registration of locale : Checking for contents.rdf at
jar:resource:/chrome/de-win.jar!/locale/de-AT/global-pl
atform/
Parse Time (this=042990E0): Real time 0:0:0.10, CP time 0.010
DTD Time: Real time 0:0:0.0, CP time 0.000
Tokenize Time: Real time 0:0:0.0, CP time 0.000
*** Chrome Registration of locale : Checking for contents.rdf at
jar:resource:/chrome/de-win.jar!/locale/de-AT/communica
tor-platform/
Parse Time (this=04299900): Real time 0:0:0.0, CP time 0.000
DTD Time: Real time 0:0:0.0, CP time 0.000
Tokenize Time: Real time 0:0:0.0, CP time 0.000
###!!! ASSERTION: nsStandardURL not thread-safe: 'owningThread ==
NS_CurrentThread()', file i:/build/mozilla/xpcom/glue/
nsDebug.cpp, line 533

	owningThread	0x00282800
By inspection, that turns out to be the main thread.

-	this	0x01047130
\-	mSpec	{...}
 \-	nsStr	{...}
  \+	mStr	0x01047228 "file:///I:/build/mozilla/debug-i686-pc-cygwin/dist/bin/"

NTDLL! 77f9f9df()
nsDebug::Assertion(const char * 0x016c1e04, const char * 0x10133790, const char
* 0x10133768, int 533) line 280 + 13 bytes
NS_CheckThreadSafe(void * 0x00282800, const char * 0x016c1e04) line 533 + 34 bytes
nsStandardURL::AddRef(nsStandardURL * const 0x01047130) line 801 + 76 bytes
ns_if_addref(nsISupports * 0x01047130) line 118 + 18 bytes
nsSupportsHashtable::Get(nsHashKey * 0x04f4ef90) line 924 + 15 bytes
nsResProtocolHandler::GetSubstitution(nsResProtocolHandler * const 0x01031da8,
const char * 0x04f4f0ac, nsIURI * * 0x04f4f044) line 274 + 16 bytes
nsResProtocolHandler::ResolveURI(nsResProtocolHandler * const 0x01031da8, nsIURI
* 0x04296fe0, nsACString & {...}) line 303 + 89 bytes
nsResURL::GetFile(nsResURL * const 0x04296fe0, nsIFile * * 0x04299448) line 93 +
25 bytes
nsJARChannel::EnsureJARFileAvailable() line 309 + 62 bytes
nsJARChannel::Open(nsJARChannel * const 0x042993d0, nsIInputStream * *
0x04f4f24c) line 248 + 8 bytes
NS_OpenURI(nsIInputStream * * 0x04f4f2a8, nsIURI * 0x04299730, nsIIOService *
0x00000000, nsILoadGroup * 0x00000000, nsIInterfaceRequestor * 0x00000000,
unsigned int 0) line 206 + 27 bytes
nsStringBundle::LoadProperties() line 125 + 46 bytes
nsStringBundle::GetStringFromName(nsStringBundle * const 0x0428c2d8, const
unsigned short * 0x04e33858, unsigned short * * 0x04f4f3c0) line 255 + 8 bytes
GetTranslatedString(const unsigned short * 0x04e33858) line 2560 + 31 bytes
nsInstall::Alert(nsString & {...}) line 2574 + 48 bytes
InstallAlert(JSContext * 0x041aa768, JSObject * 0x042720e0, unsigned int 1, long
* 0x0429205c, long * 0x04f4f554) line 1650
js_Invoke(JSContext * 0x041aa768, unsigned int 1, unsigned int 0) line 839 + 23
bytes
js_Interpret(JSContext * 0x041aa768, long * 0x04f4ff28) line 2803 + 15 bytes
js_Execute(JSContext * 0x041aa768, JSObject * 0x042720e0, JSScript * 0x0428e520,
JSStackFrame * 0x00000000, unsigned int 0, long * 0x04f4ff28) line 1020 + 13 bytes
JS_EvaluateUCScriptForPrincipals(JSContext * 0x041aa768, JSObject * 0x042720e0,
JSPrincipals * 0x00000000, const unsigned short * 0x04277748, unsigned int
10030, const char * 0x00000000, unsigned int 0, long * 0x04f4ff28) line 3382 +
25 bytes
JS_EvaluateUCScript(JSContext * 0x041aa768, JSObject * 0x042720e0, const
unsigned short * 0x04277748, unsigned int 10030, const char * 0x00000000,
unsigned int 0, long * 0x04f4ff28) line 3364 + 35 bytes
JS_EvaluateScript(JSContext * 0x041aa768, JSObject * 0x042720e0, const char *
0x04245c90, unsigned int 10030, const char * 0x00000000, unsigned int 0, long *
0x04f4ff28) line 3331 + 33 bytes
RunInstallOnThread(void * 0x04198330) line 437 + 30 bytes
_PR_NativeRunThread(void * 0x041e0120) line 433 + 13 bytes
MSVCRTD! 1020c323()
KERNEL32! 77e92ca8()
the problem is with NS_OpenURI being called on a background thread.  NS_OpenURI
(along with most of Necko's API) can only be called from the main thread.
GetTranslatedString() in nsInstall.cpp needs to move to nsXPIProxy.cpp
Keywords: helpwanted
Blocks: 285337
No longer blocks: 285337
*** Bug 285337 has been marked as a duplicate of this bug. ***
Status: UNCONFIRMED → NEW
Ever confirmed: true
Priority: -- → P5
Not positive the assertion I see now is exactly the same as the one it used to be, but it's an assertion, it's from installing extensions and it's threadsafety issues with xpinstall so let's run with it.

Turns out these two nsIURIs on nsInstallInfo have no use, aren't threadsafe and are created on one thread and released on another. So let's just drop them.

After this the only assertion I see from extension installs is bug 339754
Assignee: dveditz → dtownsend
Status: NEW → ASSIGNED
Attachment #279914 - Flags: review?(dveditz)
Comment on attachment 279914 [details] [diff] [review]
drop unused member variables

r=dveditz
Attachment #279914 - Flags: review?(dveditz) → review+
Comment on attachment 279914 [details] [diff] [review]
drop unused member variables

Seeking approval. This removes some ultimately unused fields that are only causing assertions in debug builds.
Attachment #279914 - Flags: approval1.9?
Comment on attachment 279914 [details] [diff] [review]
drop unused member variables

Tasty code removal!  a=bzbarsky
Attachment #279914 - Flags: approval1.9? → approval1.9+
This was checked in and I'm no longer seeing assertions from nsStandardURL during extension installs anymore so I'm going to resolve this as fixed.
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Keywords: helpwanted
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9 M9
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.