flypig.co.uk

List items

Items from the current list are shown below.

Gecko

20 Aug 2024 : Day 325 #
Although I managed to collect quite a bit of data yesterday about the Wayland crash on Sailfish OS 4.6 running ESR 91, I'm still at a loss as to how to fix it. At this point, I think my best bet will be to compare what's happening on ESR 91 around the time of the crash with what's happening on ESR 78.

But that's tricky for a couple of reasons, the most obvious being that, since I upgraded one of my two dev phones to Sailfish OS 4.6, now none of my phones are running the ESR 78 version of the browser. If I want to compare something to it, I'm going to have to reinstall it on one of my phones.

I'm going to start by finding out the ordering and quantity of calls to eglGetDisplay() and eglInitialize() along with their parameters. Since it's already installed, here are the steps running on ESR 91:
(gdb) info break
Num     Type           Disp Enb Address            What
3       breakpoint     keep y   0x0000007fba06b6bc in mozilla::gl::GLLibraryEGL:
    :fGetDisplay(void*) const 
                                                   at gfx/gl/GLLibraryEGL.h:193
4       breakpoint     keep y   0x0000007fba06b5e8 in mozilla::gl::GLLibraryEGL:
    :fInitialize(void*, int*, int*) const 
                                                   at gfx/gl/GLLibraryEGL.h:283
        breakpoint already hit 1 time
(gdb) r
[...]
Thread 37 "Compositor" hit Breakpoint 4, mozilla::gl::GLLibraryEGL::
    fInitialize (minor=0x0, major=0x0, dpy=0x1, this=0x7e9c111510) at gfx/gl/
    GLLibraryEGL.h:283
283         WRAP(fInitialize(dpy, major, minor));
(gdb) c
Continuing.
[1579573.416] wl_shell_surface@22.ping(1286)
[1579573.536]  -> wl_shell_surface@22.pong(1286)

Thread 37 "Compositor" hit Breakpoint 3, mozilla::gl::GLLibraryEGL::
    fGetDisplay (display_id=0x0, this=0x7e9c111510) at gfx/gl/GLLibraryEGL.h:193
193         WRAP(fGetDisplay(display_id));
(gdb) c
Continuing.
[1587345.226] wl_shell_surface@22.ping(1287)
[1587345.347]  -> wl_shell_surface@22.pong(1287)
[1592605.903] wl_shell_surface@22.ping(1288)
[1592606.049]  -> wl_shell_surface@22.pong(1288)
library "libui_compat_layer.so" not found
[1594544.007]  -> wl_display@1.get_registry(new id wl_registry@2)
[1594544.394]  -> wl_display@1.sync(new id wl_callback@3)

Thread 37 "Compositor" hit Breakpoint 4, mozilla::gl::GLLibraryEGL::
    fInitialize (minor=0x0, major=0x0, dpy=0x1, this=0x7e9c111510) at gfx/gl/
    GLLibraryEGL.h:283
283         WRAP(fInitialize(dpy, major, minor));
(gdb) c
Continuing.
[1606304.282] wl_shell_surface@22.ping(1289)
[1606304.417]  -> wl_shell_surface@22.pong(1289)
[New Thread 0x7ef2c64830 (LWP 26341)]
[New Thread 0x7ef2a63830 (LWP 26342)]

Thread 37 "Compositor" received signal SIGSEGV, Segmentation fault.
0x0000007faef77360 in ?? ()
(gdb) 
What we can see is the following sequence of calls in this order and with these parameters:
  1. eglInitialize(minor=0x0, major=0x0, dpy=0x1)
  2. eglGetDisplay(display_id=0x0)
  3. eglInitialize(minor=0x0, major=0x0, dpy=0x1)
Let's now compare that against ESR 78. Ordinarily I'd install the ESR 78 packages directly from Jolla's repositories like so:
$ zypper install --oldpackage xulrunner-qt5-78.15.1+git39-1.19.1.jolla \
    xulrunner-qt5-debuginfo-78.15.1+git39-1.19.1.jolla \
    xulrunner-qt5-debugsource-78.15.1+git39-1.19.1.jolla \
    xulrunner-qt5-misc-78.15.1+git39-1.19.1.jolla \
    qtmozembed-qt5-1.53.25-1.22.2.jolla \
    qtmozembed-qt5-debuginfo-1.53.25-1.22.2.jolla \
    qtmozembed-qt5-debugsource-1.53.25-1.22.2.jolla \
    sailfish-components-webview-qt5-1.5.21-1.13.1.jolla \
    sailfish-components-webview-qt5-debuginfo-1.5.21-1.13.1.jolla \
    sailfish-components-webview-qt5-debugsource-1.5.21-1.13.1.jolla \
    sailfish-components-webview-qt5-pickers-1.5.21-1.13.1.jolla \
    sailfish-components-webview-qt5-popups-1.5.21-1.13.1.jolla \
    embedlite-components-qt5-1.24.35-1.26.1.jolla \
    embedlite-components-qt5-debuginfo-1.24.35-1.26.1.jolla \
    embedlite-components-qt5-debugsource-1.24.35-1.26.1.jolla \
    sailfish-browser-2.2.63-1.12.1.jolla \
    sailfish-browser-debuginfo-2.2.63-1.12.1.jolla \
    sailfish-browser-debugsource-2.2.63-1.12.1.jolla \
    sailfish-browser-settings-2.2.63-1.12.1.jolla \
    mapplauncherd-booster-browser-0.2.2-1.1.1.jolla \
    mapplauncherd-booster-browser-debuginfo-0.2.2-1.1.1.jolla \
    mapplauncherd-booster-browser-debugsource-0.2.2-1.1.1.jolla
However I'm travelling by sea this evening and likely to be out of range of any mobile networks, so if I'm going to be switching between ESR 78 and ESR 91 during testing it'll be convenient if I have the packages downloaded locally so I can install them from the file system, rather than over the network. So I've downloaded the packages directly from the repos. This turned out to be impossible over my mobile connection, so once again I had to find a café with free customer WiFi to download them over instead.

