The default bug view has changed. See this FAQ.

XPC_NW_NewResolve should root its cloned function object

RESOLVED FIXED

Status

()

Core
XPConnect
P1
normal
RESOLVED FIXED
11 years ago
11 years ago

People

(Reporter: dbaron, Assigned: dbaron)

Tracking

({fixed1.8.0.4, fixed1.8.1})

Trunk
x86
Linux
fixed1.8.0.4, fixed1.8.1
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [patch])

Attachments

(1 attachment)

(Assignee)

Description

11 years ago
XPC_NW_NewResolve clones a function object and passes it to WrapFunction, which creates another function, which means the first one can be destroyed:

js_GC (/builds/trunk/mozilla/js/src/jsgc.c:1947)
js_NewGCThing (/builds/trunk/mozilla/js/src/jsgc.c:635)
js_NewObject (/builds/trunk/mozilla/js/src/jsobj.c:2008)
js_NewFunction (/builds/trunk/mozilla/js/src/jsfun.c:2030)
JS_NewFunction (/builds/trunk/mozilla/js/src/jsapi.c:3403)
WrapFunction (/builds/trunk/mozilla/js/src/xpconnect/src/XPCNativeWrapper.cpp:236)
XPC_NW_NewResolve (/builds/trunk/mozilla/js/src/xpconnect/src/XPCNativeWrapper.cpp:860)
(Assignee)

Comment 1

11 years ago
Created attachment 212311 [details] [diff] [review]
possible patch

Not sure whether this is the best approach, but it works.
Attachment #212311 - Flags: review?(jst)
(Assignee)

Updated

11 years ago
Assignee: dbradley → dbaron
Priority: -- → P1
Whiteboard: [patch]
(Assignee)

Updated

11 years ago
Attachment #212311 - Flags: superreview?(brendan)
Comment on attachment 212311 [details] [diff] [review]
possible patch

Sure, that will work and seems necessary in general (alas).

Again it might be better to root as soon as possible, so even before the DEBUG_XPCNativeWrapper paragraph.

/be
Attachment #212311 - Flags: superreview?(brendan) → superreview+
Comment on attachment 212311 [details] [diff] [review]
possible patch

r=jst
Attachment #212311 - Flags: review?(jst) → review+
(Assignee)

Comment 4

11 years ago
Checked in to trunk.
(Assignee)

Updated

11 years ago
Status: NEW → RESOLVED
Last Resolved: 11 years ago
Resolution: --- → FIXED
(Assignee)

Updated

11 years ago
Attachment #212311 - Flags: approval1.8.0.3?
Attachment #212311 - Flags: approval-branch-1.8.1?(jst)

Updated

11 years ago
Attachment #212311 - Flags: approval-branch-1.8.1?(jst) → approval-branch-1.8.1+
(Assignee)

Comment 5

11 years ago
Checked in to MOZILLA_1_8_BRANCH.
Keywords: fixed1.8.1

Comment 6

11 years ago
Comment on attachment 212311 [details] [diff] [review]
possible patch

Please check in promptly on the 1.8.0 branch.  Thanks!
Attachment #212311 - Flags: approval1.8.0.3? → approval1.8.0.3+
(Assignee)

Comment 7

11 years ago
Fix checked in to MOZILLA_1_8_0_BRANCH.
Keywords: fixed1.8.0.3
You need to log in before you can comment on or make changes to this bug.