Closed
Bug 1506736
Opened 7 years ago
Closed 7 years ago
Assertion failure: clasp->specDefined(), at js/xpconnect/wrappers/XrayWrapper.cpp:611
Categories
(Core :: XPConnect, defect)
Tracking
()
RESOLVED
FIXED
mozilla65
Tracking | Status | |
---|---|---|
firefox65 | --- | fixed |
People
(Reporter: robwu, Assigned: bzbarsky)
References
Details
Attachments
(1 file)
I'm hitting a debug assertion failure when I follow the following steps:
1. Start a debug build of Firefox.
2. Visit about:debugging and select the checkbox to ensure that Chrome debugging is enabled.
3. Open the global JS console (Ctrl-Shift-J)
4. Enter the following snippet (more info at the end):
Cu.Sandbox(null).Number.xxx
5. Press Enter to run it.
Expected result:
- undefined (=value of property xxx of Number; xxx could be anything, it doesn't matter)
Actual result:
- Assertion failure: clasp->specDefined(), at js/xpconnect/wrappers/XrayWrapper.cpp:611
#01: xpc::XrayWrapper<js::CrossCompartmentWrapper, xpc::JSXrayTraits>::getOwnPropertyDescriptor(JSContext*, JS::Handle<JSObject*>, JS::Handle<jsid>, JS::MutableHandle<JS::PropertyDescriptor>) const (js/xpconnect/wrappers/XrayWrapper.cpp:2119)
#02: js::BaseProxyHandler::hasOwn(JSContext*, JS::Handle<JSObject*>, JS::Handle<jsid>, bool*) const (js/src/proxy/BaseProxyHandler.cpp:92)
#03: js::Proxy::getInternal(JSContext*, JS::Handle<JSObject*>, JS::Handle<JS::Value>, JS::Handle<jsid>, JS::MutableHandle<JS::Value>) (js/src/proxy/Proxy.cpp:369)
Links to sources:
[0]: https://searchfox.org/mozilla-central/rev/06d5d5ae4396be85f26e8548323ee6c12e7bce4e/js/xpconnect/wrappers/XrayWrapper.cpp#611
[1]: https://searchfox.org/mozilla-central/rev/06d5d5ae4396be85f26e8548323ee6c12e7bce4e/js/xpconnect/wrappers/XrayWrapper.cpp#2008
[2]: https://searchfox.org/mozilla-central/rev/7f7c353e969e61a6a85201cc8ad3c3de12ac30d8/js/src/proxy/BaseProxyHandler.cpp#92
[3]: https://searchfox.org/mozilla-central/rev/7f7c353e969e61a6a85201cc8ad3c3de12ac30d8/js/src/proxy/Proxy.cpp#369
clasp has the JSProto_Number type at the assertion failure.
I found the type listed at [66] along with other types.
The assertion passes when I use one of the types with InitViaClassSpec (e.g. Array, Object, RegExp, Date, Promise, Uint8Array, ...) or JSON, Math, Reflect or Intl.
The assertion fails when I use: Boolean, Number, String, Proxy, WeakMap, Symbol, WeakSet.
[66]: https://searchfox.org/mozilla-central/rev/7f7c353e969e61a6a85201cc8ad3c3de12ac30d8/js/public/ProtoKey.h#66
Reporter | ||
Comment 1•7 years ago
|
||
Based on the stack, I think that bug 1304918 could originally have been caused by this bug.
I can see that the spec is indeed unset for the types at the end of comment #0.
Though I'm not sure what should be done here.
The assertion was introduced in bug 1243824 - https://searchfox.org/mozilla-central/diff/5289b5b26f910a100dea64c0448271a7f1eaaa4c/js/xpconnect/wrappers/XrayWrapper.cpp#869
Bobby, why is this assertion here? What should be done here?
![]() |
Assignee | |
Comment 2•7 years ago
|
||
Xrayable classes are expected to have a ClassSpec. That's what that assertion is trying to assert.
That said, Number is not Xrayable. Presumably ShouldResolveStaticProperties should only return true if IsJSXraySupported() for the relevant protokey...
Assignee: nobody → bzbarsky
Flags: needinfo?(bobbyholley)
![]() |
Assignee | |
Comment 3•7 years ago
|
||
![]() |
Assignee | |
Updated•7 years ago
|
Updated•7 years ago
|
Attachment #9024729 -
Attachment description: Bug 1506736. Don't try to Xray statics on JS builtin constructors that we don't normally support Xrays for. r=bholley → Bug 1506736. Don't try to Xray statics on JS builtin constructors that we don't normally support Xrays for. r=bholley
Pushed by bzbarsky@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/c64e836cd9ef
Don't try to Xray statics on JS builtin constructors that we don't normally support Xrays for. r=bholley
![]() |
||
Comment 5•7 years ago
|
||
bugherder |
Status: NEW → RESOLVED
Closed: 7 years ago
status-firefox65:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla65
You need to log in
before you can comment on or make changes to this bug.
Description
•