That turned a stumbling 30 minute marathon into a confident 30 second sprint of a download. Now I've collected all of the packages together and have them saved to my local device I'll be able to reinstall them in future without having to download them again.
ls -1
embedlite-components-qt5-1.24.35-1.26.1.jolla.aarch64.rpm
embedlite-components-qt5-debuginfo-1.24.35-1.26.1.jolla.aarch64.rpm
embedlite-components-qt5-debugsource-1.24.35-1.26.1.jolla.aarch64.rpm
mapplauncherd-booster-browser-0.2.2-1.1.1.jolla.aarch64.rpm
mapplauncherd-booster-browser-debuginfo-0.2.2-1.1.1.jolla.aarch64.rpm
mapplauncherd-booster-browser-debugsource-0.2.2-1.1.1.jolla.aarch64.rpm
qtmozembed-qt5-1.53.25-1.22.2.jolla.aarch64.rpm
qtmozembed-qt5-debuginfo-1.53.25-1.22.2.jolla.aarch64.rpm
qtmozembed-qt5-debugsource-1.53.25-1.22.2.jolla.aarch64.rpm
sailfish-browser-2.2.63-1.12.1.jolla.aarch64.rpm
sailfish-browser-debuginfo-2.2.63-1.12.1.jolla.aarch64.rpm
sailfish-browser-debugsource-2.2.63-1.12.1.jolla.aarch64.rpm
sailfish-browser-settings-2.2.63-1.12.1.jolla.aarch64.rpm
sailfish-components-webview-qt5-1.5.21-1.13.1.jolla.aarch64.rpm
sailfish-components-webview-qt5-pickers-1.5.21-1.13.1.jolla.aarch64.rpm
sailfish-components-webview-qt5-popups-1.5.21-1.13.1.jolla.aarch64.rpm
xulrunner-qt5-78.15.1+git39-1.19.1.jolla.aarch64.rpm
xulrunner-qt5-debuginfo-78.15.1+git39-1.19.1.jolla.aarch64.rpm
xulrunner-qt5-debugsource-78.15.1+git39-1.19.1.jolla.aarch64.rpm
xulrunner-qt5-misc-78.15.1+git39-1.19.1.jolla.aarch64.rpm
$ rpm -U --force xulrunner-qt5-78.*.rpm xulrunner-qt5-debuginfo-78.*.rpm \
    xulrunner-qt5-debugsource-78.*.rpm xulrunner-qt5-misc-78.*.rpm \
    qtmozembed-qt5-1.*.rpm qtmozembed-qt5-debuginfo-1.*.rpm \
    qtmozembed-qt5-debugsource-1.*.rpm sailfish-components-webview-qt5-1.*.rpm \
    sailfish-components-webview-qt5-pickers-1.*.rpm \
    sailfish-components-webview-qt5-popups-1.*.rpm \
    embedlite-components-qt5-1.*.rpm embedlite-components-qt5-debuginfo-1.*.rpm 
    \
    embedlite-components-qt5-debugsource-1.*.rpm \
    sailfish-browser-2.*.rpm sailfish-browser-debuginfo-2.*.rpm \
    sailfish-browser-debugsource-2.*.rpm sailfish-browser-settings-2.*.rpm \
    mapplauncherd-booster-browser-0.*.rpm \
    mapplauncherd-booster-browser-debuginfo-0.*.rpm \
    mapplauncherd-booster-browser-debugsource-0.*.rpm
So with the ESR 78 version of the browser installed, let's see where these two methods — eglInitialize() and eglGetDisplay() get called.
$ WAYLAND_DEBUG=1 gdb sailfish-browser
[...]
(gdb) b eglInitialize
Breakpoint 3 at 0x7fb6dbe580
(gdb) b eglGetDisplay
Breakpoint 4 at 0x7fb6dbe568
(gdb) info break
Num     Type           Disp Enb Address            What
3       breakpoint     keep y   0x0000007fb6dbe580 <eglInitialize+16>
        breakpoint already hit 1 time
4       breakpoint     keep y   0x0000007fb6dbe568 <eglGetDisplay+8>
        breakpoint already hit 1 time
(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 
[...]
Using host libthread_db library &quot;/lib64/libthread_db.so.1&quot;.
[3922558.854]  -> wl_display@1.get_registry(new id wl_registry@2)
[3922559.301]  -> wl_display@1.sync(new id wl_callback@3)
[3922561.417] wl_display@1.delete_id(3)
[3922561.531] wl_registry@2.global(1, &quot;wl_compositor&quot;, 3)
[3922561.652]  -> wl_registry@2.bind(1, &quot;wl_compositor&quot;, 3, new id 
    [unknown]@4)
[3922561.705] wl_registry@2.global(2, &quot;wl_data_device_manager&quot;, 1)
[3922561.819]  -> wl_registry@2.bind(2, &quot;wl_data_device_manager&quot;, 1, 
    new id [unknown]@5)
[3922561.858] wl_registry@2.global(3, &quot;wl_shm&quot;, 1)
[3922561.881]  -> wl_registry@2.bind(3, &quot;wl_shm&quot;, 1, new id 
    [unknown]@6)
[3922561.903] wl_registry@2.global(4, &quot;qt_hardware_integration&quot;, 1)
[3922562.071]  -> wl_registry@2.bind(4, &quot;qt_hardware_integration&quot;, 1, 
    new id [unknown]@7)
[3922562.144]  -> wl_display@1.sync(new id wl_callback@8)
[3922562.272] wl_registry@2.global(5, &quot;android_wlegl&quot;, 2)
[3922562.318] wl_registry@2.global(6, &quot;qt_surface_extension&quot;, 1)
[3922562.410]  -> wl_registry@2.bind(6, &quot;qt_surface_extension&quot;, 1, 
    new id [unknown]@9)
[3922562.456] wl_registry@2.global(7, &quot;qt_touch_extension&quot;, 1)
[3922562.669]  -> wl_registry@2.bind(7, &quot;qt_touch_extension&quot;, 1, new 
    id [unknown]@10)
[3922562.743] wl_registry@2.global(8, &quot;qt_windowmanager&quot;, 1)
[3922562.813]  -> wl_registry@2.bind(8, &quot;qt_windowmanager&quot;, 1, new id 
    [unknown]@11)
[3922562.881] wl_registry@2.global(9, &quot;wl_seat&quot;, 3)
[3922563.016]  -> wl_registry@2.bind(9, &quot;wl_seat&quot;, 3, new id 
    [unknown]@12)
[3922563.121]  -> wl_data_device_manager@5.get_data_device(new id 
    wl_data_device@13, wl_seat@12)
[3922563.348] wl_registry@2.global(10, &quot;wl_output&quot;, 2)
[3922563.539]  -> wl_registry@2.bind(10, &quot;wl_output&quot;, 2, new id 
    [unknown]@14)
[3922563.697]  -> wl_display@1.sync(new id wl_callback@15)
[3922563.724] wl_registry@2.global(11, &quot;wl_shell&quot;, 1)
[3922563.750] wl_registry@2.global(12, &quot;lipstick_recorder_manager&quot;, 1)
[3922563.784] wl_registry@2.global(13, &quot;alien_manager&quot;, 1)
[3922563.815] wl_callback@3.done(1851)
[3922567.164] wl_display@1.delete_id(8)
[3922567.322] wl_display@1.delete_id(15)
[3922567.363] qt_hardware_integration@7.client_backend(&quot;wayland-egl&quot;)
[3922567.750] wl_callback@8.done(1851)
[3922567.787] qt_touch_extension@10.configure(0)
[3922567.811] qt_windowmanager@11.hints(1)
[3922567.828] wl_seat@12.capabilities(7)
[3922568.127]  -> wl_seat@12.get_keyboard(new id wl_keyboard@8)
[3922568.401]  -> wl_seat@12.get_pointer(new id wl_pointer@3)
[3922568.642]  -> wl_compositor@4.create_surface(new id wl_surface@16)
[3922568.791]  -> wl_seat@12.get_touch(new id wl_touch@17)
[3922568.937] wl_output@14.geometry(0, 0, 60, 139, 0, &quot;&quot;, 
    &quot;&quot;, 0)
[3922568.986] wl_output@14.mode(3, 1080, 2520, 60000)
[3922569.021] wl_output@14.scale(1)
[3922569.063] wl_output@14.done()
[3922569.144] wl_callback@15.done(1851)
[3922569.693]  -> wl_shm@6.create_pool(new id wl_shm_pool@15, fd 5, 4096)
[3922572.771]  -> wl_shm_pool@15.resize(8832)
[3922572.928]  -> wl_shm_pool@15.resize(18624)
[D] unknown:0 - Using Wayland-EGL

Breakpoint 4, 0x0000007fb6dbe568 in eglGetDisplay () from /usr/lib64/libEGL.so.1
(gdb) bt
#0  0x0000007fb6dbe568 in eglGetDisplay () from /usr/lib64/libEGL.so.1
#1  0x0000007faf447008 in ?? () from /usr/lib64/qt5/plugins/
    wayland-graphics-integration-client/libwayland-egl.so
#2  0x0000007faf6168f0 in QtWaylandClient::QWaylandIntegration::
    initializeClientBufferIntegration() () from /usr/lib64/
    libQt5WaylandClient.so.5
#3  0x0000007faf616bfc in QtWaylandClient::QWaylandIntegration::
    clientBufferIntegration() const () from /usr/lib64/libQt5WaylandClient.so.5
#4  0x0000007faf616598 in QtWaylandClient::QWaylandIntegration::hasCapability(
    QPlatformIntegration::Capability) const ()
   from /usr/lib64/libQt5WaylandClient.so.5
#5  0x0000007fb88a2c18 in QSGRenderLoop::instance() () from /usr/lib64/
    libQt5Quick.so.5
#6  0x0000007fb88d32b4 in QQuickWindowPrivate::init(QQuickWindow*, 
    QQuickRenderControl*) () from /usr/lib64/libQt5Quick.so.5
#7  0x0000007fb897662c in QQuickView::QQuickView(QWindow*) () from /usr/lib64/
    libQt5Quick.so.5
#8  0x0000007fb8ba9a80 in MDeclarativeCachePrivate::qQuickView() () from /usr/
    lib64/libmdeclarativecache5.so.0
#9  0x000000555557a6ac in main (argc=<optimized out>, argv=0x7ffffff288) at 
    main.cpp:87
(gdb) c
Continuing.
library &quot;libui_compat_layer.so&quot; not found
library &quot;libGLESv2_adreno.so&quot; not found
library &quot;eglSubDriverAndroid.so&quot; not found
[3971689.925]  -> wl_display@1.get_registry(new id wl_registry@18)
[3971690.080]  -> wl_display@1.sync(new id wl_callback@19)

Breakpoint 3, 0x0000007fb6dbe580 in eglInitialize () from /usr/lib64/libEGL.so.1
(gdb) bt
#0  0x0000007fb6dbe580 in eglInitialize () from /usr/lib64/libEGL.so.1
#1  0x0000007faf44701c in ?? () from /usr/lib64/qt5/plugins/
    wayland-graphics-integration-client/libwayland-egl.so
#2  0x0000007faf6168f0 in QtWaylandClient::QWaylandIntegration::
    initializeClientBufferIntegration() () from /usr/lib64/
    libQt5WaylandClient.so.5
#3  0x0000007faf616bfc in QtWaylandClient::QWaylandIntegration::
    clientBufferIntegration() const () from /usr/lib64/libQt5WaylandClient.so.5
#4  0x0000007faf616598 in QtWaylandClient::QWaylandIntegration::hasCapability(
    QPlatformIntegration::Capability) const ()
   from /usr/lib64/libQt5WaylandClient.so.5
#5  0x0000007fb88a2c18 in QSGRenderLoop::instance() () from /usr/lib64/
    libQt5Quick.so.5
#6  0x0000007fb88d32b4 in QQuickWindowPrivate::init(QQuickWindow*, 
    QQuickRenderControl*) () from /usr/lib64/libQt5Quick.so.5
#7  0x0000007fb897662c in QQuickView::QQuickView(QWindow*) () from /usr/lib64/
    libQt5Quick.so.5
#8  0x0000007fb8ba9a80 in MDeclarativeCachePrivate::qQuickView() () from /usr/
    lib64/libmdeclarativecache5.so.0
#9  0x000000555557a6ac in main (argc=<optimized out>, argv=0x7ffffff288) at 
    main.cpp:87
(gdb) c
Continuing.
greHome from GRE_HOME:/usr/bin
libxul.so is not found, in /usr/bin/libxul.so
Created LOG for EmbedLiteTrace
[...]
There are no more hits after this point, which is more than a little surprising to me. It means that all of these calls are being managed by the Qt Wayland client; none of them are being called directly from the gecko code.

