64 bit gjs (but not 32 bit) seems to be causing a startup crash in gnome-shell
Hi This is odd, as if I build the same revisions of everything in my 32 bit chroot, I don't get this crash but the ones in the* 64 bit chroot* (built by the same scripts), gnome-shell crashes here.
I opened up gnome-shell#2600 (closed) but it seems to be more of an issue with gjs looking at all the frames I use the same build arguments to libmozjs that jhbuild does, and the same .tar.gz source, as well as a newer 68.x that Debian seems to package https://salsa.debian.org/gnome-team/mozjs68.git/
I have the stack trace attached if helpful stacktrace.txt Thanks
Thread 1 "gnome-shell" received signal SIGSEGV, Segmentation fault.
mozilla::LinkedListElement<JS::PersistentRooted<void*> >::setPreviousUnsafe (this=0x555d5ef1b288, aElem=aElem@entry=0x555555b77be0)
at /srcbuild/libmozjs/build/dist/include/mozilla/LinkedList.h:334
334 /srcbuild/libmozjs/build/dist/include/mozilla/LinkedList.h: No such file or directory.
(gdb) bt
#0 mozilla::LinkedListElement<JS::PersistentRooted<void*> >::setPreviousUnsafe (this=0x555d5ef1b288, aElem=aElem@entry=0x555555b77be0)
at /srcbuild/libmozjs/build/dist/include/mozilla/LinkedList.h:334
#1 mozilla::LinkedList<JS::PersistentRooted<void*> >::insertBack (aElem=aElem@entry=0x555555b77be0, this=<optimized out>)
at /srcbuild/libmozjs/build/dist/include/mozilla/LinkedList.h:447
#2 JS::AddPersistentRoot (cx=cx@entry=0x5555559cbaf0, kind=<optimized out>, kind@entry=JS::RootKind::Object, root=root@entry=0x555555b77be0)
at /srcbuild/libmozjs/js/src/gc/RootMarking.cpp:591
#3 0x00007ffff7270df5 in JS::PersistentRooted<JSObject*>::registerWithRootLists (cx=0x5555559cbaf0, this=0x555555b77be0)
at /opt/include/mozjs-68/js/RootingAPI.h:1300
#4 JS::PersistentRooted<JSObject*>::PersistentRooted<JSObject* const&> (initial=@0x7fffffffcd78: 0xee58289080, cx=0x5555559cbaf0,
this=0x555555b77be0) at /opt/include/mozjs-68/js/RootingAPI.h:1335
#5 std::make_unique<JS::PersistentRooted<JSObject*>, JSContext*&, JSObject* const&> () at /usr/include/c++/8/bits/unique_ptr.h:831
#6 GjsMaybeOwned<JSObject*>::root (this=0x555555b722e8, cx=0x5555559cbaf0, thing=@0x7fffffffcd78: 0xee58289080, notify=0x0, data=0x0)
at ../gjs/jsapi-util-root.h:254
#7 0x00007ffff7270f84 in GjsMaybeOwned<JSObject*>::switch_to_rooted (this=this@entry=0x555555b722e8, cx=cx@entry=0x5555559cbaf0,
notify=notify@entry=0x0, data=data@entry=0x0) at /opt/include/mozjs-68/js/RootingAPI.h:1086
#8 0x00007ffff726c44d in ObjectInstance::switch_to_rooted (cx=0x5555559cbaf0, this=0x555555b722d0) at ../gi/object.h:376
#9 ObjectInstance::ensure_uses_toggle_ref (this=0x555555b722d0, cx=0x5555559cbaf0) at ../gi/object.cpp:1434
#10 0x00007ffff726c6a9 in ObjectBase::associate_closure (this=0x555555b722d0, cx=0x5555559cbaf0, closure=0x555555bda9a0)
at ../gi/object.cpp:1799
#11 0x00007ffff726c85d in ObjectInstance::connect_impl (this=0x555555b722d0, context=<optimized out>, args=..., after=after@entry=false)
at ../gi/object.cpp:1870
#12 0x00007ffff726c99a in ObjectBase::connect (cx=<optimized out>, argc=<optimized out>, vp=<optimized out>) at ../gi/object.cpp:1821
#13 0x00007ffff49f0a7d in CallJSNative (cx=0x5555559cbaf0,
native=0x7ffff726c8e2 <ObjectBase::connect(JSContext*, unsigned int, JS::Value*)>, args=...)
at /srcbuild/libmozjs/js/src/vm/Interpreter.cpp:443
#14 js::InternalCallOrConstruct (cx=0x5555559cbaf0, args=..., construct=<optimized out>) at /srcbuild/libmozjs/js/src/vm/Interpreter.cpp:535
#15 0x00007ffff49e860f in js::CallFromStack (cx=0x5555559cbaf0, args=...) at /srcbuild/libmozjs/js/src/vm/Interpreter.cpp:594
#16 Interpret (cx=<optimized out>, state=...) at /srcbuild/libmozjs/js/src/vm/Interpreter.cpp:3082
#17 0x00007ffff49dc7d1 in js::RunScript (cx=0x5555559cbaf0, state=...) at /srcbuild/libmozjs/js/src/vm/Interpreter.cpp:423
#18 0x00007ffff49f1d16 in js::ExecuteKernel (cx=0x5555559cbaf0, script=..., envChainArg=..., newTargetValue=..., evalInFrame=...,
result=0x448) at /srcbuild/libmozjs/js/src/vm/Interpreter.cpp:782
#19 0x00007ffff49f1eda in js::Execute (cx=0x5555559cbaf0, script=..., envChainArg=..., rval=0x7fffffffda08)
at /srcbuild/libmozjs/js/src/vm/Interpreter.cpp:815
#20 0x00007ffff4a9e3c0 in EvaluateSourceBuffer<char16_t> (cx=0x5555559cbaf0, scopeKind=<optimized out>, env=..., optionsArg=..., srcBuf=...,
rval=...) at /srcbuild/libmozjs/js/src/vm/CompilationAndEvaluation.cpp:541
#21 0x00007ffff4a9ea42 in JS::Evaluate (cx=0x5555559cbaf0, envChain=..., envChain@entry=..., options=..., srcBuf=..., rval=rval@entry=...)
at /srcbuild/libmozjs/js/src/vm/CompilationAndEvaluation.cpp:595
#22 0x00007ffff727efd3 in GjsContextPrivate::eval_with_scope (this=this@entry=0x5555555f4350, scope_object=..., scope_object@entry=...,
script=script@entry=0x7ffff7da5d75 "imports.ui.environment.init();imports.ui.main.start();", script_len=script_len@entry=-1,
filename=filename@entry=0x7ffff7da5d6e "<main>", retval=..., retval@entry=...) at /opt/include/mozjs-68/js/RootingAPI.h:1212
#23 0x00007ffff727f243 in GjsContextPrivate::eval (this=0x5555555f4350,
script=script@entry=0x7ffff7da5d75 "imports.ui.environment.init();imports.ui.main.start();", script_len=script_len@entry=-1,
filename=filename@entry=0x7ffff7da5d6e "<main>", exit_status_p=exit_status_p@entry=0x7fffffffdb04, error=error@entry=0x7fffffffdb08)
--Type <RET> for more, q to quit, c to continue without paging--
at /opt/include/mozjs-68/js/RootingAPI.h:1238
#24 0x00007ffff727f4c6 in gjs_context_eval (js_context=0x5555555f4440,
script=0x7ffff7da5d75 "imports.ui.environment.init();imports.ui.main.start();", script_len=-1, filename=0x7ffff7da5d6e "<main>",
exit_status_p=0x7fffffffdb04, error=0x7fffffffdb08) at ../gjs/context.cpp:934
#25 0x00007ffff7d8f77d in gnome_shell_plugin_start () from /opt/lib/x86_64-linux-gnu/gnome-shell/libgnome-shell.so
#26 0x00007ffff6ffb729 in meta_plugin_manager_new () from /opt/lib/x86_64-linux-gnu/libmutter-7.so.0
#27 0x00007ffff6ff5ae7 in meta_compositor_manage () from /opt/lib/x86_64-linux-gnu/libmutter-7.so.0
#28 0x00007ffff700c87f in meta_display_open () from /opt/lib/x86_64-linux-gnu/libmutter-7.so.0
#29 0x00007ffff7014137 in meta_run () from /opt/lib/x86_64-linux-gnu/libmutter-7.so.0
#30 0x00005555555568e1 in main ()
Valgrind is able to detect something too, but under Valgrind, it doesn't crash, but it shows this warning instead
==3585== Thread 11 JS Helper:
==3585== Conditional jump or move depends on uninitialised value(s)
==3585== at 0x7BFC61A: js::jit::LIRGenerator::visitBlock(js::jit::MBasicBlock*) (js/src/jit/Lowering.cpp:4883)
==3585== by 0x7BFC884: js::jit::LIRGenerator::generate() (js/src/jit/Lowering.cpp:4957)
==3585== by 0x7B55806: js::jit::GenerateLIR(js::jit::MIRGenerator*) (js/src/jit/Ion.cpp:1652)
==3585== by 0x7B561B8: js::jit::CompileBackEnd(js::jit::MIRGenerator*) (js/src/jit/Ion.cpp:1754)
==3585== by 0x7B62B04: js::jit::IonBuilder::runTask() (js/src/jit/IonBuilder.cpp:1138)
==3585== by 0x7667ACF: js::HelperThread::handleIonWorkload(js::AutoLockHelperThreadState&) (js/src/vm/HelperThreads.cpp:2052)
==3585== by 0x76674C4: js::HelperThread::threadLoop() (js/src/vm/HelperThreads.cpp:2461)
==3585== by 0x76735C9: callMain<0> (js/src/threading/Thread.h:239)
==3585== by 0x76735C9: js::detail::ThreadTrampoline<void (&)(void*), js::HelperThread*>::Start(void*) (js/src/threading/Thread.h:232)
==3585== by 0x6B85FA2: start_thread (pthread_create.c:486)
==3585== by 0x59904CE: clone (clone.S:95)
==3585==
==3585== Conditional jump or move depends on uninitialised value(s)
==3585== at 0x7BFC887: js::jit::LIRGenerator::generate() (js/src/jit/Lowering.cpp:4957)
==3585== by 0x7B55806: js::jit::GenerateLIR(js::jit::MIRGenerator*) (js/src/jit/Ion.cpp:1652)
==3585== by 0x7B561B8: js::jit::CompileBackEnd(js::jit::MIRGenerator*) (js/src/jit/Ion.cpp:1754)
==3585== by 0x7B62B04: js::jit::IonBuilder::runTask() (js/src/jit/IonBuilder.cpp:1138)
==3585== by 0x7667ACF: js::HelperThread::handleIonWorkload(js::AutoLockHelperThreadState&) (js/src/vm/HelperThreads.cpp:2052)
==3585== by 0x76674C4: js::HelperThread::threadLoop() (js/src/vm/HelperThreads.cpp:2461)
==3585== by 0x76735C9: callMain<0> (js/src/threading/Thread.h:239)
==3585== by 0x76735C9: js::detail::ThreadTrampoline<void (&)(void*), js::HelperThread*>::Start(void*) (js/src/threading/Thread.h:232)
==3585== by 0x6B85FA2: start_thread (pthread_create.c:486)
==3585== by 0x59904CE: clone (clone.S:95)
==3585==
Edited by Philip Chimento