[regression] Starting in Mesa 12.0.2, Qt/QML apps don't render any more (logs say "QEGLPlatformContext: eglMakeCurrent failed: 3001")

Bug #1620934 reported by dinamic
32
This bug affects 5 people
Affects Status Importance Assigned to Milestone
Canonical System Image
Fix Released
Critical
Unassigned
Mir
Invalid
Undecided
Unassigned
mesa (Ubuntu)
Fix Released
Critical
Unassigned
qtmir (Ubuntu)
Invalid
Critical
Unassigned
qtubuntu (Ubuntu)
Invalid
Critical
Unassigned
unity8 (Ubuntu)
Invalid
Critical
Unassigned

Bug Description

nothing works, all apps, dash are just black windows - Ubuntu 16.10 + proposed (x86, and using Nvidia 8600GT with nouveau drivers)

and they fail with this error "QEGLPlatformContext: eglMakeCurrent failed: 3001"

Revision history for this message
dinamic (dinamic6661) wrote :
Revision history for this message
dinamic (dinamic6661) wrote :
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better. Please execute the following command only once, as it will automatically gather debugging information, in a terminal:
   apport-collect 1620934

When reporting bugs in the future please use apport by using 'ubuntu-bug' and the name of the package affected. You can learn more about this functionality at https://wiki.ubuntu.com/ReportingBugs.

Changed in mir:
status: New → Incomplete
Changed in qtmir:
status: New → Incomplete
Changed in unity8 (Ubuntu):
status: New → Incomplete
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Or more simply, please detail what graphics hardware (or VM) you are running on.

Changed in qtubuntu:
status: New → Incomplete
Revision history for this message
dinamic (dinamic6661) wrote :

it's a desktop install x86, and using Nvidia 8600GT with nouveau drivers

Revision history for this message
dinamic (dinamic6661) wrote :

it worked fine until the last update

description: updated
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Thanks. This is probably the same issue as bug 1553328. Mesa and many other bits have changed since that was reported. So the symptoms could easily have changed.

We (mir-team) should re-test nouveau for bug 1553328 and possibly change the description to match this bug if appropriate now.

Changed in mesa (Ubuntu):
status: New → Incomplete
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Just tried nouveau for the first time in a long time on a pure 16.10 machine.

Mir and Unity8 seems to work fine for me. Although not for that long, before I encountered a complete system freeze. And the usual nouveau errors in the kernel log.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Error 3001 is EGL_NOT_INITIALIZED. No idea how you got there though.

Please try attaching ~/.cache/upstart/unity8.log* and /var/log/lightdm/unity-system-compositor.log* so we can look for any errors that might have come earlier.

Revision history for this message
dinamic (dinamic6661) wrote :

i also have proposed enabled

Revision history for this message
dinamic (dinamic6661) wrote :
Revision history for this message
dinamic (dinamic6661) wrote :
Revision history for this message
dinamic (dinamic6661) wrote :
Revision history for this message
dinamic (dinamic6661) wrote :
Revision history for this message
dinamic (dinamic6661) wrote :

hm.. i think the bug is Qt? gtk mir apps seems to work fine.

the problem is with Qt/KDE apps and ubuntu apps. ubuntu terminal is black, the dash is black, in music app i can see the background but it doesn't have any content, same with the settings

Revision history for this message
dinamic (dinamic6661) wrote :
Revision history for this message
dinamic (dinamic6661) wrote :

segfault libQt5Gui.so.5.6.1
segfault libEGL.so.1.0.0

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

unity8.log is a little bit flooded and even unity8.log.1 isn't old enough to show us start-up. Can you please provide unity8.log.[2-9] from when the bug is occurring?

Revision history for this message
Larry Price (larryprice) wrote :

I've started experiencing the same issues on yakkety, even after reinstalling unity8-desktop-session. My machine is a 64-bit with integrated Intel graphics - unity8-dash.log attached.

Changed in unity8 (Ubuntu):
status: Incomplete → Confirmed
importance: Undecided → High
tags: added: unity8-desktop
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

And after updating now me too (Intel graphics).

