flypig.co.uk

List items

Items from the current list are shown below.

Blog

21 Aug 2024 : Day 326 #
Since yesterday I've been travelling by ferry between Jersey and Great Britain. It's an eight-hour overnight trip, which was thankfully enough time to build a new set of packages ready for me to test the new version this morning. To recap on where things are at, I'm currently trying to get ESR 91 to work on Sailfish OS 4.6. I identified differences between ESR 78 and ESR 91 in the way the display was being set up, which I thought may have been the cause. In particular, while on ESR 78 the eglInitialize() and eglGetDisplay() EGL methods are called only by the Qt wayland client code, on ESR 91 they're being called a couple more times by the gecko code as well.

Having updated the code to try to fix this, I'm now going to test the result by placing breakpoints on these two methods of the latest ESR 91 build running on Sailfish OS 4.6. Hopefully the hits will now come only from the Qt Wayland client code and not from the gecko code.
(gdb) b eglInitialize
Breakpoint 2 at 0x7fb6bbb580
(gdb) b eglGetDisplay
Breakpoint 3 at 0x7fb6bbb568
(gdb) r
The program being debugged has been started already.
Start it from the beginning? (y or n) y
Starting program: /usr/bin/sailfish-browser 
[...]
[D] unknown:0 - Using Wayland-EGL

Breakpoint 3, 0x0000007fb6bbb568 in eglGetDisplay () from /usr/lib64/libEGL.so.1
(gdb) bt
#0  0x0000007fb6bbb568 in eglGetDisplay () from /usr/lib64/libEGL.so.1
#1  0x0000007faf220008 in ?? () from /usr/lib64/qt5/plugins/
    wayland-graphics-integration-client/libwayland-egl.so
#2  0x0000007faf3ef8f0 in QtWaylandClient::QWaylandIntegration::
    initializeClientBufferIntegration() () from /usr/lib64/
    libQt5WaylandClient.so.5
#3  0x0000007faf3efbfc in QtWaylandClient::QWaylandIntegration::
    clientBufferIntegration() const () from /usr/lib64/libQt5WaylandClient.so.5
#4  0x0000007faf3ef598 in QtWaylandClient::QWaylandIntegration::hasCapability(
    QPlatformIntegration::Capability) const ()
   from /usr/lib64/libQt5WaylandClient.so.5
#5  0x0000007fb869fc18 in QSGRenderLoop::instance() () from /usr/lib64/
    libQt5Quick.so.5
#6  0x0000007fb86d02b4 in QQuickWindowPrivate::init(QQuickWindow*, 
    QQuickRenderControl*) () from /usr/lib64/libQt5Quick.so.5
#7  0x0000007fb877362c in QQuickView::QQuickView(QWindow*) () from /usr/lib64/
    libQt5Quick.so.5
#8  0x0000007fb89a6a80 in MDeclarativeCachePrivate::qQuickView() () from /usr/
    lib64/libmdeclarativecache5.so.0
#9  0x000000555557b31c in main (argc=<optimized out>, argv=0x7ffffff298) at 
    main.cpp:88
(gdb) c
Continuing.
[...]
library &quot;eglSubDriverAndroid.so&quot; not found

Breakpoint 2, 0x0000007fb6bbb580 in eglInitialize () from /usr/lib64/libEGL.so.1
(gdb) bt
#0  0x0000007fb6bbb580 in eglInitialize () from /usr/lib64/libEGL.so.1
#1  0x0000007faf22001c in ?? () from /usr/lib64/qt5/plugins/
    wayland-graphics-integration-client/libwayland-egl.so
#2  0x0000007faf3ef8f0 in QtWaylandClient::QWaylandIntegration::
    initializeClientBufferIntegration() () from /usr/lib64/
    libQt5WaylandClient.so.5
#3  0x0000007faf3efbfc in QtWaylandClient::QWaylandIntegration::
    clientBufferIntegration() const () from /usr/lib64/libQt5WaylandClient.so.5
#4  0x0000007faf3ef598 in QtWaylandClient::QWaylandIntegration::hasCapability(
    QPlatformIntegration::Capability) const ()
   from /usr/lib64/libQt5WaylandClient.so.5
#5  0x0000007fb869fc18 in QSGRenderLoop::instance() () from /usr/lib64/
    libQt5Quick.so.5
