unity-system-compositor crashed with src/platforms/android/server/gl_context.cpp(233): ... android::FramebufferGLContext::swap_buffers() ... std::exception::what: eglSwapBuffers failure: EGL_BAD_SURFACE (0x300d)

Bug #1654536 reported by Michał Sawicz
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Canonical System Image
Won't Fix
Critical
Unassigned
Mir
Won't Fix
Critical
Kevin DuBois
mir-android-platform
New
Undecided
Unassigned
mir (Ubuntu)
Won't Fix
Critical
Unassigned
unity-system-compositor (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

unity-system-compositor sometimes aborts on latest xenial/arm64 on frieza:

$ system-image-cli -i
current build number: 116
device name: frieza_arm64
channel: ubuntu-touch/staging/ubuntu
last update: 2017-01-06 09:43:26
version version: 116
version ubuntu: 20170106
version device: 20161014.0
version custom: 20170106

/var/log/lightdm/unity-system-compositor.log has:
ERROR: /build/mir-2omL3o/mir-0.25.0+16.04.20161203/src/platforms/android/server/gl_context.cpp(233): Throw in function virtual void mir::graphics::android::FramebufferGLContext::swap_buffers() const
Dynamic exception type: boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector<std::system_error> >
std::exception::what: eglSwapBuffers failure: EGL_BAD_SURFACE (0x300d)

ProblemType: Crash
DistroRelease: Ubuntu 16.04
Package: unity-system-compositor 0.8.0+16.04.20161206-0ubuntu1 [origin: LP-PPA-ci-train-ppa-service-stable-phone-overlay]
Uname: Linux 3.10.93+ aarch64
ApportVersion: 2.20.1-0ubuntu2.4
Architecture: arm64
Date: Fri Jan 6 10:20:54 2017
Disassembly: => 0x7fa41dd5e8: Cannot access memory at address 0x7fa41dd5e8
ExecutablePath: /usr/sbin/unity-system-compositor
ExecutableTimestamp: 1480992789
GraphicsCard:

ProcCmdline: unity-system-compositor --disable-overlays=false --spinner=/usr/bin/unity-system-compositor-spinner --file /run/mir_socket --from-dm-fd 11 --to-dm-fd 14 --vt 1
ProcCwd: /
ProcEnviron:

SegvAnalysis: Skipped: missing required field "Disassembly"
Signal: 11
SourcePackage: unity-system-compositor
StacktraceTop:
 ()
 std::__exception_ptr::exception_ptr::_M_release() (this=0x7fa5647b20 <_ZN12_GLOBAL__N_121termination_exceptionE.lto_priv.2774>) at ../../../../src/libstdc++-v3/libsupc++/eh_ptr.cc:121
 __cxa_finalize (d=0x7fa5646498) at cxa_finalize.c:56
 __do_global_dtors_aux () at /usr/lib/aarch64-linux-gnu/libmirserver.so.42
 _dl_fini () at dl-fini.c:235
UpgradeStatus: No upgrade log present (probably fresh install)
UserGroups:

version.libdrm: libdrm2 2.4.67-1ubuntu0.16.04.2
version.lightdm: lightdm 1.18.3-0ubuntu1
version.mesa: libegl1-mesa-dev N/A

Revision history for this message
Michał Sawicz (saviq) wrote :
information type: Private → Public
Revision history for this message
Apport retracing service (apport) wrote :

Stacktrace:
 #0 0x0000007fa41dd5e8 in ?? ()
 No symbol table info available.
 #1 0x0000007fa52061e0 in ?? ()
 No symbol table info available.
 Backtrace stopped: previous frame identical to this frame (corrupt stack?)
StacktraceTop:
 ?? ()
 ?? ()

Revision history for this message
Apport retracing service (apport) wrote : ThreadStacktrace.txt
Changed in mir (Ubuntu):
status: New → Invalid
Revision history for this message
Apport retracing service (apport) wrote : Crash report cannot be processed

Thank you for your report!

However, processing it in order to get sufficient information for the
developers failed (it does not generate a useful symbolic stack trace). This
might be caused by some outdated packages which were installed on your system
at the time of the report:

package libmirplatform14 does not exist, ignoring
libglapi-mesa version 11.2.0-1ubuntu2.1~overlay1 required, but 11.2.0-1ubuntu2.2 is available
package libandroid-properties1 does not exist, ignoring
libmircookie2 version 0.25.0+16.04.20161203-0ubuntu1 required, but 0.21.0+16.04.20160330-0ubuntu1 is available
unity-system-compositor version 0.8.0+16.04.20161206-0ubuntu1 required, but 0.4.3+16.04.20160323-0ubuntu1 is available
package libmircore1 does not exist, ignoring
libmirprotobuf3 version 0.25.0+16.04.20161203-0ubuntu1 required, but 0.21.0+16.04.20160330-0ubuntu1 is available
libgles2-mesa version 11.2.0-1ubuntu2.1~overlay1 required, but 11.2.0-1ubuntu2.2 is available
no debug symbol package found for xdg-user-dirs
libgbm1 version 11.2.0-1ubuntu2.1~overlay1 required, but 11.2.0-1ubuntu2.2 is available
libgl1-mesa-dri version 11.2.0-1ubuntu2.1~overlay1 required, but 11.2.0-1ubuntu2.2 is available
no debug symbol package found for debianutils
libmirclient9 version 0.25.0+16.04.20161203-0ubuntu1 required, but 0.21.0+16.04.20160330-0ubuntu1 is available
libegl1-mesa version 11.2.0-1ubuntu2.1~overlay1 required, but 11.2.0-1ubuntu2.2 is available
package libmircommon7 does not exist, ignoring
no debug symbol package found for perl-base
package libmirserver42 does not exist, ignoring
libmirclient9 version 0.25.0+16.04.20161203-0ubuntu1 required, but 0.21.0+16.04.20160330-0ubuntu1 is available
libmircookie2 version 0.25.0+16.04.20161203-0ubuntu1 required, but 0.21.0+16.04.20160330-0ubuntu1 is available
libmirprotobuf3 version 0.25.0+16.04.20161203-0ubuntu1 required, but 0.21.0+16.04.20160330-0ubuntu1 is available
unity-system-compositor version 0.8.0+16.04.20161206-0ubuntu1 required, but 0.4.3+16.04.20160323-0ubuntu1 is available

Please upgrade your system to the latest package versions. If you still
encounter the crash, please file a new report.

Thank you for your understanding, and sorry for the inconvenience!

tags: removed: need-arm64-retrace
Michał Sawicz (saviq)
Changed in canonical-devices-system-image:
milestone: none → x1
Changed in mir (Ubuntu):
status: Invalid → New
Changed in canonical-devices-system-image:
status: New → Confirmed
importance: Undecided → Critical
Revision history for this message
Michał Sawicz (saviq) wrote : Re: unity-system-compositor crashed EGL_BAD_SURFACE
Revision history for this message
Michał Sawicz (saviq) wrote :

<greyback> Saviq: also can you get the value of the "ro.build.product property" and see if it matches "Aquaris_M10_FHD" - mir implements quirks which depend on that
<Saviq> "frieza"
<greyback> Saviq: hmm that doesn't match what Mir expects
<Saviq> could be a clue
<greyback> could you add --fb-ion-heap=false to USC's command line?

That seems to have helped with the E/MALI errors from logcat, I can't see it crashing either.

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

Too little too soon, just got the same exception thrown.

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

This is what's shown in logcat when it crashes:

E/MALI ( 1365): get_target_buffer:944: winsysp_window_buffer_get failed 12299
E/MALI ( 1365): gles_state_set_error_internal:56: GLES ctx: 0x5572c08, error code:0x505
E/MALI ( 1365): get_target_buffer:944: winsysp_window_buffer_get failed 12299

Revision history for this message
Kevin DuBois (kdub) wrote :

I somewhat doubt that quirk would help, iirc, it was added after reports that it helped from the bringup (but by the time it got released it didn't seem to do anything in my local testing)

0x505 is GL_OUT_OF_MEMORY, perhaps a leak?

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

Thing is this only ever happens on boot, and u-s-c gets restarted and subsequently works fine, with `free` reporting 600MB memory free. The leak would have to enormous as this happens within seconds from the device booting.

summary: - unity-system-compositor crashed EGL_BAD_SURFACE
+ unity-system-compositor crashed with
+ src/platforms/android/server/gl_context.cpp(233): ...
+ android::FramebufferGLContext::swap_buffers() ... std::exception::what:
+ eglSwapBuffers failure: EGL_BAD_SURFACE (0x300d)
Changed in mir:
importance: Undecided → Critical
Changed in mir (Ubuntu):
importance: Undecided → Critical
tags: added: android
Changed in unity-system-compositor (Ubuntu):
status: New → Invalid
Changed in mir:
assignee: nobody → Kevin DuBois (kdub)
Revision history for this message
Kevin DuBois (kdub) wrote :

re the 600mb available, it could be some other resource than system memory that the driver cannot access, given the limited enums the gl driver can return.

Changed in mir:
status: New → In Progress
Revision history for this message
Kevin DuBois (kdub) wrote :

Is the frieza_arm64 channel in a sane state? (I remember it being usable about a month or so ago) I can't seem to even get to the dash. The mir demo stuff is seems to work though.

Changed in mir (Ubuntu):
status: New → Confirmed
Revision history for this message
Kevin DuBois (kdub) wrote :

Was able to see the error on startup in the bug in USC.

Confirmed that the quirk affecting fb bits don't affect operation, and that both the overlay path and gl-rendered path work with the demo servers and USC (after the system has come up fully).

This only seems to happen when the device is booting up (haven't seen this on 'service lightdm restart') Just a hunch that there's something in the system at large that hasn't finished powered up correctly, when USC tries to GL-draw a frame.

Revision history for this message
Kevin DuBois (kdub) wrote :

It could be that /etc/init/keep-display-on-during-boot.conf needs to be ported to the systemd services. Not quite sure I understand enough about the v+o to x+o (and upstart to systemd) to quickly diagnose if the startup power situation is correct at time of error during bootup.

Changed in mir:
milestone: none → 0.26.0
Changed in mir:
milestone: 0.26.0 → 1.0.0
Changed in mir:
milestone: 0.27.0 → 0.28.0
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

The Android platform was deleted from lp:mir at revision 4155.

Changed in mir:
status: In Progress → Won't Fix
Changed in canonical-devices-system-image:
status: Confirmed → Won't Fix
Changed in mir (Ubuntu):
status: Confirmed → Won't Fix
Changed in mir:
milestone: 0.28.0 → none
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.