unity8-dash.log:
[2016-09-09:10:15:04.738] QEGLPlatformContext: eglMakeCurrent failed: 3001
[2016-09-09:10:15:04.738] QEGLPlatformContext: eglMakeCurrent failed: 3001
[2016-09-09:10:15:04.754] QEGLPlatformContext: eglMakeCurrent failed: 3001
[2016-09-09:10:15:04.754] QEGLPlatformContext: eglMakeCurrent failed: 3001
[2016-09-09:10:15:04.770] QEGLPlatformContext: eglMakeCurrent failed: 3001
[2016-09-09:10:15:04.770] QEGLPlatformContext: eglMakeCurrent failed: 3001
[2016-09-09:10:15:04.786] QEGLPlatformContext: eglMakeCurrent failed: 3001
[2016-09-09:10:15:04.786] QEGLPlatformContext: eglMakeCurrent failed: 3001
[2016-09-09:10:15:04.802] QEGLPlatformContext: eglMakeCurrent failed: 3001
[2016-09-09:10:15:04.802] QEGLPlatformContext: eglMakeCurrent failed: 3001
[2016-09-09:10:15:04.819] QEGLPlatformContext: eglMakeCurrent failed: 3001

tags: added: black-screen
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Native Mir demos still render correctly. So the problem is specific to the Ubuntu/Qt toolkit side.

Changed in mir:
status: Incomplete → Invalid
Changed in mesa (Ubuntu):
status: Incomplete → Invalid
Changed in qtmir:
status: Incomplete → Confirmed
Changed in qtubuntu:
status: Incomplete → Confirmed
summary: - QEGLPlatformContext: eglMakeCurrent failed: 3001, nothing works, all
- apps, dash are just black windows
+ QEGLPlatformContext: eglMakeCurrent failed: 3001, nothing works, apps
+ don't render
Changed in qtmir:
status: Confirmed → Invalid
Changed in canonical-devices-system-image:
status: New → Confirmed
Changed in qtubuntu:
importance: Undecided → Critical
Changed in unity8 (Ubuntu):
importance: High → Critical
Revision history for this message
Daniel van Vugt (vanvugt) wrote : Re: QEGLPlatformContext: eglMakeCurrent failed: 3001, nothing works, apps don't render

Sorry for the noise. I don't know which project to target but it's not Mir, Mesa or Unity8...

Changed in qtubuntu (Ubuntu):
status: New → Confirmed
importance: Undecided → Critical
Changed in qtmir:
status: Invalid → Confirmed
importance: Undecided → Critical
Changed in qtmir (Ubuntu):
status: New → Confirmed
importance: Undecided → Critical
Changed in unity8 (Ubuntu):
status: Confirmed → Invalid
summary: - QEGLPlatformContext: eglMakeCurrent failed: 3001, nothing works, apps
- don't render
+ Qt/QML apps don't render any more (logs say "QEGLPlatformContext:
+ eglMakeCurrent failed: 3001")
Revision history for this message
Michał Sawicz (saviq) wrote : Re: Qt/QML apps don't render any more (logs say "QEGLPlatformContext: eglMakeCurrent failed: 3001")

@dinamic, can you please look at /var/log/apt/history.log and try to estimate which upgrade broke it?

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

The regression appears to have happened for me in this upgrade:

Start-Date: 2016-09-09 09:40:23
Commandline: apt full-upgrade
Requested-By: dan (1000)
Upgrade: ubuntu-settings:amd64 (16.10.2, 16.10.3), suru-icon-theme:amd64 (16.10+16.10.20160829.3-0ubuntu1, 16.10+16.10.20160908-0ubuntu1), libaudit-common:amd64 (1:2.6.5-1ubuntu1, 1:2.6.6-1ubuntu1), qtdeclarative5-qtmir-plugin:amd64 (0.4.8+16.10.20160831-0ubuntu1, 0.4.8+16.10.20160906-0ubuntu1), qtmir-desktop:amd64 (0.4.8+16.10.20160831-0ubuntu1, 0.4.8+16.10.20160906-0ubuntu1), docbook-xml:amd64 (4.5-7.3, 4.5-8), gnome-software:amd64 (3.20.1+git20160617.1.0440874.ubuntu-xenial-0ubuntu1, 3.20.1+git20160617.1.0440874.ubuntu-xenial-0ubuntu2), ubuntu-software:amd64 (3.20.1+git20160617.1.0440874.ubuntu-xenial-0ubuntu1, 3.20.1+git20160617.1.0440874.ubuntu-xenial-0ubuntu2), ubuntu-mobile-icons:amd64 (16.10+16.10.20160829.3-0ubuntu1, 16.10+16.10.20160908-0ubuntu1), libsodium18:amd64 (1.0.10-1, 1.0.11-1), light-themes:amd64 (16.10+16.10.20160829.3-0ubuntu1, 16.10+16.10.20160908-0ubuntu1), ubuntu-artwork:amd64 (1:16.10+16.10.20160829.3-0ubuntu1, 1:16.10+16.10.20160908-0ubuntu1), libaudit-dev:amd64 (1:2.6.5-1ubuntu1, 1:2.6.6-1ubuntu1), pciutils:amd64 (1:3.3.1-1.1ubuntu2, 1:3.3.1-1.1ubuntu3), mythes-en-us:amd64 (1:5.2.0-1, 1:5.2.1-1), mtools:amd64 (4.0.18-2, 4.0.18-2ubuntu1), libpci3:amd64 (1:3.3.1-1.1ubuntu2, 1:3.3.1-1.1ubuntu3), gnome-software-common:amd64 (3.20.1+git20160617.1.0440874.ubuntu-xenial-0ubuntu1, 3.20.1+git20160617.1.0440874.ubuntu-xenial-0ubuntu2), ubuntu-mono:amd64 (16.10+16.10.20160829.3-0ubuntu1, 16.10+16.10.20160908-0ubuntu1), libaudit1:amd64 (1:2.6.5-1ubuntu1, 1:2.6.6-1ubuntu1)
End-Date: 2016-09-09 09:40:50

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Although it could also have happened a day or two ago in a different upgrade. I might not have noticed.

Revision history for this message
Michał Sawicz (saviq) wrote :

The only relevant piece there seems to be qtmir, but looking at its changelog [1] there's no related changes there...

[1] https://launchpad.net/ubuntu/+source/qtmir/0.4.8+16.10.20160831-0ubuntu1

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Yeah it could have happened a day or two ago. Probably been a couple of days since I tested Unity8 apps.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

What we need is someone with a slightly out of date yakkety that doesn't have the bug. Then upgrade it, check the regression now occurs and work from that.

Revision history for this message
Daniel d'Andrada (dandrader) wrote :

This only happens in yakkety. The same qtmir, qtubuntu and unity8 runs fine in xenial. Lost a couple of hours on this issue yesterday and my "solution" was to reboot my test laptop into a xenial partition so I could unblock myself.

Revision history for this message
Daniel d'Andrada (dandrader) wrote :

Maybe the culprit is different Qt versions between xenial and yakkety?

Revision history for this message
Daniel d'Andrada (dandrader) wrote :

qtbase-opensource-src did get a new release on september 3rd. But xenial stable-phone-overlay and yakkety seem to be carrying the very same qt version, so scrap my theory from comment #30...

Revision history for this message
Larry Price (larryprice) wrote :

In my case, the Dash shows up as just a black screen with the Dash icon and "Scopes" and never finishes loading. When opening up System Settings, it sits on a white screen with just the titlebar. When opening up the web browser, I got a crash and a weird update notifier log (attached) in addition to this message in the regular application-legacy-webbrowser-app-log:

    Loading module: 'libubuntu_application_api_desktop_mirclient.so.3.0.0'
    could not open containers config file "/home/lrp/.local/share/libertine/ContainersConfig.json"
    [0912/145919:ERROR:gl_surface_egl.cc(253)] No suitable EGL configs found.

Revision history for this message
Larry Price (larryprice) wrote :

The System Settings log could actually contain some interesting information. It seems to imply that the launcher is out of memory.

Revision history for this message
Michał Sawicz (saviq) wrote :

@larryprice the black Scopes and blank Settings are splash screens, basically means the app never rendered.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

And the app never rendered because its call to eglMakeCurrent failed with error 3001 (EGL_NOT_INITIALIZED).

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Another prime candidate that possibly triggered this bug:
   https://launchpad.net/ubuntu/+source/mesa/12.0.2-1ubuntu1
Released on 7 September (which would have been 8 Sept here).

It could easily be that our Qt apps are (and always have been) requesting some EGL attributes that Mesa can not or should not provide. That could be a Mesa bug or a Qt bug that's been around for much longer and Mesa only just became pedantic enough to say no. Remember EGL clients from the 'mir-demos' package still render OK so this is something specific to Q* clients.

Changed in canonical-devices-system-image:
milestone: none → 13
importance: Undecided → Critical
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

CONFIRMED. Downgrading Mesa to 12.0.1 fixes the problem:
https://launchpad.net/ubuntu/+source/mesa/12.0.1-3ubuntu2/+build/10506751

So the regression was triggered by:
https://launchpad.net/ubuntu/+source/mesa/12.0.2-1ubuntu1

However that doesn't mean Mesa is buggy necessarily. Our Qt EGL setup code might be requesting something invalid and it only just became a fatal error. In that case our Qt code would need fixing rather than Mesa. Indeed non-Qt clients don't have the bug at all.

Changed in mesa (Ubuntu):
status: Invalid → Confirmed
importance: Undecided → Critical
Revision history for this message
Daniel van Vugt (vanvugt) wrote :
Download full text (6.2 KiB)

Enabling debugging I can't see anything EGL-related failing before the errors start in unity8-dash.log. Although rendering appears to fail:

[2016-09-13:12:45:18.825] ubuntumirclient: Created surface with geometry: QRect(
0,24 510x712) title: "Scopes" role: 1
[2016-09-13:12:45:18.825] ubuntumirclient.graphics: Requested format: QSurfaceFormat(version 2.0, options QFlags(), depthBufferSize 24, redBufferSize 8, greenBufferSize 8, blueBufferSize 8, alphaBufferSize -1, stencilBufferSize 8, samples -1, swapBehavior 2, swapInterval 1, profile 0)
Actual format: QSurfaceFormat(version 2.0, options QFlags(), depthBufferSize 24, redBufferSize 8, greenBufferSize 8, blueBufferSize 8, alphaBufferSize 8, stencilBufferSize 8, samples 0, swapBehavior 0, swapInterval 1, profile 0) with associated Mir pixel format: XRGB8888
[2016-09-13:12:45:18.825] ubuntumirclient: UbuntuWindow(window=0x55e51c635990, s
creen=0x55e51c53cd80, input=0x55e51c53cbe0, surf=0x55e51ca3eae0) with title 'Sco
pes', role: '1'
[2016-09-13:12:45:18.825] ubuntumirclient: setVisible (window=0x55e51c635990, vi
sible=true)
[2016-09-13:12:45:18.825] ubuntumirclient: updateSurfaceState (window=0x55e51c63
5990, surfaceState=restored)
[2016-09-13:12:45:18.826] file:///usr/share/unity8//Dash/Dash.qml:39: ReferenceE
rror: window is not defined
[2016-09-13:12:45:18.826] file:///usr/share/unity8//Dash/GenericScopeView.qml:64
4: TypeError: Cannot read property 'activeFiltersCount' of null
[2016-09-13:12:45:18.826] file:///usr/share/unity8//Dash/GenericScopeView.qml:64
3: TypeError: Cannot read property 'filters' of null
[2016-09-13:12:45:18.826] file:///usr/share/unity8//Dash/Dash.qml:265: ReferenceError: scopeStyle is not defined
[2016-09-13:12:45:18.826] ubuntumirclient.input: customEvent(type=mir_event_type_surface_output)
[2016-09-13:12:45:18.826] User agent string: "release=16.10&scopes-api=1.0.6+16.10.20160617-0ubuntu1&plugin=0.5.7+16.10.20160624.2-0ubuntu2&unity8=8.14+16.10.20160831.3-0ubuntu1"
[2016-09-13:12:45:18.827] qt.scenegraph.renderloop: exposureChanged() QQuickWindowQmlImpl(0x55e51c635990)
[2016-09-13:12:45:18.827] qt.scenegraph.renderloop: handleExposure() QQuickWindowQmlImpl(0x55e51c635990)
[2016-09-13:12:45:18.827] qt.scenegraph.renderloop: - adding window to list
[2016-09-13:12:45:18.827] qt.scenegraph.renderloop: - starting render thread
[2016-09-13:12:45:18.829] ubuntumirclient.graphics: EGL vendor: Mesa Project
[2016-09-13:12:45:18.829] ubuntumirclient.graphics: EGL version: 1.4 (DRI2)
[2016-09-13:12:45:18.829] ubuntumirclient.graphics: EGL extensions: EGL_EXT_buffer_age EGL_EXT_image_dma_buf_import EGL_KHR_create_context EGL_KHR_get_all_proc_addresses EGL_KHR_gl_renderbuffer_image EGL_KHR_gl_texture_2D_image EGL_KHR_gl_texture_cubemap_image EGL_KHR_image EGL_KHR_image_base EGL_KHR_image_pixmap EGL_KHR_reusable_sync EGL_KHR_surfaceless_context EGL_MESA_configless_context EGL_MESA_drm_image EGL_MESA_image_dma_buf_export
[2016-09-13:12:45:18.829] ubuntumirclient.graphics: EGL configuration attributes:
[2016-09-13:12:45:18.829] EGL_BUFFER_SIZE: 32
[2016-09-13:12:45:18.829] EGL_ALPHA_SIZE: 8
[2016-09-13:12:45:18.829] EGL_BLUE_SIZE: 8
[2016-09-13:12:45:18.829] ...

