Bug 1212324

Summary: Snapshot 20230612 broke chromium & QtWebEngine under (plasma) Wayland — crashing eglCreateContext failed with error EGL_BAD_ALLOC
Product: [openSUSE] openSUSE Tumbleweed Reporter: Mykola Krachkovsky <w01dnick>
Component: OtherAssignee: E-mail List <screening-team-bugs>
Status: RESOLVED DUPLICATE QA Contact: E-mail List <qa-bugs>
Severity: Normal    
Priority: P5 - None    
Version: Current   
Target Milestone: ---   
Hardware: x86-64   
OS: openSUSE Tumbleweed   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Attachments: coredumpctl info falkon
coredumpctl info kontact

Description Mykola Krachkovsky 2023-06-13 21:01:16 UTC
I'm using KDE Plasma with wayland session.
After update to 20230612 (I'm not sure if it's Mesa update or some other) Falkon stopped starting, crashed with SEGV and message:
`eglCreateContext failed with error EGL_BAD_ALLOC`

KMail also crashes in QtWebEngine with same error message.

Chromium (ozone wayland) starts with different messages about egl fails, and WebGL is very slow (maybe software?).

Starting Falkon & KMail with `QT_QPA_PLATFORM=xcb` helps, they are working (though I prefer native wayland).

I'm not sure what component should be chosen. While error is in QtWebEngine & chromium they were updated 4 days ago and were working fine. I suspect some regression in Mesa 23.1.2 (or something wasn't rebuilt for it), but I'm not sure, maybe it's some bug in KDE Frameworks 5.107.


Full Falkon message:
```
[12583:12627:0613/233449.485383:ERROR:gl_context_egl.cc(259)] eglCreateContext failed with error EGL_BAD_ALLOC
[1]    12583 segmentation fault (core dumped)  QT_QPA_PLATFORM=wayland falkon
```

Chromium:
```
[13523:13523:0613/234931.769269:ERROR:chrome_browser_cloud_management_controller.cc(162)] Cloud management controller initialization aborted as CBCM is not enabled.
[13576:13576:0613/234933.187669:ERROR:angle_platform_impl.cc(43)] Display.cpp:1023 (initialize): ANGLE Display::initialize error 12291: eglCreateContext failed
ERR: Display.cpp:1023 (initialize): ANGLE Display::initialize error 12291: eglCreateContext failed
[13576:13576:0613/234933.187871:ERROR:gl_display.cc(520)] EGL Driver message (Critical) eglInitialize: eglCreateContext failed
[13576:13576:0613/234933.188005:ERROR:gl_display.cc(790)] eglInitialize OpenGL failed with error EGL_BAD_ALLOC, trying next display type
[13576:13576:0613/234933.192176:ERROR:angle_platform_impl.cc(43)] Display.cpp:1023 (initialize): ANGLE Display::initialize error 12291: eglCreateContext failed
ERR: Display.cpp:1023 (initialize): ANGLE Display::initialize error 12291: eglCreateContext failed
[13576:13576:0613/234933.192285:ERROR:gl_display.cc(520)] EGL Driver message (Critical) eglInitialize: eglCreateContext failed
[13576:13576:0613/234933.192394:ERROR:gl_display.cc(790)] eglInitialize OpenGLES failed with error EGL_BAD_ALLOC
[13576:13576:0613/234933.192461:ERROR:gl_display.cc(824)] Initialization of all EGL display types failed.
[13576:13576:0613/234933.192527:ERROR:gl_ozone_egl.cc(26)] GLDisplayEGL::Initialize failed.
[13576:13576:0613/234933.242224:ERROR:angle_platform_impl.cc(43)] Display.cpp:1023 (initialize): ANGLE Display::initialize error 12291: eglCreateContext failed
ERR: Display.cpp:1023 (initialize): ANGLE Display::initialize error 12291: eglCreateContext failed
[13576:13576:0613/234933.242300:ERROR:gl_display.cc(520)] EGL Driver message (Critical) eglInitialize: eglCreateContext failed
[13576:13576:0613/234933.242366:ERROR:gl_display.cc(790)] eglInitialize OpenGL failed with error EGL_BAD_ALLOC, trying next display type
[13576:13576:0613/234933.246301:ERROR:angle_platform_impl.cc(43)] Display.cpp:1023 (initialize): ANGLE Display::initialize error 12291: eglCreateContext failed
ERR: Display.cpp:1023 (initialize): ANGLE Display::initialize error 12291: eglCreateContext failed
[13576:13576:0613/234933.246384:ERROR:gl_display.cc(520)] EGL Driver message (Critical) eglInitialize: eglCreateContext failed
[13576:13576:0613/234933.246439:ERROR:gl_display.cc(790)] eglInitialize OpenGLES failed with error EGL_BAD_ALLOC
[13576:13576:0613/234933.246511:ERROR:gl_display.cc(824)] Initialization of all EGL display types failed.
[13576:13576:0613/234933.246566:ERROR:gl_ozone_egl.cc(26)] GLDisplayEGL::Initialize failed.
[13576:13576:0613/234933.248073:ERROR:viz_main_impl.cc(186)] Exiting GPU process due to errors during initialization
[13603:7:0613/234934.726648:ERROR:command_buffer_proxy_impl.cc(128)] ContextResult::kTransientFailure: Failed to send GpuControl.CreateCommandBuffer.
```

