Assertion failure: !js::IsInnerObject(obj) when using CPOW Xray waiver around window

RESOLVED FIXED in mozilla36

Status

()

Core
XPConnect
RESOLVED FIXED
3 years ago
3 years ago

People

(Reporter: billm, Assigned: billm)

Tracking

unspecified
mozilla36
x86_64
Linux
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

I have a testcase in bug 1072467 that does this:
      is(browser.contentWindow.wrappedJSObject.global, 3, "global available on document");

With the patch in bug 1065811 I'm getting this assertion:

Assertion failure: !js::IsInnerObject(obj), at /home/billm/moz/in1/js/xpconnect/wrappers/WrapperFact
ory.cpp:573
xpc::WrapperFactory::WaiveXrayAndWrap(JSContext*, JS::MutableHandle<JSObject*>) (/home/billm/moz/in1
/js/xpconnect/wrappers/WrapperFactory.cpp:573 (discriminator 1))
mozilla::jsipc::JavaScriptShared::findObjectById(JSContext*, mozilla::jsipc::ObjectId const&) (/home
/billm/moz/in1/js/ipc/JavaScriptShared.cpp:401)
mozilla::jsipc::WrapperAnswer::AnswerInstanceOf(mozilla::jsipc::ObjectId const&, mozilla::jsipc::JSI
ID const&, mozilla::jsipc::ReturnStatus*, bool*) (/home/billm/moz/in1/js/ipc/WrapperAnswer.cpp:594)
mozilla::jsipc::JavaScriptBase<mozilla::jsipc::PJavaScriptChild>::AnswerInstanceOf(unsigned long con
st&, mozilla::jsipc::JSIID const&, mozilla::jsipc::ReturnStatus*, bool*) (/home/billm/moz/in1/js/ipc
/JavaScriptBase.h:108)

Can you help, Bobby? It sounds like maybe we just need to outerize somewhere?
Flags: needinfo?(bobbyholley)
Also, I need to remember to fix the test in bug 1072467 once this is fixed.
Yeah, we just need a call to JS_ObjectToOuterObject right before the WaiveXrayAndWrap in JavascriptShared.cpp. r=me on that.
Flags: needinfo?(bobbyholley)
Unfortunately that seems to trigger a compartment mismatch in test_cpows.xul. I'll try to look into it soon.
Created attachment 8515337 [details] [diff] [review]
add-waiver-outerize

I was mistaken about what the problem was here. I think this should work.
Assignee: nobody → wmccloskey
Status: NEW → ASSIGNED
Attachment #8515337 - Flags: review?(bobbyholley)
Attachment #8515337 - Flags: review?(bobbyholley) → review+
https://hg.mozilla.org/mozilla-central/rev/0e314ec744be
Status: ASSIGNED → RESOLVED
Last Resolved: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla36
You need to log in before you can comment on or make changes to this bug.