Read more...

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Maybe... Mesa only just started to care about mixing and matching GL with GLES in invalid ways. I know we have done it in the past and possibly still do. Maybe today is the day Mesa finally started checking the validity of our GL calls...?

Revision history for this message
Gerry Boland (gerboland) wrote :

Note it is only Unity8 which is mixing GL and GLES calls, clients are not doing that. Qt clients are only doing GL calls on desktop.

Nothing obvious comes to mind here.

It may be Qt's EGL configuration code is failing - code that QtUbuntu is using. Another consumer of that same code is the EGL backend for the XCB QPA plugin - the non-default - as usually the GLX backend is used.

Could someone with a problematic system log into Unity7, and for a simple qml file, run:
QT_XCB_GL_INTEGRATION=xcb_egl qmlscene ~/test.qml
and see does it fail?

Revision history for this message
Daniel d'Andrada (dandrader) wrote : Re: [Bug 1620934] Re: Qt/QML apps don't render any more (logs say "QEGLPlatformContext: eglMakeCurrent failed: 3001")

On 13/09/2016 08:49, Gerry Boland wrote:
> Could someone with a problematic system log into Unity7, and for a simple qml file, run:
> QT_XCB_GL_INTEGRATION=xcb_egl qmlscene ~/test.qml
> and see does it fail?

It works fine.

Revision history for this message
Timo Aaltonen (tjaalton) wrote : Re: Qt/QML apps don't render any more (logs say "QEGLPlatformContext: eglMakeCurrent failed: 3001")

Probably caused by

commit de695014eb6c819b050a4f7f2f952c4466047292
Author: Nicolas Boichat <email address hidden>
Date: Fri Jul 15 16:24:20 2016 +0800

    egl/dri2: dri2_make_current: Set EGL error if bindContext fails

Revision history for this message
Timo Aaltonen (tjaalton) wrote :

    Without this, if a configuration is, say, available only on GLES2/3, but
    not on GLES1, and is rejected by the dri module's bindContext call,
    eglMakeCurrent fails with error "EGL_SUCCESS".

    In this patch, we set error to EGL_BAD_MATCH, which is what CTS/dEQP
    dEQP-EGL.functional.surfaceless_context expect.

summary: - Qt/QML apps don't render any more (logs say "QEGLPlatformContext:
- eglMakeCurrent failed: 3001")
+ [regression] Starting in Mesa 12.0.2, Qt/QML apps don't render any more
+ (logs say "QEGLPlatformContext: eglMakeCurrent failed: 3001")
tags: added: regression
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

See also bug 1620994 which happened in the upgrade to 12.0.2

Revision history for this message
Timo Aaltonen (tjaalton) wrote :

so, will you fix mir soon or should I revert that mesa commit for now?

tags: added: egl-platform-mir
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

tjaalton: Yes please revert the Mesa commit if it solves the problem.

Either way, we don't yet know what/where to fix in Mir/Unity8/Qt*

Revision history for this message
Timo Aaltonen (tjaalton) wrote :

that wasn't the commit to revert, and Chris fixed the mir egl patch. I'll upload it in a bit

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package mesa - 12.0.3-1ubuntu1

---------------
mesa (12.0.3-1ubuntu1) yakkety; urgency=medium

  * Merge from Debian.

  [ Christopher James Halse Rogers ]
  * egl-platform-mir.patch: Updated for upstream changes to dri2_initialize
    in egl_dri2.c. (LP: #1620934, #1620994)

mesa (12.0.3-1) unstable; urgency=medium

  * New upstream release.
  * Enable vc4 on arm64.

 -- Timo Aaltonen <email address hidden> Fri, 16 Sep 2016 10:07:05 +0300

Changed in mesa (Ubuntu):
status: Confirmed → Fix Released
Changed in canonical-devices-system-image:
status: Confirmed → Fix Released
milestone: 13 → none
Changed in qtmir:
status: Confirmed → Invalid
Changed in qtubuntu:
status: Confirmed → Invalid
Changed in qtmir (Ubuntu):
status: Confirmed → Invalid
Changed in qtubuntu (Ubuntu):
status: Confirmed → Invalid
Michał Sawicz (saviq)
no longer affects: qtubuntu
Michał Sawicz (saviq)
no longer affects: qtmir
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.