#6  0x0000007fb86d02b4 in QQuickWindowPrivate::init(QQuickWindow*, 
    QQuickRenderControl*) () from /usr/lib64/libQt5Quick.so.5
#7  0x0000007fb877362c in QQuickView::QQuickView(QWindow*) () from /usr/lib64/
    libQt5Quick.so.5
#8  0x0000007fb89a6a80 in MDeclarativeCachePrivate::qQuickView() () from /usr/
    lib64/libmdeclarativecache5.so.0
#9  0x000000555557b31c in main (argc=<optimized out>, argv=0x7ffffff298) at 
    main.cpp:88
(gdb) c
Continuing.
greHome from GRE_HOME:/usr/bin
libxul.so is not found, in /usr/bin/libxul.so
Created LOG for EmbedLiteTrace
[...]
Created LOG for EmbedLiteLayerManager

Thread 38 &quot;Compositor&quot; received signal SIGSEGV, Segmentation fault.
0x0000007faef777e0 in ?? ()
(gdb) bt
#0  0x0000007faef777e0 in ?? ()
#1  0x0000007fac70f310 in ?? ()
#2  0x0000007fad8dafb0 in ?? ()
Backtrace stopped: previous frame inner to this frame (corrupt stack?)
(gdb)
And what we're seeing is just that: the two hits are both coming from the Qt Wayland client code, just as we were hoping. That's the good news. The bad news is that the browser still crashes at start-up, so there's still more work to be done.

So once again I want to try to pin down the location of the crash. This would be a lot easier if we could get a decent backtrace at the point the crash occurs, but unfortunately the backtrace is being lost for some reason. So I'm stepping through the code instead. Immediately I find that the crash is happening when Init() is called from the GLLibraryEGL::Create() method triggered in the GLLibraryEGL() constructor:
Thread 40 &quot;Compositor&quot; hit Breakpoint 5, mozilla::gl::GLLibraryEGL::
    GLLibraryEGL (this=0x7e8c111410) at gfx/gl/GLLibraryEGL.h:113