KMail:
```
[13827:13885:0613/235006.845086:ERROR:gl_context_egl.cc(259)] eglCreateContext failed with error EGL_BAD_ALLOC
*** KMail got signal 11 (Exiting)
*** Dead letters dumped.
19 -- exe=/usr/bin/kmail
17 -- platform=wayland
14 -- appname=kmail
17 -- apppath=/usr/bin
10 -- signal=11
10 -- pid=13827
28 -- appversion=5.23.2 (23.04.2)
18 -- programname=KMail
31 -- bugaddress=submit@bugs.kde.org
KCrash: Application 'kmail' crashing...
The Wayland connection experienced a fatal error: Помилковий дескриптор файла
```
Comment 1 Mykola Krachkovsky 2023-06-13 21:05:19 UTC
Created attachment 867551 [details]
coredumpctl info falkon
Comment 2 Mykola Krachkovsky 2023-06-13 21:05:40 UTC
Created attachment 867552 [details]
coredumpctl info kontact
Comment 3 Mykola Krachkovsky 2023-06-13 21:12:33 UTC
Falkon backtrace:

```
#0  gl::GLContext::MakeCurrent(gl::GLSurface*) () at ./../../3rdparty/chromium/ui/gl/gl_context.cc:130
#1  0x00007fecb840ce4f in gl::GLSurfaceEGLQt::InitializeOneOff() () at release/../../3rdparty/chromium/base/memory/scoped_refptr.h:234
#2  0x00007fecb840d039 in ui::GLOzoneEGLQt::InitializeGLOneOffPlatform() (this=<optimized out>, this=<optimized out>) at /usr/src/debug/qtwebengine-everywhere-src-5.15.14/src/core/ozone/gl_ozone_egl_qt.cpp:103
#3  0x00007fecbad834ea in gl::init::InitializeGLOneOffPlatformImplementation(bool, bool, bool) () at ./../../3rdparty/chromium/ui/gl/init/gl_factory.cc:177
#4  0x00007fecbad83679 in InitializeGLOneOffPlatformHelper() () at ./../../3rdparty/chromium/ui/gl/init/gl_factory.cc:107
#5  0x00007fecbad890c8 in gl::init::InitializeGLNoExtensionsOneOff(bool) () at ./../../3rdparty/chromium/ui/gl/init/gl_factory.cc:134
#6  0x00007fecbb482e11 in gpu::GpuInit::InitializeInProcess(base::CommandLine*, gpu::GpuPreferences const&) () at ./../../3rdparty/chromium/gpu/ipc/service/gpu_init.cc:666
#7  0x00007fecbc8c83df in content::InProcessGpuThread::Init() () at ./../../3rdparty/chromium/content/gpu/in_process_gpu_thread.cc:57
#8  0x00007fecba505f55 in base::Thread::ThreadMain() () at ./../../3rdparty/chromium/base/threading/thread.cc:371
#9  0x00007fecba524f2b in ThreadFunc() () at ./../../3rdparty/chromium/base/threading/platform_thread_posix.cc:87
#10 0x00007fecbfc90c24 in start_thread () at /lib64/libc.so.6
#11 0x00007fecbfd18510 in clone3 () at /lib64/libc.so.6
```
Comment 4 Mykola Krachkovsky 2023-06-17 17:41:29 UTC
I've tried to fix crash with this patch [1]. But instead of crashing it just hang in (seemingly) infinite loop of creating surfaceless context and failing to do it.


1. https://build.opensuse.org/package/view_file/home:NickLion:branches:KDE:Qt:5.15/libqt5-qtwebengine/qtwebengine-fix-crash.patch?expand=1
Comment 5 Stefan Dirsch 2023-06-18 07:14:23 UTC
Another duplicate of boo#1212345 ?
Comment 6 Mykola Krachkovsky 2023-06-18 07:24:33 UTC
(In reply to Stefan Dirsch from comment #5)
> Another duplicate of boo#1212345 ?

Thanks for hint. Error message seems the same. Though this report was filled before ;)
Comment 7 Mykola Krachkovsky 2023-06-18 07:38:16 UTC
(In reply to Stefan Dirsch from comment #5)
> Another duplicate of boo#1212345 ?

Yes, that change fixes this problem as well, thank you again!

*** This bug has been marked as a duplicate of bug 1212345 ***