Closed
Bug 256615
Opened 21 years ago
Closed 21 years ago
crash when calling nsIThread.state before calling nsIThread.init [@ PR_GetThreadState]
Categories
(Core :: XPCOM, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: timeless, Assigned: csthomas)
Details
(Keywords: crash)
Crash Data
Attachments
(1 file, 1 obsolete file)
2.53 KB,
patch
|
dougt
:
review+
|
Details | Diff | Splinter Review |
steps:
run xpcshell
execute:
Components.classes["@mozilla.org/thread;1"].createInstance(Components.interfaces.nsIThread).state;
actual results:
nspr4.dll!PR_GetThreadState(const PRThread * thread=0x00000000) Line 445 + 0x4 C
> xpcom.dll!nsThread::GetState(PRThreadState * result=0x0012e7c0) Line 232 +
0x9 C++
xpcom.dll!XPTC_InvokeByIndex(nsISupports * that=0x0012e944, unsigned int
methodIndex=0x00fb219c, unsigned int paramCount=0x0185b008, nsXPTCVariant *
params=0x00000008) Line 102 C++
expected results: exception (NS_ERROR_NOT_INITIALIZED)
Assignee | ||
Comment 1•21 years ago
|
||
Assignee | ||
Updated•21 years ago
|
Attachment #156820 -
Flags: review?(dougt)
Comment 2•21 years ago
|
||
hmm, lets either protect all of the methods that access mThread or add comments
to the idl that suggest calling into any other method without a successful call
to init is undefined.
Assignee | ||
Comment 3•21 years ago
|
||
<CTho> dougt: so we should add an assert then, too, since those functions
shoudln't be called, right?
<dougt> that would be nice too. let developers (using debug builds) know that
there is a problem.
I'll go through and edit all of the functions that currently break if mThread is
null.
Status: NEW → ASSIGNED
ctho: fwiw a PR_ASSERT is fatal, it will intentionally terminate the app if it fails.
Assignee | ||
Comment 5•21 years ago
|
||
So do I add a null check and no assert and early return, a null check and a
non-fatal assert and early return, or a fatal assert?
Assignee | ||
Comment 6•21 years ago
|
||
Null check, early return, no asserts.
Attachment #156820 -
Attachment is obsolete: true
Assignee | ||
Updated•21 years ago
|
Attachment #156820 -
Flags: review?(dougt)
Assignee | ||
Updated•21 years ago
|
Attachment #157019 -
Flags: review?(dougt)
Comment 7•21 years ago
|
||
Comment on attachment 157019 [details] [diff] [review]
patch v2
looks great. thanks for the fix.
Attachment #157019 -
Flags: review?(dougt) → review+
Assignee | ||
Updated•21 years ago
|
Status: ASSIGNED → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
Updated•14 years ago
|
Crash Signature: [@ PR_GetThreadState]
You need to log in
before you can comment on or make changes to this bug.
Description
•