Closed Bug 61558 Opened 24 years ago Closed 24 years ago

Locale Factories not threadsafe!

Categories

(Core :: Internationalization: Localization, defect, P3)

x86
Windows NT
defect

Tracking

()

RESOLVED FIXED
mozilla0.8

People

(Reporter: dougt, Assigned: nhottanscp)

Details

Attachments

(1 file)

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!
gagan can you please review?
rchen can you please approve?
Keywords: patch
Summary: nsIWin32LocaleFactory not threadsafe! → Locale Factories not threadsafe!
Reassigned to ftang.
cc Naoki.
Assignee: rchen → ftang
Isn't frank on vacation/sabatical??  Assigning back to myself.

Jud, can you r=?
Assignee: ftang → dougt
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?
All factories should be threadsafe.  Note that the generic factories are:

http://lxr.mozilla.org/seamonkey/source/xpcom/components/nsGenericFactory.cpp#41
Frank, please look at this.  Patch is ready to go.
Assignee: dougt → ftang
reassign this to nhotta.
sorry, nhotta, please maintain the locale code . Thanks.
Assignee: ftang → nhotta
r=nhotta, the same fix has been applied to unix and mac.
nsLocaleFactoryUnix.cpp, rev1.11
nsLocaleFactoryMac.cpp, rev=1.11

sr=mscott
Status: NEW → ASSIGNED
Target Milestone: --- → mozilla0.8
checked in
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
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.

Attachment

General

Created:
Updated:
Size: