Closed
Bug 265545
Opened 21 years ago
Closed 21 years ago
XPCConvert::NativeArray2JS needs to protect newborn array
Categories
(Core :: XPConnect, defect)
Core
XPConnect
Tracking
()
RESOLVED
FIXED
People
(Reporter: dbradley, Assigned: dbradley)
References
Details
(Keywords: fixed-aviary1.0, fixed1.7.5)
Attachments
(1 file)
543 bytes,
patch
|
jst
:
review+
brendan
:
superreview+
brendan
:
approval-aviary+
brendan
:
approval1.7.5+
|
Details | Diff | Splinter Review |
This function creates an array and then iterates over the native elements
potentially create more objects which may leave the newly created array
unprotected from GC. There have been crashes through this function ending in
JS_SetElemetn where the obj parameter looks to be dead.
Solution is to use AUTO_MARK_JSVAL on the array. Patch comming up shortly
Assignee | ||
Comment 1•21 years ago
|
||
I meant JS_SetElement for those searching for a function name. Well and "coming"
too but hopefully no one was searching for that.
Also timeless has a case where this crashes, so that will be a good test to see
if this helps things.
Assignee | ||
Comment 2•21 years ago
|
||
This will protect the JSArray created in XPCConvert::NativeArray2JS.
This will protect it until the function returns, it's then the caller's
responsibility. And from what I saw the callers do protect it by getting it to
someplace safe before any other major calls.
Assignee | ||
Updated•21 years ago
|
Attachment #162953 -
Flags: superreview?(brendan)
Attachment #162953 -
Flags: review?(jst)
Comment 3•21 years ago
|
||
Comment on attachment 162953 [details] [diff] [review]
Protects the newly created JSArray
r=jst
Attachment #162953 -
Flags: review?(jst) → review+
Assignee | ||
Comment 4•21 years ago
|
||
Lastly if this is sr'd can someone check this in? I haven't gotten a chance to
fix my CVS account yet.
Status: NEW → ASSIGNED
Comment 5•21 years ago
|
||
Want this on branches NOW.
/be
Flags: blocking1.7.x+
Flags: blocking-aviary1.0+
Comment 6•21 years ago
|
||
Comment on attachment 162953 [details] [diff] [review]
Protects the newly created JSArray
sr=me, approving and checking in -- thanks, dbradley.
/be
Attachment #162953 -
Flags: superreview?(brendan)
Attachment #162953 -
Flags: superreview+
Attachment #162953 -
Flags: approval1.7.x+
Attachment #162953 -
Flags: approval-aviary+
Comment 7•21 years ago
|
||
Fixed everywhere.
/be
Status: ASSIGNED → RESOLVED
Closed: 21 years ago
Keywords: fixed-aviary1.0,
fixed1.7.x
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•