Closed Bug 34170 Opened 24 years ago Closed 24 years ago

nsScriptError not thread-safe

Categories

(Core :: XPConnect, defect, P3)

x86
Windows NT
defect

Tracking

()

RESOLVED FIXED

People

(Reporter: warrensomebody, Assigned: mike+mozilla)

Details

I hit a thread-safety assertion canceling out of the mail account setup window:

NTDLL! 77f7629c()
nsDebug::Assertion(const char * 0x016a6834, const char * 0x016a681c, const char 
* 0x016a67e4, int 0x0000001f) line 189 + 13 bytes
nsDebug::PreCondition(const char * 0x016a6834, const char * 0x016a681c, const 
char * 0x016a67e4, int 0x0000001f) line 282 + 21 bytes
nsScriptError::AddRef(nsScriptError * const 0x04769390) line 31 + 36 bytes
nsScriptErrorConstructor(nsISupports * 0x00000000, const nsID & {...}, void * * 
0x0012ec1c) line 29 + 141 bytes
nsGenericFactory::CreateInstance(nsGenericFactory * const 0x04769680, 
nsISupports * 0x00000000, const nsID & {...}, void * * 0x0012ec1c) line 48
nsComponentManagerImpl::CreateInstance(nsComponentManagerImpl * const 
0x01075b20, const nsID & {...}, nsISupports * 0x00000000, const nsID & {...}, 
void * * 0x0012ec1c) line 1156 + 24 bytes
nsComponentManagerImpl::CreateInstanceByProgID(nsComponentManagerImpl * const 
0x01075b20, const char * 0x0038dbf8, nsISupports * 0x00000000, const nsID & 
{...}, void * * 0x0012ec1c) line 1196
nsComponentManager::CreateInstance(const char * 0x0038dbf8, nsISupports * 
0x00000000, const nsID & {...}, void * * 0x0012ec1c) line 94
nsCreateInstanceByProgID::operator()(const nsID & {...}, void * * 0x0012ec1c) 
line 122 + 27 bytes
nsCOMPtr<nsIScriptError>::assign_from_helper(const nsCOMPtr_helper & {...}, 
const nsID & {...}) line 825 + 18 bytes
nsCOMPtr<nsIScriptError>::nsCOMPtr<nsIScriptError>(const nsCOMPtr_helper & 
{...}) line 528
nsDocShell::ReportScriptError(nsDocShell * const 0x04065c38, const char * 
0x04769870, const char * 0x00000000, int 0x00000000, const char * 0x00000000) 
line 1939
NS_ScriptErrorReporter(JSContext * 0x04066b70, const char * 0x04769870, 
JSErrorReport * 0x0012efa4) line 101
js_ReportErrorAgain(JSContext * 0x04066b70, const char * 0x047699d0, 
JSErrorReport * 0x0012efa4) line 557 + 21 bytes
ReportError(JSContext * 0x04066b70, const char * 0x047699d0, JSErrorReport * 
0x0012efa4) line 265 + 17 bytes
js_ReportErrorNumberVA(JSContext * 0x04066b70, unsigned int 0x00000000, const 
JSErrorFormatString * (void *, const char *, const unsigned int)* 0x002a1ad7 
_js_GetErrorMessage, void * 0x00000000, const unsigned int 0x00000093, int 
0x00000001, char * 0x0012f010) line 513 + 17 bytes
JS_ReportErrorNumber(JSContext * 0x04066b70, const JSErrorFormatString * (void 
*, const char *, const unsigned int)* 0x002a1ad7 _js_GetErrorMessage, void * 
0x00000000, const unsigned int 0x00000093) line 2990 + 29 bytes
js_ReportUncaughtException(JSContext * 0x04066b70) line 661 + 25 bytes
JS_CallFunctionValue(JSContext * 0x04066b70, JSObject * 0x03134870, long 
0x01301540, unsigned int 0x00000001, long * 0x0012f100, long * 0x0012f0ac) line 
2796 + 9 bytes
nsJSContext::CallEventHandler(nsJSContext * const 0x040655f0, void * 0x03134870, 
void * 0x01301540, unsigned int 0x00000001, void * 0x0012f100, int * 0x0012f0fc) 
line 730 + 33 bytes
nsJSEventListener::HandleEvent(nsIDOMEvent * 0x04480704) line 128 + 57 bytes
nsEventListenerManager::HandleEventSubType(nsListenerStruct * 0x0418b4a0, 
nsIDOMEvent * 0x04480704, unsigned int 0x00000001, unsigned int 0x00000007) line 
703 + 19 bytes
nsEventListenerManager::HandleEvent(nsIPresContext * 0x04096690, nsEvent * 
0x0012fbcc, nsIDOMEvent * * 0x0012f514, unsigned int 0x00000007, nsEventStatus * 
0x0012fc0c) line 1266 + 35 bytes
GlobalWindowImpl::HandleDOMEvent(GlobalWindowImpl * const 0x04066d00, 
nsIPresContext * 0x04096690, nsEvent * 0x0012fbcc, nsIDOMEvent * * 0x0012f514, 
unsigned int 0x00000001, nsEventStatus * 0x0012fc0c) line 381
nsWebShell::OnEndDocumentLoad(nsWebShell * const 0x04065d14, nsIDocumentLoader * 
0x04065ab0, nsIChannel * 0x04094ca0, unsigned int 0x00000000) line 2413 + 51 
bytes
nsDocLoaderImpl::FireOnEndDocumentLoad(nsDocLoaderImpl * 0x04065ab0, nsIChannel 
* 0x04094ca0, unsigned int 0x00000000) line 620
nsDocLoaderImpl::DocLoaderIsEmpty(unsigned int 0x00000000) line 511
nsDocLoaderImpl::DocLoaderIsEmpty(unsigned int 0x00000000) line 483
nsDocLoaderImpl::OnStopRequest(nsDocLoaderImpl * const 0x04437f94, nsIChannel * 
0x04437680, nsISupports * 0x00000000, unsigned int 0x00000000, const unsigned 
short * 0x00000000) line 455
nsLoadGroup::RemoveChannel(nsLoadGroup * const 0x04436040, nsIChannel * 
0x04437680, nsISupports * 0x00000000, unsigned int 0x00000000, const unsigned 
short * 0x00000000) line 543 + 39 bytes
nsInputStreamChannel::OnStopRequest(nsInputStreamChannel * const 0x04437684, 
nsIChannel * 0x04437590, nsISupports * 0x00000000, unsigned int 0x00000000, 
const unsigned short * 0x00000000) line 473
nsOnStopRequestEvent::HandleEvent(nsOnStopRequestEvent * const 0x04438c10) line 
286
nsStreamListenerEvent::HandlePLEvent(PLEvent * 0x04438bc0) line 97 + 12 bytes
PL_HandleEvent(PLEvent * 0x04438bc0) line 563 + 10 bytes
PL_ProcessPendingEvents(PLEventQueue * 0x01449550) line 508 + 9 bytes
_md_EventReceiverProc(HWND__ * 0x01620732, unsigned int 0x0000c0bf, unsigned int 
0x00000000, long 0x01449550) line 1018 + 9 bytes
USER32! 77e71820()
After I plowed through 3 or 4 of these assertions, I realized that the mail 
compose window came up. I don't know whether I clicked the mail window icon in 
the lower left corner, or the compose window icon. I'll try to reproduce...
reassigning to mccabe - this is all his stuff.
Assignee: jband → mccabe
Above was due to not using NS_IMPL_THREADSAFE_ADDREF - fixed now.

I also made nsConsoleService.cpp threadsafe, I hope.
Status: NEW → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
Are you sure it's ok to be manipulating these objects from another thread?
I think so... as for nsConsoleService, I went over it with a fine-toothed comb. 
nsScriptError, maybe not quite.  It's a big set of getters and a single 'init'
function.  It isn't safe to call getters while re-initing to another set of
values, but I don't think this is a problem, as initing is currently only done
at construction time.  If it's important for nsScriptError to be strictly
thread-safe, I could lock around these methods... but I don't think it is.
You need to log in before you can comment on or make changes to this bug.