113     class GLLibraryEGL final {
(gdb) n
mozilla::gl::GLLibraryEGL::Create (
    out_failureId=out_failureId@entry=0x7efaac6fe0, aDisplay=0x1) at gfx/gl/
    GLLibraryEGL.cpp:344
344       RefPtr<GLLibraryEGL> ret = new GLLibraryEGL;
(gdb) n
345       if (!ret->Init(false, out_failureId, aDisplay)) {
(gdb) n
[New Thread 0x7fa6010830 (LWP 12021)]

Thread 40 &quot;Compositor&quot; received signal SIGSEGV, Segmentation fault.
0x0000007faef777e0 in ?? ()
(gdb) 
I'm going to need to step inside that Init()method to find out what's really going on:
(gdb) break GLLibraryEGL::Init
Breakpoint 6 at 0x7fba06bd78: file gfx/gl/GLLibraryEGL.cpp, line 351.
(gdb) c
Continuing.

Thread 40 &quot;Compositor&quot; hit Breakpoint 6, mozilla::gl::GLLibraryEGL::
    Init (this=this@entry=0x7e941114d0, forceAccel=forceAccel@entry=false, 
    out_failureId=ou
t_failureId@entry=0x7efaac6fe0, aDisplay=aDisplay@entry=0x1) at gfx/gl/
    GLLibraryEGL.cpp:351
351     bool GLLibraryEGL::Init(bool forceAccel, nsACString* const 
    out_failureId, EGLDisplay aDisplay) {
(gdb) n
352       MOZ_RELEASE_ASSERT(!mSymbols.fTerminate);
(gdb) n
354       mozilla::ScopedGfxFeatureReporter reporter(&quot;EGL&quot;);
(gdb) n
397       if (!mEGLLibrary) {
(gdb) p mEGLLibrary
$1 = (PRLibrary *) 0x0
(gdb) n
398         mEGLLibrary = PR_LoadLibrary(&quot;libEGL.so&quot;);
(gdb) n
401       if (!mEGLLibrary) {
(gdb) p mEGLLibrary
$2 = (PRLibrary *) 0x0
(gdb) n
402         mEGLLibrary = PR_LoadLibrary(&quot;libEGL.so.1&quot;);
[...]
(gdb) n
430         mGLLibrary = PR_LoadLibrary(GLES2_LIB2);
(gdb) n
436       if (!mEGLLibrary || !mGLLibrary) {
(gdb) p mEGLLibrary
$3 = (PRLibrary *) 0x7e94111410
(gdb) n
453       SymLoadStruct earlySymbols[] = {SYMBOL(GetDisplay),
(gdb) n
484         const SymbolLoader libLoader(*mEGLLibrary);
(gdb) n
485         if (!libLoader.LoadSymbols(earlySymbols)) {
(gdb) n
494         const char internalFuncName[] =
(gdb) n
496         const auto& internalFunc =
(gdb) n
498         if (internalFunc) {
(gdb) n
504       std::shared_ptr<EglDisplay> defaultDisplay = CreateDisplay(
    forceAccel, out_failureId, aDisplay);
(gdb) n
505       if (!defaultDisplay) {
(gdb) n
508       mDefaultDisplay = defaultDisplay;
(gdb) n
510       InitLibExtensions();
(gdb) p mDefaultDisplay->_M_ptr
$8 = (std::__weak_ptr<mozilla::gl::EglDisplay, (__gnu_cxx::_Lock_policy)2>::
    element_type *) 0x5555c931b0
(gdb) p mDefaultDisplay->_M_ptr.mDisplay
$9 = (const EGLDisplay) 0x1
(gdb) n                            
512       const SymbolLoader pfnLoader(mSymbols.fGetProcAddress);
(gdb) n
514       const auto fnLoadSymbols = [&](const SymLoadStruct* symbols) {
(gdb) n 
523       mIsANGLE = IsExtensionSupported(EGLLibExtension::
    ANGLE_platform_angle);
(gdb) n
527       if (mIsANGLE) {
(gdb) p mIsANGLE
$10 = false
(gdb) n
548         const SymLoadStruct symbols[] = {SYMBOL(
    GetNativeClientBufferANDROID),
(gdb) n
[...]
632         (void)fnLoadSymbols(symbols);
(gdb) n
504       std::shared_ptr<EglDisplay> defaultDisplay = CreateDisplay(
    forceAccel, out_failureId, aDisplay);
(gdb) 

Thread 40 &quot;Compositor&quot; received signal SIGSEGV, Segmentation fault.
0x0000007faef777e0 in ?? ()
(gdb) 
That takes us up to CreateDisplay() at which point the crash happens again. So I need to give it another go, this time stepping inside the CreateDisplay() method. And this time I'm going to step into all of the methods that are being called as well.
(gdb) break GLLibraryEGL::CreateDisplay
Breakpoint 7 at 0x7fba06b6c0: file gfx/gl/GLLibraryEGL.cpp, line 754.
(gdb) r
[...]
Created LOG for EmbedLiteLayerManager

Thread 40 &quot;Compositor&quot; hit Breakpoint 7, mozilla::gl::GLLibraryEGL::
    CreateDisplay (this=this@entry=0x7e94111340, 
    forceAccel=forceAccel@entry=false, 
    out_failureId=out_failureId@entry=0x7efaac6fe0, 
    aDisplay=aDisplay@entry=0x1) at gfx/gl/GLLibraryEGL.cpp:754
754         EGLDisplay aDisplay) {
(gdb) n
757       if (IsExtensionSupported(EGLLibExtension::ANGLE_platform_angle_d3d)) {
(gdb) n
815         ret = GetAndInitDisplay(*this, nativeDisplay, aDisplay);
(gdb) s
mozilla::gl::GetAndInitDisplay (egl=..., displayType=displayType@entry=0x0, 
    display=display@entry=0x1) at gfx/gl/GLLibraryEGL.cpp:149
149                                                          EGLDisplay display 
    = EGL_NO_DISPLAY) {
(gdb) n
150       if (display == EGL_NO_DISPLAY) {
(gdb) n
154       return EglDisplay::Create(egl, display, false);
(gdb) s
mozilla::gl::EglDisplay::Create (lib=..., display=0x1, 
    isWarp=isWarp@entry=false) at gfx/gl/GLLibraryEGL.cpp:664
664                                                    const bool isWarp) {
(gdb) n
667         const auto itr = lib.mActiveDisplays.find(display);
(gdb) n
676       if (display == EGL_NO_DISPLAY) {
(gdb) n
683       std::call_once(sMesaLeakFlag, MesaMemoryLeakWorkaround);
(gdb) n
686           std::make_shared<EglDisplay>(PrivateUseOnly{}, lib, display, 
    isWarp);
(gdb) n
687       lib.mActiveDisplays.insert({display, ret});
(gdb) n
688       return ret;
(gdb) n
686           std::make_shared<EglDisplay>(PrivateUseOnly{}, lib, display, 
    isWarp);
(gdb) n
mozilla::gl::GLLibraryEGL::CreateDisplay (this=this@entry=0x7e94111340, 
    forceAccel=forceAccel@entry=false, 
    out_failureId=out_failureId@entry=0x7efaac6fe0, 
    aDisplay=aDisplay@entry=0x1) at gfx/gl/GLLibraryEGL.cpp:815
815         ret = GetAndInitDisplay(*this, nativeDisplay, aDisplay);
(gdb) n
818       if (!ret) {
(gdb) n
826       return ret;
(gdb) n
mozilla::gl::GLLibraryEGL::Init (this=this@entry=0x7e94111340, 
    forceAccel=forceAccel@entry=false, 
    out_failureId=out_failureId@entry=0x7efaac6fe0, 
    aDisplay=aDisplay@entry=0x1) at gfx/gl/GLLibraryEGL.cpp:505
505       if (!defaultDisplay) {
(gdb) p defaultDisplay._M_ptr.mDisplay
$14 = (const EGLDisplay) 0x1
(gdb) n
508       mDefaultDisplay = defaultDisplay;
(gdb) n
510       InitLibExtensions();
(gdb) n
512       const SymbolLoader pfnLoader(mSymbols.fGetProcAddress);
(gdb) n
514       const auto fnLoadSymbols = [&](const SymLoadStruct* symbols) {
(gdb) n
523       mIsANGLE = IsExtensionSupported(EGLLibExtension::
    ANGLE_platform_angle);
(gdb) n
527       if (mIsANGLE) {
(gdb) n
548         const SymLoadStruct symbols[] = {SYMBOL(
    GetNativeClientBufferANDROID),
(gdb) n
[...]
632         (void)fnLoadSymbols(symbols);
(gdb) n
504       std::shared_ptr<EglDisplay> defaultDisplay = CreateDisplay(
    forceAccel, out_failureId, aDisplay);
(gdb) n

Thread 40 &quot;Compositor&quot; received signal SIGSEGV, Segmentation fault.
0x0000007faef777e0 in ?? ()
(gdb)
This is a bit confusing for me. It seems we start in CreateDisplay() but then it's called again later. Is it being called twice? It turns out not: it's just the way the debugger steps in and out of the methods. When it steps out of a method it displays the name of the method that the programme counter just jumped back to, as if it were entering the method from the initial entry point. In other words, the debugger doesn't seem to distinguish between a call to a method that adds a line to the stack, compared to returning to a method due to removing a line from the stack.

So what we're actually seeing in the debugger output above, but hugely simplified, is something like the following. The list indent is increased when a method is popped onto the stack and decreased when a method is popped off of the stack.
  1. GLLibraryEGL::CreateDisplay() at GLLibraryEGL.cpp:754
    1. GetAndInitDisplay() at GLLibraryEGL.cpp:149
      1. EglDisplay::Create() at GLLibraryEGL.cpp:664
    2. GLLibraryEGL::CreateDisplay() at GLLibraryEGL.cpp:815
    3. GLLibraryEGL::Init() at GLLibraryEGL.cpp:505
  2. GLLibraryEGL::CreateDisplay() at GLLibraryEGL.cpp:504
It's clear from this that CreateDisplay() is only being called once, which is correct. At this point the crash occurs, although it's not quite clear why it's exactly at this point. At least it doesn't now seem to be because multiple EglDisplay instances are being created. In fact, only one is being constructed, as should be the case, and which we can confirm using the debugger again. Be warned that we're about to get a really long backtrace, but there's some useful info here so I've left most of it in:
Thread 41 &quot;Compositor&quot; hit Breakpoint 8, mozilla::gl::EglDisplay::
    EglDisplay (this=0x5555c8ee40, lib=..., disp=0x1, isWarp=false) at /usr/src/
    debug/xulrunn
er-qt5-91.9.1-1.aarch64/gfx/gl/GLLibraryEGL.cpp:691
691     EglDisplay::EglDisplay(const PrivateUseOnly&, GLLibraryEGL& lib,
(gdb) bt
#0  mozilla::gl::EglDisplay::EglDisplay (this=0x5555c8ee40, lib=..., disp=0x1, 
    isWarp=false)
    at gfx/gl/GLLibraryEGL.cpp:691
#1  0x0000007fba06b594 in __gnu_cxx::new_allocator<mozilla::gl::EglDisplay>::
    construct<mozilla::gl::EglDisplay, mozilla::gl::EglDisplay::PrivateUseOnly, 
    mozilla::gl::GLLibraryEGL&, void* const&, bool const&> (__p=0x5555c8ee40, 
    this=<optimized out>)
    at /srv/mer/toolings/SailfishOS-4.6.0.11EA/opt/cross/
    aarch64-meego-linux-gnu/include/c++/10.3.1/ext/new_allocator.h:156
#2  std::allocator_traits<std::allocator<mozilla::gl::EglDisplay> >::
    construct<mozilla::gl::EglDisplay, mozilla::gl::EglDisplay::PrivateUseOnly, 
    mozilla::gl::GLLibraryEGL&, void* const&, bool const&> (__p=0x5555c8ee40, 
    __a=...)
    at /srv/mer/toolings/SailfishOS-4.6.0.11EA/opt/cross/
    aarch64-meego-linux-gnu/include/c++/10.3.1/bits/alloc_traits.h:512
#3  std::_Sp_counted_ptr_inplace<mozilla::gl::EglDisplay, std::
    allocator<mozilla::gl::EglDisplay>, (__gnu_cxx::_Lock_policy)2>::
    _Sp_counted_ptr_inplace<mozilla::gl::EglDisplay::PrivateUseOnly, mozilla::
    gl::GLLibraryEGL&, void* const&, bool const&> (__a=..., this=0x5555c8ee30)
    at /srv/mer/toolings/SailfishOS-4.6.0.11EA/opt/cross/
    aarch64-meego-linux-gnu/include/c++/10.3.1/bits/shared_ptr_base.h:551
#4  std::__shared_count<(__gnu_cxx::_Lock_policy)2>::__shared_count<mozilla::gl:
    :EglDisplay, std::allocator<mozilla::gl::EglDisplay>, mozilla::gl::
    EglDisplay::PrivateUseOnly, mozilla::gl::GLLibraryEGL&, void* const&, bool 
    const&> (__a=..., __p=<synthetic pointer>: <optimized out>, this=<synthetic 
    pointer>)
    at /srv/mer/toolings/SailfishOS-4.6.0.11EA/opt/cross/
    aarch64-meego-linux-gnu/include/c++/10.3.1/bits/shared_ptr_base.h:682
#5  std::__shared_ptr<mozilla::gl::EglDisplay, (__gnu_cxx::_Lock_policy)2>::
    __shared_ptr<std::allocator<mozilla::gl::EglDisplay>, mozilla::gl::
    EglDisplay::PrivateUseOnly, mozilla::gl::GLLibraryEGL&, void* const&, bool 
    const&> (__tag=..., this=<synthetic pointer>)
    at /srv/mer/toolings/SailfishOS-4.6.0.11EA/opt/cross/
    aarch64-meego-linux-gnu/include/c++/10.3.1/bits/shared_ptr_base.h:1376
#6  std::shared_ptr<mozilla::gl::EglDisplay>::shared_ptr<std::allocator<mozilla:
    :gl::EglDisplay>, mozilla::gl::EglDisplay::PrivateUseOnly, mozilla::gl::
    GLLibraryEGL&, void* const&, bool const&> (__tag=..., this=<synthetic 
    pointer>)
    at /srv/mer/toolings/SailfishOS-4.6.0.11EA/opt/cross/
    aarch64-meego-linux-gnu/include/c++/10.3.1/bits/shared_ptr.h:408
#7  std::allocate_shared<mozilla::gl::EglDisplay, std::allocator<mozilla::gl::
    EglDisplay>, mozilla::gl::EglDisplay::PrivateUseOnly, mozilla::gl::
    GLLibraryEGL&, void* const&, bool const&> (__a=...)
    at /srv/mer/toolings/SailfishOS-4.6.0.11EA/opt/cross/
    aarch64-meego-linux-gnu/include/c++/10.3.1/bits/shared_ptr.h:862
#8  std::make_shared<mozilla::gl::EglDisplay, mozilla::gl::EglDisplay::
    PrivateUseOnly, mozilla::gl::GLLibraryEGL&, void* const&, bool const&> ()
    at /srv/mer/toolings/SailfishOS-4.6.0.11EA/opt/cross/
    aarch64-meego-linux-gnu/include/c++/10.3.1/bits/shared_ptr.h:878
#9  mozilla::gl::EglDisplay::Create (lib=..., display=<optimized out>, 
    isWarp=isWarp@entry=false)
    at gfx/gl/GLLibraryEGL.cpp:686
#10 0x0000007fba06b674 in mozilla::gl::GetAndInitDisplay (egl=..., 
    displayType=displayType@entry=0x0, display=<optimized out>, 
    display@entry=0x1)
    at gfx/gl/GLLibraryEGL.cpp:154
#11 0x0000007fba06bc58 in mozilla::gl::GLLibraryEGL::CreateDisplay (
    this=this@entry=0x7e901114d0, forceAccel=forceAccel@entry=false, 
    out_failureId=out_failureId@entry=0x7efaa85fe0, aDisplay=aDisplay@entry=0x1)
    at gfx/gl/GLLibraryEGL.cpp:815
#12 0x0000007fba06c0b8 in mozilla::gl::GLLibraryEGL::Init (
    this=this@entry=0x7e901114d0, forceAccel=forceAccel@entry=false, 
    out_failureId=out_failureId@entry=0x7efaa85fe0, aDisplay=aDisplay@entry=0x1)
    at gfx/gl/GLLibraryEGL.cpp:504
#13 0x0000007fba06c8fc in mozilla::gl::GLLibraryEGL::Create (
    out_failureId=out_failureId@entry=0x7efaa85fe0, aDisplay=0x1)
    at gfx/gl/GLLibraryEGL.cpp:345
#14 0x0000007fba06cf34 in mozilla::gl::GLContextProviderEGL::
    CreateWrappingExisting (aContext=0x7e90004230, aSurface=0x5555943c30, 
    aDisplay=<optimized out>) at gfx/gl/GLContextProviderEGL.cpp:1008
#15 0x0000007fbca77904 in mozilla::embedlite::nsWindow::GetGLContext (
    this=this@entry=0x7f8cdb6400)
    at mobile/sailfishos/embedshared/nsWindow.cpp:405
#16 0x0000007fbca77abc in mozilla::embedlite::nsWindow::GetNativeData (
    this=0x7f8cdb6400, aDataType=12)
    at mobile/sailfishos/embedshared/nsWindow.cpp:173
#17 0x0000007fba0e890c in mozilla::layers::CompositorOGL::CreateContext (
    this=this@entry=0x7e90110d80)
    at gfx/layers/opengl/CompositorOGL.cpp:232
#18 0x0000007fba0fdb34 in mozilla::layers::CompositorOGL::Initialize (
    this=0x7e90110d80, out_failureReason=0x7efaa865a0)
    at gfx/layers/opengl/CompositorOGL.cpp:387
#19 0x0000007fba21d568 in mozilla::layers::CompositorBridgeParent::
    NewCompositor (this=this@entry=0x7f8caed4d0, aBackendHints=...)
    at gfx/layers/ipc/CompositorBridgeParent.cpp:1493
#20 0x0000007fba2343cc in mozilla::layers::CompositorBridgeParent::
    InitializeLayerManager (this=this@entry=0x7f8caed4d0, aBackendHints=...)
    at gfx/layers/ipc/CompositorBridgeParent.cpp:1436
#21 0x0000007fba234558 in mozilla::layers::CompositorBridgeParent::
    AllocPLayerTransactionParent (this=this@entry=0x7f8caed4d0, 
    aBackendHints=..., aId=...)
    at gfx/layers/ipc/CompositorBridgeParent.cpp:1546
#22 0x0000007fbca5ed84 in mozilla::embedlite::EmbedLiteCompositorBridgeParent::
    AllocPLayerTransactionParent (this=0x7f8caed4d0, aBackendHints=...,
    aId=...) at mobile/sailfishos/embedthread/
    EmbedLiteCompositorBridgeParent.cpp:80
#23 0x0000007fb9af84f4 in mozilla::layers::PCompositorBridgeParent::
    OnMessageReceived (this=0x7f8caed4d0, msg__=...) at 
    PCompositorBridgeParent.cpp:1285
[...]
#38 0x0000007fb706b7cc in thread_start () at ../sysdeps/unix/sysv/linux/aarch64/
    clone.S:78
(gdb) c
Continuing.

Thread 41 &quot;Compositor&quot; received signal SIGSEGV, Segmentation fault.
0x0000007faef777e0 in ?? ()
(gdb)
I need to pin down where the crash is happening. But I also want to check whether the code is still generating the error we saw a couple of days back stating that the "Wayland connection experienced a fatal error (Resource temporarily unavailable)". So I'm going to place a breakpoint on EmbedLiteCompositorBridgeParent::AllocPLayerTransactionParent() — which was called just prior to this message appearing previously — and see whether it appears again.
$ WAYLAND_DEBUG=1 gdb sailfish-browser
[...]
(gdb) break EmbedLiteCompositorBridgeParent::AllocPLayerTransactionParent
Breakpoint 2 at 0x7fbca5ed70: file mobile/sailfishos/embedthread/
    EmbedLiteCompositorBridgeParent.cpp, line 79.
(gdb) r
The program being debugged has been started already.
[...]
Created LOG for EmbedLiteLayerManager
[ 307796.499]  -> wl_compositor@4.create_surface(new id wl_surface@42)
[ 307796.589]  -> android_wlegl@27.get_server_buffer_handle(new id 
    android_wlegl_server_buffer_handle@43, 1, 1, 1, 768)
[ 307796.634]  -> wl_display@1.sync(new id wl_callback@47)
[ 307798.325] wl_display@1.delete_id(43)
[ 307798.380] wl_display@1.delete_id(47)
[ 307798.408] android_wlegl_server_buffer_handle@43.buffer_ints(array[88])
[ 307798.441] android_wlegl_server_buffer_handle@43.buffer_fd(fd 74)
[ 307798.466] android_wlegl_server_buffer_handle@43.buffer_fd(fd 75)
[ 307798.491] android_wlegl_server_buffer_handle@43.buffer(new id 
    wl_buffer@4278190086, 1, 64)
[ 307798.536] wl_callback@47.done(2107)
[ 307798.561]  -> android_wlegl@27.get_server_buffer_handle(new id 
    android_wlegl_server_buffer_handle@47, 1, 1, 1, 768)
[ 307798.585]  -> wl_display@1.sync(new id wl_callback@48)
[ 307799.811] wl_display@1.delete_id(47)
[ 307800.014] wl_display@1.delete_id(48)
[ 307800.135] android_wlegl_server_buffer_handle@47.buffer_ints(array[88])
[ 307800.170] android_wlegl_server_buffer_handle@47.buffer_fd(fd 73)
[ 307800.216] android_wlegl_server_buffer_handle@47.buffer_fd(fd 74)
[ 307800.260] android_wlegl_server_buffer_handle@47.buffer(new id 
    wl_buffer@4278190087, 1, 64)
[ 307800.318] wl_callback@48.done(2107)
[ 307800.355]  -> android_wlegl@27.get_server_buffer_handle(new id 
    android_wlegl_server_buffer_handle@48, 1, 1, 1, 768)
[ 307800.391]  -> wl_display@1.sync(new id wl_callback@49)
[ 307802.186] wl_display@1.delete_id(48)
[ 307802.215] wl_display@1.delete_id(49)
[ 307802.290] android_wlegl_server_buffer_handle@48.buffer_ints(array[88])
[ 307802.348] android_wlegl_server_buffer_handle@48.buffer_fd(fd 73)
[ 307802.377] android_wlegl_server_buffer_handle@48.buffer_fd(fd 74)
[ 307802.402] android_wlegl_server_buffer_handle@48.buffer(new id 
    wl_buffer@4278190088, 1, 64)
[ 307802.456] wl_callback@49.done(2107)
[ 307803.277]  -> wl_buffer@4278190086.destroy()
[ 307803.364]  -> wl_buffer@4278190088.destroy()
[ 307803.402]  -> wl_buffer@4278190087.destroy()
[ 307803.439]  -> wl_surface@42.destroy()
[ 307807.166] wl_callback@34.done(46206349)
[ 307807.258]  -> wl_buffer@4278190082.destroy()
[ 307807.338]  -> android_wlegl@27.get_server_buffer_handle(new id 
    android_wlegl_server_buffer_handle@34, 1080, 2520, 277, 268436224)
[ 307807.377]  -> wl_display@1.sync(new id wl_callback@49)
[ 307811.278] wl_display@1.delete_id(42)
[ 307811.346] wl_display@1.delete_id(34)
[ 307811.407] wl_display@1.delete_id(49)
[ 307811.430] android_wlegl_server_buffer_handle@34.buffer_ints(array[88])
[ 307811.616] android_wlegl_server_buffer_handle@34.buffer_fd(fd 27)
[ 307811.645] android_wlegl_server_buffer_handle@34.buffer_fd(fd 31)
[ 307811.666] android_wlegl_server_buffer_handle@34.buffer(new id 
    wl_buffer@4278190082, 277, 1088)
[ 307811.721] wl_callback@49.done(2107)
[ 307817.837]  -> wl_surface@20.frame(new id wl_callback@49)
[ 307818.016]  -> wl_surface@20.attach(wl_buffer@4278190082, 0, 0)
[ 307818.048]  -> wl_surface@20.damage(0, 0, 1080, 2520)
[ 307818.073]  -> wl_surface@20.commit()
[ 307818.096]  -> wl_display@1.sync(new id wl_callback@42)
[New Thread 0x7fa6051830 (LWP 16227)]
[New Thread 0x7fa6010830 (LWP 16228)]
[ 307829.250] discarded [unknown]@42.[event 0](0 fd, 12 byte)
[ 307829.501] wl_display@1.delete_id(42)
[Switching to Thread 0x7efaac8830 (LWP 16220)]

Thread 40 &quot;Compositor&quot; hit Breakpoint 2, mozilla::embedlite::
    EmbedLiteCompositorBridgeParent::AllocPLayerTransactionParent (
    this=0x7f8cbdaeb0, aBackendHints=..., aId=...) at mobile/sailfishos/
    embedthread/EmbedLiteCompositorBridgeParent.cpp:79
79      {
(gdb) n
[ 663026.258] wl_display@1.delete_id(49)
[ 663026.351] wl_shell_surface@22.ping(2108)
[ 663026.417]  -> wl_shell_surface@22.pong(2108)
[ 663026.454] wl_keyboard@8.leave(2109, wl_surface@24)
[ 663026.501]  -> wl_display@1.sync(new id wl_callback@42)
[ 663026.536] qt_extended_surface@23.onscreen_visibility(0)
80        PLayerTransactionParent* p =
(gdb) n
[ 675275.026] wl_buffer@4278190081.release()
[ 675275.219] wl_callback@49.done(46239292)
[ 675275.309]  -> wl_buffer@4278190080.destroy()
[ 675275.520]  -> android_wlegl@27.get_server_buffer_handle(new id 
    android_wlegl_server_buffer_handle@49, 1080, 2520, 277, 268436224)
[ 675275.891]  -> wl_display@1.sync(new id wl_callback@50)
[ 675294.078] wl_display@1.delete_id(42)
[ 675294.402] wl_display@1.delete_id(49)
[ 675294.476] wl_display@1.delete_id(50)
[ 675295.213] android_wlegl_server_buffer_handle@49.buffer_ints(array[88])
[ 675295.350] android_wlegl_server_buffer_handle@49.buffer_fd(fd 31)
[ 675295.423] android_wlegl_server_buffer_handle@49.buffer_fd(fd 33)
[ 675295.488] android_wlegl_server_buffer_handle@49.buffer(new id 
    wl_buffer@4278190080, 277, 1088)
[ 675296.112] wl_callback@50.done(2111)
[ 675307.846]  -> wl_surface@20.frame(new id wl_callback@50)
[ 675307.922]  -> wl_surface@20.attach(wl_buffer@4278190080, 0, 0)
[ 675307.962]  -> wl_surface@20.damage(0, 0, 1080, 2520)
[ 675308.240]  -> wl_surface@20.commit()
[ 675308.272]  -> wl_display@1.sync(new id wl_callback@51)

Thread 40 &quot;Compositor&quot; received signal SIGSEGV, Segmentation fault.
0x0000007faef777e0 in ?? ()
(gdb) 
Well, it doesn't appear, and this output is reproducible, so it's not just a fluke. By stepping deeper into this code I eventually hit CompositorBridgeParent::NewCompositor(). It looks like something may be going wrong inside this method. I'd love to continue digging in to this now, but after that 5 am start on the ferry this morning, I can feel my brain losing focus. I'll need to come at this with fresh eyes in the morning.

If you'd like to read any of my other gecko diary entries, they're all available on my Gecko-dev Diary page.

Comments

Uncover Disqus comments