Hello, is this perhaps a bug or failure:
JS_ASSERT(SameValue(nullptr, value, other.value, &same)); How can I retrieve the JSContext for declaring RootedObjects, if the parent function is called with a nullptr as value for JSContext? Thanks Andreas Am 17.12.2013 12:51, schrieb Andreas Schlegel: > Hello Jason, > > the program exits in the RootingApi.h line 644 with a Segmentation Fault. > > 641 #ifdef JSGC_TRACK_EXACT_ROOTS > 642 js::ThingRootKind kind = js::GCMethods<T>::kind(); > 643 this->stack = &cx->thingGCRooters[kind]; > * 644 this->prev = *stack;* > 645 *stack = reinterpret_cast<Rooted<void*>*>(this); > 646 > 647 JS_ASSERT(!js::GCMethods<T>::poisoned(ptr)); > 648 #endif > > The Stacktrace gives the following Information (last call is > JS::Rooted::init()): > > JS::Rooted<JSObject*>::init<js::ContextFriendFields>() at > RootingAPI.h:644 0x4223e4 > JS::Rooted<JSObject*>::Rooted() at RootingAPI.h:667 0x41f3df > js::GetEqualityObject() at jsproxy.h:366 0x4babfe > js::StrictlyEqual() at Interpreter.cpp:729 0x4a9fcd > js::SameValue() at Interpreter.cpp:784 0x4aa2f4 > js::HashableValue::operator==() at MapObject.cpp:836 0x4d6c53 > > The problem is, that in the HashableValue::operator==() function the > Context cx was given as nullptr to SameValue(): > JS_ASSERT(SameValue(nullptr, value, other.value, &same)); > > Therefore if the Comparism is used from a MapObject with debug, I have a > Segmentation Fault, because I create a > JS::RootedObject handleEqualsObj(cx,equalsObj). > > My intention was to be similar with the other Proxy::foo and Handler > methods. Therefore I use the following attributes: > > bool Proxy::isTransparent(JSContext *cx, HandleObject proxy, bool *bp) > ScriptedDirectProxyHandler::isTransparent(JSContext *cx, HandleObject > proxy, bool *bp) > > How can I create a RootedObject without JSContext, e.g as attribute for > Proxy::isTransparent() or in > ScriptedDirectProxyHandler::isTransparent() for the direkt proxy? > > Best regards > Andreas > > Am 16.12.2013 14:57, schrieb Jason Orendorff: >> On 12/14/13 5:29 AM, Andreas Schlegel wrote: >>> Hello, >>> >>> If I run the test with folowing command: >>> ../jit-test/jit_test.py ./js self-test -o --write-failure-output >>> --write-failures /home/fedora/workspace/mozilla/jit-tests >>> >>> I've only the following Error code in the log file: >>> self-test/assertDeepEq.js >>> Exit code: -11 >>> >>> Where can I find the message for this code? >> This is a crash. >> >> Use the -s argument to jit_test.py to make the test harness print out >> the JS command line. It will probably be something long, like this: >> >> /Users/yourname/dev/mi/js/src/d-objdir/js -f >> /Users/yourname/dev/mi/js/src/jit-test/lib/prolog.js >> --js-cache-per-process --js-cache >> /Users/yourname/dev/mi/js/src/jit-test/.js-cache --baseline-eager -e >> "const platform='darwin'; const >> libdir='/Users/yourname/dev/mi/js/src/jit-test/lib/'; const >> scriptdir='/Users/yourname/dev/mi/js/src/jit-test/tests/TypedObject/'" >> -f /Users/yourname/dev/mi/js/src/jit-test/tests/TypedObject/fuzz2.js >> >> You can run that command in a debugger to observe the crash. >> >> (Make sure you're building with --enable-debug.) >> >> -j >> > _______________________________________________ dev-tech-js-engine-internals mailing list [email protected] https://lists.mozilla.org/listinfo/dev-tech-js-engine-internals

