Locale Factories not threadsafe!

RESOLVED FIXED in mozilla0.8

Status

()

P3
normal
RESOLVED FIXED
18 years ago
18 years ago

People

(Reporter: dougt, Assigned: nhottanscp)

Tracking

Trunk
mozilla0.8
x86
Windows NT
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

18 years ago
This factory is not threadsafe.  I am having problems with TestProtocol.exe.  
During shutdown, I assert here:

NTDLL! 77f7629c()
nsDebug::Assertion(const char * 0x014591b8, const char * 0x100ca54c, const char 
* 0x100ca520, int 488) line 254 + 13 bytes
NS_CheckThreadSafe(void * 0x00a064f0, const char * 0x014591b8) line 488 + 34 
bytes
nsIWin32LocaleFactory::Release(nsIWin32LocaleFactory * const 0x00a11ef0) line 
112 + 58 bytes
nsCOMPtr<nsIFactory>::assign_assuming_AddRef(nsIFactory * 0x00000000) line 472
nsCOMPtr<nsIFactory>::assign_with_AddRef(nsISupports * 0x00000000) line 849
nsCOMPtr<nsIFactory>::operator=(nsIFactory * 0x00000000) line 584
nsFactoryEntry::~nsFactoryEntry() line 236
nsFactoryEntry::`scalar deleting destructor'(unsigned int 1) + 15 bytes
nsFactoryEntry_Destroy(nsHashKey * 0x009604c0, void * 0x009605a0, void * 
0x00000000) line 256 + 28 bytes
_hashEnumerateRemove(PLHashEntry * 0x00960480, int 486, void * 0x0012fdd0) line 
369 + 26 bytes
PL_HashTableEnumerateEntries(PLHashTable * 0x00927488, int (PLHashEntry *, int, 
void *)* 0x10027f30 _hashEnumerateRemove(PLHashEntry *, int, void *), void * 
0x0012fdd0) line 413 + 15 bytes
nsHashtable::Reset(int (nsHashKey *, void *, void *)* 0x1005ee20 
nsFactoryEntry_Destroy(nsHashKey *, void *, void *), void * 0x00000000) line 385 
+ 21 bytes
nsObjectHashtable::Reset() line 628
nsObjectHashtable::~nsObjectHashtable() line 594
nsObjectHashtable::`vector deleting destructor'(unsigned int 1) + 81 bytes
nsComponentManagerImpl::Shutdown() line 352 + 33 bytes
NS_ShutdownXPCOM(nsIServiceManager * 0x00000000) line 670 + 11 bytes
main(int 2, char * * 0x00925d80) line 660 + 8 bytes
mainCRTStartup() line 338 + 17 bytes
KERNEL32! 77f1ba06()

The assertion is nsIWin32LocaleFactory not thread-safe: 'owningThread == 
NS_CurrentThread

Fix is to make this factory threadsafe and while we are at it, lets make this a 
generic module so it can benefit from any static component work we do!
(Reporter)

Comment 1

18 years ago
Created attachment 19928 [details] [diff] [review]
Makes the nsISupports of the factory threadsafe
(Reporter)

Comment 2

18 years ago
gagan can you please review?
rchen can you please approve?
Keywords: patch
Summary: nsIWin32LocaleFactory not threadsafe! → Locale Factories not threadsafe!

Comment 3

18 years ago
Reassigned to ftang.
cc Naoki.
Assignee: rchen → ftang
(Reporter)

Comment 4

18 years ago
Isn't frank on vacation/sabatical??  Assigning back to myself.

Jud, can you r=?
Assignee: ftang → dougt

Comment 5

18 years ago
well, that patch does make isupports threadsafe and will get you past the
assert, but that assert is designed to indicate possible thread ownership
problems. are we sure locale factories should be passed around from thread to
thread?
(Reporter)

Comment 6

18 years ago
All factories should be threadsafe.  Note that the generic factories are:

http://lxr.mozilla.org/seamonkey/source/xpcom/components/nsGenericFactory.cpp#41
(Reporter)

Comment 7

18 years ago
Frank, please look at this.  Patch is ready to go.
Assignee: dougt → ftang

Comment 8

18 years ago
reassign this to nhotta.
sorry, nhotta, please maintain the locale code . Thanks.
Assignee: ftang → nhotta
(Assignee)

Comment 9

18 years ago
r=nhotta, the same fix has been applied to unix and mac.
nsLocaleFactoryUnix.cpp, rev1.11
nsLocaleFactoryMac.cpp, rev=1.11

Comment 10

18 years ago
sr=mscott
(Assignee)

Updated

18 years ago
Status: NEW → ASSIGNED
Target Milestone: --- → mozilla0.8
(Assignee)

Comment 11

18 years ago
checked in
Status: ASSIGNED → RESOLVED
Last Resolved: 18 years ago
Resolution: --- → FIXED

Comment 12

18 years ago
Changed QA contact to nhotta@netscape.com.
QA Contact: teruko → nhotta
You need to log in before you can comment on or make changes to this bug.