This is in stark contrast to the ESR 91 code, where they're called several times as we saw above. Having pored over this EGL initialisation code for so long now, it's frustrating to find there are still differences. On the other hand I'm pleased that this might be a lead that could solve the serious crash that's happening on Sailfish OS 4.6.

I'm going back to ESR 91 to get the full set of backtracs for all calls to the same two methods now. So, first, I install all of the ESR 91 packages:
$ rpm -U --force xulrunner-qt5-91.*.rpm xulrunner-qt5-debuginfo-91.*.rpm \
    xulrunner-qt5-debugsource-91.*.rpm xulrunner-qt5-misc-91.*.rpm \
    qtmozembed-qt5-1.*.rpm qtmozembed-qt5-debuginfo-1.*.rpm \
    qtmozembed-qt5-debugsource-1.*.rpm sailfish-components-webview-qt5-1.*.rpm \
    sailfish-components-webview-qt5-debuginfo-1.*.rpm \
    sailfish-components-webview-qt5-debugsource-1.*.rpm \
    sailfish-components-webview-qt5-pickers-1.*.rpm \
    sailfish-components-webview-qt5-popups-1.*.rpm \
    embedlite-components-qt5-1.*.rpm embedlite-components-qt5-debuginfo-1.*.rpm 
    \
    embedlite-components-qt5-debugsource-1.*.rpm \
    sailfish-browser-2.*.rpm sailfish-browser-debuginfo-2.*.rpm \
    sailfish-browser-debugsource-2.*.rpm sailfish-browser-settings-2.*.rpm \
    mapplauncherd-booster-browser-0.*.rpm \
    mapplauncherd-booster-browser-debuginfo-0.*.rpm \
    mapplauncherd-booster-browser-debugsource-0.*.rpm harbour-webview-0.*.rpm
Now I'm going to add the same breakpoints and capture the backtraces. Note in the log below that there are five calls in total to the two methods. The first two are made by the Qt Wayland client as on ESR 78. The subsequent three are all made from the gecko code.
$ WAYLAND_DEBUG=1 gdb sailfish-browser
[...]
(gdb) b eglInitialize
Breakpoint 2 at 0x7fb6bbb580
(gdb) b eglGetDisplay
Breakpoint 3 at 0x7fb6bbb568
(gdb) info break
Num     Type           Disp Enb Address            What
2       breakpoint     keep y   0x0000007fb6bbb580 <eglInitialize+16>
3       breakpoint     keep y   0x0000007fb6bbb568 <eglGetDisplay+8>
(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 
[...]
[ 804848.529] wl_registry@2.global(9, &quot;wl_seat&quot;, 3)
[ 804848.907]  -> wl_registry@2.bind(9, &quot;wl_seat&quot;, 3, new id 
    [unknown]@12)
[ 804849.019]  -> wl_data_device_manager@5.get_data_device(new id 
    wl_data_device@13, wl_seat@12)
[ 804849.110] wl_registry@2.global(10, &quot;wl_output&quot;, 2)
[ 804849.219]  -> wl_registry@2.bind(10, &quot;wl_output&quot;, 2, new id 
    [unknown]@14)
[ 804849.291]  -> wl_display@1.sync(new id wl_callback@15)
[ 804849.430] wl_registry@2.global(11, &quot;wl_shell&quot;, 1)
[ 804849.471] wl_registry@2.global(12, &quot;lipstick_recorder_manager&quot;, 1)
[ 804849.503] wl_registry@2.global(13, &quot;alien_manager&quot;, 1)
[ 804849.534] wl_callback@3.done(1891)
[ 804851.429] wl_display@1.delete_id(8)
[ 804851.496] wl_display@1.delete_id(15)
[ 804851.570] qt_hardware_integration@7.client_backend(&quot;wayland-egl&quot;)
[ 804851.869] wl_callback@8.done(1891)
[ 804851.912] qt_touch_extension@10.configure(0)
[ 804851.940] qt_windowmanager@11.hints(1)
[ 804851.968] wl_seat@12.capabilities(7)
[ 804854.670]  -> wl_seat@12.get_keyboard(new id wl_keyboard@8)
[ 804854.876]  -> wl_seat@12.get_pointer(new id wl_pointer@3)
[ 804855.000]  -> wl_compositor@4.create_surface(new id wl_surface@16)
[ 804855.125]  -> wl_seat@12.get_touch(new id wl_touch@17)
[ 804855.273] wl_output@14.geometry(0, 0, 60, 139, 0, &quot;&quot;, 
    &quot;&quot;, 0)
[ 804855.471] wl_output@14.mode(3, 1080, 2520, 60000)
[ 804855.514] wl_output@14.scale(1)
[ 804855.541] wl_output@14.done()
[ 804855.634] wl_callback@15.done(1891)
[ 804856.118]  -> wl_shm@6.create_pool(new id wl_shm_pool@15, fd 5, 4096)
[ 804860.545]  -> wl_shm_pool@15.resize(8832)
[ 804860.737]  -> wl_shm_pool@15.resize(18624)
[...]
[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=0x7ffffff288) at 
    main.cpp:88
(gdb) c
Continuing.
[...]
[ 870219.641]  -> wl_display@1.get_registry(new id wl_registry@18)
[ 870219.733]  -> wl_display@1.sync(new id wl_callback@19)

Breakpoint 2, 0x0000007fb6bbb580 in eglInitialize () from /usr/lib64/libEGL.so.1
#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=0x7ffffff288) at 
    main.cpp:88
(gdb) c
Continuing.
[...]
[1148170.148] wl_callback@42.done(1900)
[1148175.058]  -> wl_surface@20.frame(new id wl_callback@42)
[1148175.146]  -> wl_surface@20.attach(wl_buffer@4278190080, 0, 0)
[1148175.182]  -> wl_surface@20.damage(0, 0, 1080, 2520)
[1148175.239]  -> wl_surface@20.commit()
[1148175.270]  -> wl_display@1.sync(new id wl_callback@50)
[1148176.064] discarded [unknown]@50.[event 0](0 fd, 12 byte)
[1148176.128] wl_display@1.delete_id(50)
[1148194.446] wl_display@1.delete_id(42)
[Switching to Thread 0x7efadfe830 (LWP 16236)]

Thread 38 &quot;Compositor&quot; hit Breakpoint 2, 0x0000007fb6bbb580 in 
    eglInitialize () from /usr/lib64/libEGL.so.1
(gdb) bt
#0  0x0000007fb6bbb580 in eglInitialize () from /usr/lib64/libEGL.so.1
#1  0x0000007fba06b5fc in mozilla::gl::GLLibraryEGL::fInitialize (minor=0x0, 
    major=0x0, dpy=0x1, this=0x7e9c111cb0)
    at gfx/gl/GLLibraryEGL.h:283
#2  mozilla::gl::EglDisplay::Create (lib=..., display=<optimized out>, 
    isWarp=isWarp@entry=false)
    at gfx/gl/GLLibraryEGL.cpp:676
#3  0x0000007fba06b690 in mozilla::gl::GetAndInitDisplay (egl=..., 
    displayType=displayType@entry=0x0, display=<optimized out>, 
    display@entry=0x1)
    at gfx/gl/GLLibraryEGL.cpp:154
#4  0x0000007fba06bc74 in mozilla::gl::GLLibraryEGL::CreateDisplay (
    this=this@entry=0x7e9c111cb0, forceAccel=forceAccel@entry=false, 
    out_failureId=out_failureId@entry=0x7efadfcfe0, aDisplay=aDisplay@entry=0x1)
    at gfx/gl/GLLibraryEGL.cpp:813
#5  0x0000007fba06c0d4 in mozilla::gl::GLLibraryEGL::Init (
    this=this@entry=0x7e9c111cb0, forceAccel=forceAccel@entry=false, 
    out_failureId=out_failureId@entry=0x7efadfcfe0, aDisplay=aDisplay@entry=0x1)
    at gfx/gl/GLLibraryEGL.cpp:504
#6  0x0000007fba06c918 in mozilla::gl::GLLibraryEGL::Create (
    out_failureId=out_failureId@entry=0x7efadfcfe0, aDisplay=0x1)
    at gfx/gl/GLLibraryEGL.cpp:345
#7  0x0000007fba06cf50 in mozilla::gl::GLContextProviderEGL::
    CreateWrappingExisting (aContext=0x7e9c004230, aSurface=0x7fa000f610, 
    aDisplay=<optimized out>) at gfx/gl/GLContextProviderEGL.cpp:1008
#8  0x0000007fbca77924 in mozilla::embedlite::nsWindow::GetGLContext (
    this=this@entry=0x7f8c78ef00)
    at mobile/sailfishos/embedshared/nsWindow.cpp:405
#9  0x0000007fbca77adc in mozilla::embedlite::nsWindow::GetNativeData (
    this=0x7f8c78ef00, aDataType=12)
    at mobile/sailfishos/embedshared/nsWindow.cpp:173
#10 0x0000007fba0e8928 in mozilla::layers::CompositorOGL::CreateContext (
    this=this@entry=0x7e9c111220)
    at gfx/layers/opengl/CompositorOGL.cpp:232
#11 0x0000007fba0fdb50 in mozilla::layers::CompositorOGL::Initialize (
    this=0x7e9c111220, out_failureReason=0x7efadfd5a0)
    at gfx/layers/opengl/CompositorOGL.cpp:387
#12 0x0000007fba21d584 in mozilla::layers::CompositorBridgeParent::
    NewCompositor (this=this@entry=0x7f8c9f23b0, aBackendHints=...)
    at gfx/layers/ipc/CompositorBridgeParent.cpp:1493
#13 0x0000007fba2343e8 in mozilla::layers::CompositorBridgeParent::
    InitializeLayerManager (this=this@entry=0x7f8c9f23b0, aBackendHints=...)
    at gfx/layers/ipc/CompositorBridgeParent.cpp:1436
#14 0x0000007fba234574 in mozilla::layers::CompositorBridgeParent::
    AllocPLayerTransactionParent (this=this@entry=0x7f8c9f23b0, 
    aBackendHints=..., aId=...)
    at gfx/layers/ipc/CompositorBridgeParent.cpp:1546
#15 0x0000007fbca5eda4 in mozilla::embedlite::EmbedLiteCompositorBridgeParent::
    AllocPLayerTransactionParent (this=0x7f8c9f23b0, aBackendHints=..., 
    aId=...) at mobile/sailfishos/embedthread/
    EmbedLiteCompositorBridgeParent.cpp:80
#16 0x0000007fb9af84f4 in mozilla::layers::PCompositorBridgeParent::
    OnMessageReceived (this=0x7f8c9f23b0, msg__=...) at 
    PCompositorBridgeParent.cpp:1285
[...]
#31 0x0000007fb706b7cc in thread_start () at ../sysdeps/unix/sysv/linux/aarch64/
    clone.S:78
(gdb) c
Continuing.
[1189632.011] wl_shell_surface@22.ping(1901)
[1189632.195]  -> wl_shell_surface@22.pong(1901)

Thread 38 &quot;Compositor&quot; hit Breakpoint 3, 0x0000007fb6bbb568 in 
    eglGetDisplay () from /usr/lib64/libEGL.so.1
(gdb) bt
#0  0x0000007fb6bbb568 in eglGetDisplay () from /usr/lib64/libEGL.so.1
#1  0x0000007fba06b6c4 in mozilla::gl::GLLibraryEGL::fGetDisplay (
    display_id=0x0, this=0x7e9c111cb0)
    at gfx/gl/GLLibraryEGL.h:193
#2  mozilla::gl::GetAndInitDisplay (egl=..., displayType=displayType@entry=0x0, 
    display=display@entry=0x0)
    at gfx/gl/GLLibraryEGL.cpp:151
#3  0x0000007fba06bc74 in mozilla::gl::GLLibraryEGL::CreateDisplay (
    this=this@entry=0x7e9c111cb0, forceAccel=forceAccel@entry=false, 
    out_failureId=out_failureId@entry=0x7efadfcfe0, aDisplay=aDisplay@entry=0x0)
    at gfx/gl/GLLibraryEGL.cpp:813
#4  0x0000007fba06cd5c in mozilla::gl::GLLibraryEGL::DefaultDisplay (
    this=0x7e9c111cb0, out_failureId=out_failureId@entry=0x7efadfcfe0)
    at gfx/gl/GLLibraryEGL.cpp:745
#5  0x0000007fba06ce7c in mozilla::gl::GLContextProviderEGL::
    CreateWrappingExisting (aContext=0x7e9c004230, aSurface=0x7fa000f610, 
    aDisplay=<optimized out>)
    at ${PROJECT}/obj-build-mer-qt-xr/dist/include/mozilla/StaticPtr.h:150
#6  0x0000007fbca77924 in mozilla::embedlite::nsWindow::GetGLContext (
    this=this@entry=0x7f8c78ef00)
    at mobile/sailfishos/embedshared/nsWindow.cpp:405
#7  0x0000007fbca77adc in mozilla::embedlite::nsWindow::GetNativeData (
    this=0x7f8c78ef00, aDataType=12)
    at mobile/sailfishos/embedshared/nsWindow.cpp:173
#8  0x0000007fba0e8928 in mozilla::layers::CompositorOGL::CreateContext (
    this=this@entry=0x7e9c111220)
    at gfx/layers/opengl/CompositorOGL.cpp:232
#9  0x0000007fba0fdb50 in mozilla::layers::CompositorOGL::Initialize (
    this=0x7e9c111220, out_failureReason=0x7efadfd5a0)
    at gfx/layers/opengl/CompositorOGL.cpp:387
#10 0x0000007fba21d584 in mozilla::layers::CompositorBridgeParent::
    NewCompositor (this=this@entry=0x7f8c9f23b0, aBackendHints=...)
    at gfx/layers/ipc/CompositorBridgeParent.cpp:1493
#11 0x0000007fba2343e8 in mozilla::layers::CompositorBridgeParent::
    InitializeLayerManager (this=this@entry=0x7f8c9f23b0, aBackendHints=...)
    at gfx/layers/ipc/CompositorBridgeParent.cpp:1436
#12 0x0000007fba234574 in mozilla::layers::CompositorBridgeParent::
    AllocPLayerTransactionParent (this=this@entry=0x7f8c9f23b0, 
    aBackendHints=..., aId=...)
    at gfx/layers/ipc/CompositorBridgeParent.cpp:1546
#13 0x0000007fbca5eda4 in mozilla::embedlite::EmbedLiteCompositorBridgeParent::
    AllocPLayerTransactionParent (this=0x7f8c9f23b0, aBackendHints=..., 
    aId=...) at mobile/sailfishos/embedthread/
    EmbedLiteCompositorBridgeParent.cpp:80
#14 0x0000007fb9af84f4 in mozilla::layers::PCompositorBridgeParent::
    OnMessageReceived (this=0x7f8c9f23b0, msg__=...) at 
    PCompositorBridgeParent.cpp:1285
[...]
#29 0x0000007fb706b7cc in thread_start () at ../sysdeps/unix/sysv/linux/aarch64/
    clone.S:78
(gdb) c
Continuing.
[1205964.749] wl_shell_surface@22.ping(1902)
[1205965.156]  -> wl_shell_surface@22.pong(1902)
[1211002.805] wl_shell_surface@22.ping(1903)
[1211003.507]  -> wl_shell_surface@22.pong(1903)
library &quot;libui_compat_layer.so&quot; not found
[1213267.127]  -> wl_display@1.get_registry(new id wl_registry@2)
[1213267.719]  -> wl_display@1.sync(new id wl_callback@3)

Thread 38 &quot;Compositor&quot; hit Breakpoint 2, 0x0000007fb6bbb580 in 
    eglInitialize () from /usr/lib64/libEGL.so.1
(gdb) bt
#0  0x0000007fb6bbb580 in eglInitialize () from /usr/lib64/libEGL.so.1
#1  0x0000007fba06b5fc in mozilla::gl::GLLibraryEGL::fInitialize (minor=0x0, 
    major=0x0, dpy=0x1, this=0x7e9c111cb0)
    at gfx/gl/GLLibraryEGL.h:283
#2  mozilla::gl::EglDisplay::Create (lib=..., display=<optimized out>, 
    isWarp=isWarp@entry=false)
    at gfx/gl/GLLibraryEGL.cpp:676
#3  0x0000007fba06b690 in mozilla::gl::GetAndInitDisplay (egl=..., 
    displayType=displayType@entry=0x0, display=<optimized out>, 
    display@entry=0x0)
    at gfx/gl/GLLibraryEGL.cpp:154
#4  0x0000007fba06bc74 in mozilla::gl::GLLibraryEGL::CreateDisplay (
    this=this@entry=0x7e9c111cb0, forceAccel=forceAccel@entry=false, 
    out_failureId=out_failureId@entry=0x7efadfcfe0, aDisplay=aDisplay@entry=0x0)
    at gfx/gl/GLLibraryEGL.cpp:813
#5  0x0000007fba06cd5c in mozilla::gl::GLLibraryEGL::DefaultDisplay (
    this=0x7e9c111cb0, out_failureId=out_failureId@entry=0x7efadfcfe0)
    at gfx/gl/GLLibraryEGL.cpp:745
#6  0x0000007fba06ce7c in mozilla::gl::GLContextProviderEGL::
    CreateWrappingExisting (aContext=0x7e9c004230, aSurface=0x7fa000f610, 
    aDisplay=<optimized out>)
    at ${PROJECT}/obj-build-mer-qt-xr/dist/include/mozilla/StaticPtr.h:150
#7  0x0000007fbca77924 in mozilla::embedlite::nsWindow::GetGLContext (
    this=this@entry=0x7f8c78ef00)
    at mobile/sailfishos/embedshared/nsWindow.cpp:405
#8  0x0000007fbca77adc in mozilla::embedlite::nsWindow::GetNativeData (
    this=0x7f8c78ef00, aDataType=12)
    at mobile/sailfishos/embedshared/nsWindow.cpp:173
#9  0x0000007fba0e8928 in mozilla::layers::CompositorOGL::CreateContext (
    this=this@entry=0x7e9c111220)
    at gfx/layers/opengl/CompositorOGL.cpp:232
#10 0x0000007fba0fdb50 in mozilla::layers::CompositorOGL::Initialize (
    this=0x7e9c111220, out_failureReason=0x7efadfd5a0)
    at gfx/layers/opengl/CompositorOGL.cpp:387
#11 0x0000007fba21d584 in mozilla::layers::CompositorBridgeParent::
    NewCompositor (this=this@entry=0x7f8c9f23b0, aBackendHints=...)
    at gfx/layers/ipc/CompositorBridgeParent.cpp:1493
#12 0x0000007fba2343e8 in mozilla::layers::CompositorBridgeParent::
    InitializeLayerManager (this=this@entry=0x7f8c9f23b0, aBackendHints=...)
    at gfx/layers/ipc/CompositorBridgeParent.cpp:1436
#13 0x0000007fba234574 in mozilla::layers::CompositorBridgeParent::
    AllocPLayerTransactionParent (this=this@entry=0x7f8c9f23b0, 
    aBackendHints=..., aId=...)
    at gfx/layers/ipc/CompositorBridgeParent.cpp:1546
#14 0x0000007fbca5eda4 in mozilla::embedlite::EmbedLiteCompositorBridgeParent::
    AllocPLayerTransactionParent (this=0x7f8c9f23b0, aBackendHints=..., 
    aId=...) at mobile/sailfishos/embedthread/
    EmbedLiteCompositorBridgeParent.cpp:80
#15 0x0000007fb9af84f4 in mozilla::layers::PCompositorBridgeParent::
    OnMessageReceived (this=0x7f8c9f23b0, msg__=...) at 
    PCompositorBridgeParent.cpp:1285
[...]
#30 0x0000007fb706b7cc in thread_start () at ../sysdeps/unix/sysv/linux/aarch64/
    clone.S:78
(gdb) c
Continuing.
[1226523.918] wl_shell_surface@22.ping(1904)
[1226524.854]  -> wl_shell_surface@22.pong(1904)
[New Thread 0x7efa5fe830 (LWP 16303)]

Thread 38 &quot;Compositor&quot; received signal SIGSEGV, Segmentation fault.
0x0000007faef77360 in ?? ()
(gdb) bt
#0  0x0000007faef77360 in ?? ()
#1  0x0000007f7598c6b0 in ?? ()
Backtrace stopped: not enough registers or memory available to unwind further
(gdb) 
Comparing against the ESR 78 log makes clear that something is going wrong with the ESR 91 exeuction. The first two calls made by the Qt Wayland client are correct. The three following these, made from inside the gecko code, shouldn't be happening at all.

Next I want to find out why these same calls aren't happening when running the ESR 78 code. It seems the display is being returned as 0x01, which is enough to prevent any further display initialisation code being needed:
Thread 37 &quot;Compositor&quot; hit Breakpoint 2, mozilla::gl::
    GetAndInitDisplay (display=0x1, displayType=0x0, egl=...) at gfx/gl/
    GLLibraryEGL.cpp:237
237       if (display == EGL_NO_DISPLAY) {
(gdb) p display
$1 = (EGLDisplay) 0x1
(gdb) bt
#0  mozilla::gl::GetAndInitDisplay (display=0x1, displayType=0x0, egl=...)
    at gfx/gl/GLLibraryEGL.cpp:237
#1  mozilla::gl::GLLibraryEGL::CreateDisplay (this=this@entry=0x7e9c1117f0, 
    forceAccel=forceAccel@entry=false, gfxInfo=..., 
    out_failureId=out_failureId@entry=0x7ee3107388, aDisplay=aDisplay@entry=0x1)
    at gfx/gl/GLLibraryEGL.cpp:826
#2  0x0000007fba4d5174 in mozilla::gl::GLLibraryEGL::DoEnsureInitialized (
    this=0x7e9c1117f0, forceAccel=<optimized out>, 
    out_failureId=out_failureId@entry=0x7ee3107388, aDisplay=0x1)
    at gfx/gl/GLLibraryEGL.cpp:578
#3  0x0000007fba4d5860 in mozilla::gl::GLLibraryEGL::DoEnsureInitialized (
    aDisplay=<optimized out>, out_failureId=0x7ee3107388, 
    forceAccel=<optimized out>, this=<optimized out>) at gfx/gl/
    GLLibraryEGL.cpp:388
#4  0x0000007fba4d598c in mozilla::gl::GLContextProviderEGL::
    CreateWrappingExisting (aContext=0x7e9c004db0, aSurface=0x55559410d0, 
    aDisplay=<optimized out>) at gfx/gl/GLContextProviderEGL.cpp:1098
#5  0x0000007fbcc8c910 in mozilla::embedlite::nsWindow::GetGLContext (
    this=0x7f8cc64ab0)
    at mobile/sailfishos/embedshared/nsWindow.cpp:415
#6  0x0000007fba55e0d8 in mozilla::layers::CompositorOGL::CreateContext (
    this=this@entry=0x7e9c003420)
    at gfx/layers/opengl/CompositorOGL.cpp:228
#7  0x0000007fba586ef8 in mozilla::layers::CompositorOGL::Initialize (
    this=0x7e9c003420, out_failureReason=0x7ee31077c0)
    at gfx/layers/opengl/CompositorOGL.cpp:374
#8  0x0000007fba675548 in mozilla::layers::CompositorBridgeParent::
    NewCompositor (this=this@entry=0x7f8c779b50, aBackendHints=...)
    at gfx/layers/ipc/CompositorBridgeParent.cpp:1534
#9  0x0000007fba6887ec in mozilla::layers::CompositorBridgeParent::
    InitializeLayerManager (this=0x7f8c779b50, aBackendHints=...)
    at gfx/layers/ipc/CompositorBridgeParent.cpp:1447
#10 0x0000007fba688968 in mozilla::layers::CompositorBridgeParent::
    AllocPLayerTransactionParent (this=this@entry=0x7f8c779b50, 
    aBackendHints=..., aId=...)
    at gfx/layers/ipc/CompositorBridgeParent.cpp:1587
#11 0x0000007fbcc6aa44 in mozilla::embedlite::EmbedLiteCompositorBridgeParent::
    AllocPLayerTransactionParent (this=0x7f8c779b50, aBackendHints=..., 
    aId=...) at mobile/sailfishos/embedthread/
    EmbedLiteCompositorBridgeParent.cpp:78
#12 0x0000007fb9ecbfac in mozilla::layers::PCompositorBridgeParent::
    OnMessageReceived (this=0x7f8c779b50, msg__=...) at 
    PCompositorBridgeParent.cpp:1391
[...]
#26 0x0000007fb726e7cc in thread_start () at ../sysdeps/unix/sysv/linux/aarch64/
    clone.S:78
(gdb) 
As we can see here, the display is set to 0x01 and seems to be coming from the call to RequestGLContext() in the following method:
GLContext*
nsWindow::GetGLContext() const
{
  LOGT(&quot;this:%p, UseExternalContext:%d&quot;, this, sUseExternalGLContext);
  if (sUseExternalGLContext) {
    void* context = nullptr;
    void* surface = nullptr;
    void* display = nullptr;
    if (mWindow && mWindow->GetListener()->RequestGLContext(context, surface, 
    display)) {
      MOZ_ASSERT(context && surface);
      RefPtr<GLContext> mozContext = GLContextProvider::CreateWrappingExisting(
    context, surface, display);
      if (!mozContext || !mozContext->Init()) {
        NS_ERROR(&quot;Failed to initialize external GL context!&quot;);
        return nullptr;
      }
      return mozContext.forget().take();
    } else {
      NS_ERROR(&quot;Embedder wants to use external GL context without actually 
    providing it!&quot;);
    }
  }
  return nullptr;
}
This then pulls in the display from qtmozembed like so:
Thread 37 &quot;Compositor&quot; hit Breakpoint 3, QMozWindowPrivate::
    RequestGLContext (this=0x5555dc56e0, context=@0x7ee31643d0: 0x0, 
    surface=@0x7ee31643d8: 0x0, display=@0x7ee31643e0: 0x0) at qmozwindow_p.cpp:
    133
133         q.requestGLContext();
(gdb) bt
#0  QMozWindowPrivate::RequestGLContext (this=0x5555dc56e0, 
    context=@0x7ee31643d0: 0x0, surface=@0x7ee31643d8: 0x0, 
    display=@0x7ee31643e0: 0x0)
    at qmozwindow_p.cpp:133
#1  0x0000007fbcc8c8fc in mozilla::embedlite::nsWindow::GetGLContext (
    this=0x7f8ccce770)
    at mobile/sailfishos/embedshared/nsWindow.cpp:413
#2  0x0000007fba55e0d8 in mozilla::layers::CompositorOGL::CreateContext (
    this=this@entry=0x7e9c003420)
    at gfx/layers/opengl/CompositorOGL.cpp:228
#3  0x0000007fba586ef8 in mozilla::layers::CompositorOGL::Initialize (
    this=0x7e9c003420, out_failureReason=0x7ee31647c0)
    at gfx/layers/opengl/CompositorOGL.cpp:374
#4  0x0000007fba675548 in mozilla::layers::CompositorBridgeParent::
    NewCompositor (this=this@entry=0x7f8cae31e0, aBackendHints=...)
    at gfx/layers/ipc/CompositorBridgeParent.cpp:1534
#5  0x0000007fba6887ec in mozilla::layers::CompositorBridgeParent::
    InitializeLayerManager (this=0x7f8cae31e0, aBackendHints=...)
    at gfx/layers/ipc/CompositorBridgeParent.cpp:1447
#6  0x0000007fba688968 in mozilla::layers::CompositorBridgeParent::
    AllocPLayerTransactionParent (this=this@entry=0x7f8cae31e0, 
    aBackendHints=..., aId=...)
    at gfx/layers/ipc/CompositorBridgeParent.cpp:1587
#7  0x0000007fbcc6aa44 in mozilla::embedlite::EmbedLiteCompositorBridgeParent::
    AllocPLayerTransactionParent (this=0x7f8cae31e0, aBackendHints=..., 
    aId=...) at mobile/sailfishos/embedthread/
    EmbedLiteCompositorBridgeParent.cpp:78
#8  0x0000007fb9ecbfac in mozilla::layers::PCompositorBridgeParent::
    OnMessageReceived (this=0x7f8cae31e0, msg__=...) at 
    PCompositorBridgeParent.cpp:1391
[...]
#22 0x0000007fb726e7cc in thread_start () at ../sysdeps/unix/sysv/linux/aarch64/
    clone.S:78
(gdb) n
mozilla::embedlite::nsWindow::GetGLContext (this=0x7f8ccce770) at mobile/
    sailfishos/embedshared/nsWindow.cpp:415
415           RefPtr<GLContext> mozContext = GLContextProvider::
    CreateWrappingExisting(context, surface, display);
(gdb) n

Thread 37 &quot;Compositor&quot; hit Breakpoint 2, mozilla::gl::
    GetAndInitDisplay (display=0x1, displayType=0x0, egl=...) at gfx/gl/
    GLLibraryEGL.cpp:237
237       if (display == EGL_NO_DISPLAY) {
(gdb) p display
$3 = (EGLDisplay) 0x1
(gdb) 
Looking back at the debugger logs for ESR 91 we see something quite different. There the display starts off as 0x01, which is correct, but this doesn't prevent a call to eglInitialize() being made, which is incorrect. Looking through the code this can be attributed to a lack of guarding around the initialise call in the EglDisplay::Create() method:
// static
std::shared_ptr<EglDisplay> EglDisplay::Create(GLLibraryEGL& lib,
                                               const EGLDisplay display,
                                               const bool isWarp) {
  // Retrieve the EglDisplay if it already exists
  {
    const auto itr = lib.mActiveDisplays.find(display);
    if (itr != lib.mActiveDisplays.end()) {
      const auto ret = itr->second.lock();
      if (ret) {
        return ret;
      }
    }
  }

  if (!lib.fInitialize(display, nullptr, nullptr)) {
    return nullptr;
  }
[...]
We can wrap the call to fInitialize() in a condition to stop this happening, like this:
  if (display == EGL_NO_DISPLAY) {
    if (!lib.fInitialize(display, nullptr, nullptr)) {
      return nullptr;
    }
  }
That should fix the first one. However we then have a call to fGetDisplay() which seems to be happening due to the display value being set to 0x00. Why that's happening I do not know. However, right now it's nearly midnight and I'm halfway between Jersey and Great Britain on a ferry. The Ferry docks at 6 am and so enforces a 5 am wake-up call on all passengers. So that means it's most definitely time for me to pause for the day and head to bed.

I'm going to leave the build running during the trip and with any luck it'll be completed by the time the ferry docks.

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