Closed Bug 407053 Opened 17 years ago Closed 17 years ago

"Assertion failure: (cx)->requestDepth || (cx)->thread == (cx)->runtime->gcThread" with document.execCommand('copy', ...)

Categories

(Core :: DOM: Core & HTML, defect, P2)

defect

Tracking

()

RESOLVED FIXED
mozilla1.9beta3

People

(Reporter: jruderman, Assigned: peterv)

References

Details

(Keywords: assertion, testcase)

Attachments

(3 files)

Attached file testcase
Loading the testcase triggers:

Assertion failure: (cx)->requestDepth || (cx)->thread == (cx)->runtime->gcThread, at /Users/jruderman/trunk/mozilla/js/src/jsapi.c:5061

Stack trace:
  JS_Assert
  JS_InternString
  nsHTMLDocument::DoClipboardSecurityCheck
  nsHTMLDocument::ExecCommand
  NS_InvokeByIndex_P
  ...
Flags: blocking1.9?
Attachment #291755 - Attachment mime type: application/xhtml+xml → text/html
Attached patch v1Splinter Review
Attachment #291765 - Flags: superreview?(jst)
Attachment #291765 - Flags: review?(jst)
Comment on attachment 291765 [details] [diff] [review]
v1

     JSContext *cx = nsnull;
     stack->Peek(&cx);
 
+    JSAutoRequest ar(cx);

We should have code here that makes sure cx is non-null, and probably return an error if it's null (to be on the safe side).

r+sr=jst with that.
Attachment #291765 - Flags: superreview?(jst)
Attachment #291765 - Flags: superreview+
Attachment #291765 - Flags: review?(jst)
Attachment #291765 - Flags: review+
Clearing blocker request as this already has approval.
Flags: blocking1.9?
i can trigger this assertion/abort in another function with another testcase.

Assertion failure: (cx)->requestDepth || (cx)->thread == (cx)->runtime->gcThread, at firefox-cvs/mozilla/js/src/jsapi.c:4063
firefox-cvs/mozilla/fb-opt-static/dist/bin/run-mozilla.sh: line 131:  3051 Trace/breakpoint trap   "$prog" ${1+"$@"}

is this different bug?
same assertion in JS_GetReservedSlot is Bug 410486
(In reply to comment #2)
> We should have code here that makes sure cx is non-null, and probably return an
> error if it's null (to be on the safe side).

Actually, I don't see why calling ExecCommand for the clipboard commands without JS on the stack should throw an error, so I'm making it return NS_OK if cx is null. Let me know if you disagree with that.
Checked in (with crashtest).
Status: NEW → RESOLVED
Closed: 17 years ago
Flags: in-testsuite+
OS: Mac OS X → All
Priority: -- → P2
Hardware: PC → All
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9 M11
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: