Closed Bug 60303 Opened 24 years ago Closed 24 years ago

xpconnect must bracket calls to natives with JS_{Suspend,Resume}Request

Categories

(Core :: XPConnect, defect, P3)

defect

Tracking

()

VERIFIED FIXED

People

(Reporter: jband_mozilla, Assigned: jband_mozilla)

References

Details

Attachments

(1 file)

see: "Additional Comments From brendan@mozilla.org 2000-11-15 23:04" in bug 54743 XPConnect risks JS deadlock by calling from JS into potentially blocking native code without suspending the Request. I'll attach a proposed fix.
Attached patch proposed fixSplinter Review
Oops... fixed the comment: < // JS Requests. Calling JS_SuspendRequest with a non-zero requestDepth > // JS Requests. Calling JS_SuspendRequest with a zero requestDepth
Status: NEW → ASSIGNED
sr=brendan@mozilla.org; mccabe, can you r=? I'm optimizing an sr before an r cuz the patch is straightforward. jband, do you think JS_SuspendRequest should defend against being called not in a request? /be
Blocks: 54743
It could help find api usage errors if JS_EndRequest asserted cx->requestDepth != 0 before decrementing it. I don't think non-debug checks are good here - if the calls aren't balanced then no help form the api will really help.
Ok, I'll add that JS_EndRequest assertion to my patch in bug 54743. /be
r=mccabe. One place has a comment to the effect that the DOM breaks the rules. Does it make sense to fix this? (Would it be costly?)
fixes checked in. The DOM will stop breaking the request rules when it is converted to use xpconnect!
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
Marking Verified -
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: