Closed Bug 1670545 Opened 4 years ago Closed 3 years ago

MOZ_X11_EGL: Startup crash without crash report when setting mesa_glthread=true env var (DRI3/X11 is not thread safe). Can PR_SetEnv("mesa_glthread=false") be added to the X11 EGL backend?

Categories

(Core :: Graphics, defect)

Firefox 82
x86_64
Linux
defect

Tracking

()

RESOLVED FIXED
94 Branch
Tracking Status
firefox-esr78 --- unaffected
firefox-esr91 --- disabled
firefox82 --- disabled
firefox89 --- disabled
firefox90 --- disabled
firefox91 --- disabled
firefox92 --- disabled
firefox93 --- disabled
firefox94 --- fixed

People

(Reporter: meisnub, Assigned: rmader)

References

(Blocks 1 open bug)

Details

(Keywords: crash)

Attachments

(2 files)

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:82.0) Gecko/20100101 Firefox/82.0

Steps to reproduce:

have amdgpu(not amdgpu-pro) (idk about other gpu's situation)

  1. export env
    $ export mesa_glthread="true"
    $ export MOZ_X11_EGL="1"

  2. start firefox
    $ firefox

Actual results:

Can't find symbol 'eglGetNativeClientBufferANDROID'.
Can't find symbol 'eglQuerySurfacePointerANGLE'.
Can't find symbol 'eglCreateStreamKHR'.
Can't find symbol 'eglDestroyStreamKHR'.
Can't find symbol 'eglQueryStreamKHR'.
Can't find symbol 'eglStreamConsumerGLTextureExternalKHR'.
Can't find symbol 'eglStreamConsumerAcquireKHR'.
Can't find symbol 'eglStreamConsumerReleaseKHR'.
Can't find symbol 'eglStreamConsumerGLTextureExternalAttribsNV'.
Can't find symbol 'eglCreateStreamProducerD3DTextureANGLE'.
Can't find symbol 'eglStreamPostD3DTextureANGLE'.
Exiting due to channel error.
Segmentation fault (core dumped)

Expected results:

just starting browser, it's problem in xorg only, on wayland (MOZ_ENABLE_WAYLAND=1 + mesa_glthread=true) works good

1 guy say me, it's looks like problem in mesa (idk true is or not)

I could not reproduce this issue on Ubuntu 20.04 and Firefox 81.0.2, but I do not have an AMD graphic card - tried on Intel(R) HD Graphics 530. I'm assigning the Graphics component, please move this issue to the right component if this is not the correct one. Thanks!

Component: Untriaged → Graphics
Product: Firefox → Core

A crash reporter should open. Please report the crash, then open Firefox without mesa_glthread, type about:support into your address bar, press enter, click on "Copy text to clipboard" and paste it here. Thanks!

Keywords: crash
OS: Unspecified → Linux
Hardware: Unspecified → x86_64
Attached file about:support

A crash reporter should open

not openning:(

in about:crashes i get "No crash reports have been submitted."

i try reproduce this on new profile, and i noticed for crash need enable webrender (gfx.webrender.all=true gfx.webrender.enabled=true)

hmmm, this bug works with dri3 only, if set LIBGL_DRI3_DISABLE="true" then firefox stopped crashing.

The severity field is not set for this bug.
:jimm, could you have a look please?

For more information, please visit auto_nag documentation.

Flags: needinfo?(jmathies)
Severity: -- → S3
Flags: needinfo?(jmathies) → needinfo?(jmuizelaar)

Debian Testing, Gnome Xwayland, Intel Iris Graphics 6100 (BDW GT3)

Regular Nightly: Same as comment 0. No crash reporter opens.

mesa_glthread=true MOZ_X11_EGL=1 mozregression --launch 2021-09-13 --pref gfx.webrender.all:true

Process exited with code -11


Debug builds do not seem to crash.
mesa_glthread=true MOZ_X11_EGL=1 mozregression --launch 2021-09-13 --pref gfx.webrender.all:true -P stdout -B debug

0:30.44 INFO: b'[GFX2-]: glXWaitVideoSync failed to increment the sync counter.'


Last build before reenabling GLX vsync for EGL did also crash. Therefore, GLX vsync does not seem to be the cause of the crash.
mesa_glthread=true MOZ_X11_EGL=1 mozregression --repo autoland --launch 8ec50232ea5541b34962a496abaff720ebd81a73 --pref gfx.webrender.all:true

0:28.19 WARNING: Process exited with code -11


It could also intermittently crash right after initial EGL support (bug 1640048 comment 14):
mesa_glthread=true MOZ_X11_EGL=1 mozregression --launch 2020-07-03 --pref gfx.webrender.all:true layers.gpu-process.enabled:false

With GPU process, WebRender/EGL was successful on second try:
mesa_glthread=true MOZ_X11_EGL=1 mozregression --launch 2020-07-03 --pref gfx.webrender.all:true -a about:support

Compositing WebRender
Failure Log
(#0) CP+[GFX1-]: Receive IPC close with reason=AbnormalShutdown
(#1) Error Receive IPC close with reason=AbnormalShutdown
(#2) CP+[GFX1-]: Receive IPC close with reason=AbnormalShutdown


It seems like this crash is expected behavior. But it could be a problem for shipping EGL.

https://bugs.freedesktop.org/show_bug.cgi?id=104214#c25

DRI3 is not really thread-safe, so basically any change however small can break that mode of operation

https://mesa-dev.freedesktop.narkive.com/Zg8OJdXK/patch-v3-0-4-disable-glthread-if-libx11-isn-t-thread-safe

Disable glthread if libX11 isn't thread-safe

GLX backend does already set a Mesa env var.
https://searchfox.org/mozilla-central/rev/5f81c5091d442d829120e19477ba869ae5219709/gfx/gl/GLContextProviderGLX.cpp#80
If possible, it might be good to add PR_SetEnv("mesa_glthread=false"); to the X11 EGL backend to ensure it is disabled.

Status: UNCONFIRMED → NEW
Ever confirmed: true
Summary: firefox crashing when use mesa_glthread=true with x11 hardware acceleration(MOZ_X11_EGL=1) → MOZ_X11_EGL: Startup crash without crash report when setting mesa_glthread=true env var (DRI3/X11 is not thread safe). Can PR_SetEnv("mesa_glthread=false") be added to the X11 EGL backend?

This bug has been reported two times (bug 1689426).
IMHO: If PR_SetEnv("mesa_glthread=false") could not be added to the X11 EGL backend, then MOZ_X11_EGL should depend on bug 1653444.

Blocks: 1695933

Thanks, can reproduce. Will create such a patch.

The combination currently triggers crashes - not on Wayland though.
Put the code into non-shared code to not clutter GLContextProviderEGL.

Assignee: nobody → robert.mader
Status: NEW → ASSIGNED

Thanks, confirmed, this patch works.

Without this patch (bug 1695933 comment 9): Crash.
mesa_glthread=true MOZ_X11_EGL=1 mozregression --repo try --launch 7eeab9fde139c8f1471c5d5cd1a8605464f15f19 --pref gfx.webrender.all:true

With this patch, it's not possible to enable mesa_glthread: No crash.
mesa_glthread=true MOZ_X11_EGL=1 mozregression --repo try --launch 62d2a65f0384d3a237f79ef4674912b39644239a --pref gfx.webrender.all:true

Flags: needinfo?(jmuizelaar)
Pushed by robert.mader@posteo.de:
https://hg.mozilla.org/integration/autoland/rev/049d6ccbb9a5
Disable mesa_glthread on X11/EGL, r=aosmond
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 94 Branch
Blocks: 1744389
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: