Skip to content

eglCreateWindowSurface fails after updating to android 10 #178

@OptimisticPeach

Description

@OptimisticPeach

If I run the following code when running on android using cargo apk:

let window: GlutinWindow = WindowSettings::new(
                "rust app", (200.0, 200.0)
            )
            .fullscreen(true)
            .graphics_api(OpenGL::V2_1)
            .build()
            .unwrap();

Logcat shows the following errors:

BufferQueueProducer: [com.optimistic_peach.trees/android.app.NativeActivity#0] connect: already connected (cur=1 req=1)
libEGL  : eglCreateWindowSurface: native_window_api_connect (win=0x762d44c010) failed (0xffffffea) (already connected to another API?)
libEGL  : eglCreateWindowSurfaceTmpl:729 error 3003 (EGL_BAD_ALLOC)
RustAndroidGlueStdouterr: thread '<unnamed>' panicked at 'called `Result::unwrap()` on an `Err` value: OsError("eglCreateWindowSurface failed")', src/libcore/result.rs:1084:5
Full logcat output around this:
threaded_app: WindowFocusChanged: 0x76c432bd00 -- 1
Adreno  : QUALCOMM build                   : bc00834, I609ab310b2
Adreno  : Build Date                       : 04/11/19
Adreno  : OpenGL ES Shader Compiler Version: EV031.26.07.00
Adreno  : Local Branch                     :
Adreno  : Remote Branch                    :
Adreno  : Remote Branch                    :
Adreno  : Reconstruct Branch               :
Adreno  : Build Config                     : S L 8.0.6 AArch64
ActivityTaskManager: Displayed com.optimistic_peach.trees/android.app.NativeActivity: +107ms
Adreno  : PFP: 0x005ff110, ME: 0x005ff066
BufferQueueProducer: [com.optimistic_peach.trees/android.app.NativeActivity#0] connect: already connected (cur=1 req=1)
libEGL  : eglCreateWindowSurface: native_window_api_connect (win=0x762d44c010) failed (0xffffffea) (already connected to another API?)
libEGL  : eglCreateWindowSurfaceTmpl:729 error 3003 (EGL_BAD_ALLOC)
RustAndroidGlueStdouterr: thread '<unnamed>' panicked at 'called `Result::unwrap()` on an `Err` value: OsError("eglCreateWindowSurface failed")', src/libcore/result.rs:1084:5
RustAndroidGlueStdouterr: stack backtrace:
libc    : Fatal signal 6 (SIGABRT), code -1 (SI_QUEUE) in tid 6339 (tic_peach.trees), pid 6314 (tic_peach.trees)
android.hardware.power@1.3-service.pixel-libperfmgr: LAUNCH: 0
crash_dump64: obtaining output fd from tombstoned, type: kDebuggerdTombstone
/system/bin/tombstoned: received crash request for pid 6339
crash_dump64: performing dump of process 6314 (target tid = 6339)
DEBUG   : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
DEBUG   : Build fingerprint: 'google/walleye/walleye:10/QP1A.190711.019/5790879:user/release-keys'
DEBUG   : Revision: 'MP1'
DEBUG   : ABI: 'arm64'
DEBUG   : Timestamp: 2019-10-05 13:24:00-0400
DEBUG   : pid: 6314, tid: 6339, name: tic_peach.trees  >>> com.optimistic_peach.trees <<<
DEBUG   : uid: 10002
DEBUG   : signal 6 (SIGABRT), code -1 (SI_QUEUE), fault addr --------
DEBUG   :     x0  0000000000000000  x1  00000000000018c3  x2  0000000000000006  x3  00000075d8769ff0
DEBUG   :     x4  000000762ed91238  x5  000000762ed91238  x6  000000762ed91238  x7  000000762ed91000
DEBUG   :     x8  00000000000000f0  x9  00000076c399a4e0  x10 0000000000000000  x11 0000000000000001
DEBUG   :     x12 0000000000000000  x13 0000000000000000  x14 ffffffffffffffff  x15 0000000000000045
DEBUG   :     x16 00000076c3a668c0  x17 00000076c3a44060  x18 00000075d855a000  x19 00000000000000ac
DEBUG   :     x20 00000000000018aa  x21 00000000000000b2  x22 00000000000018c3  x23 00000000ffffffff
DEBUG   :     x24 00000075d876b260  x25 0000000000000005  x26 0000000000000001  x27 00000000000fd000
DEBUG   :     x28 0000007fff11f440  x29 00000075d876a0a0
DEBUG   :     sp  00000075d8769fd0  lr  00000076c39f8170  pc  00000076c39f81a0
DEBUG   :
DEBUG   : backtrace:
DEBUG   :       #00 pc 00000000000821a0  /apex/com.android.runtime/lib64/bionic/libc.so (abort+176) (BuildId: b58d049709674405423a8d8de1a37f56)
DEBUG   :       #01 pc 00000000000bc844  /data/app/com.optimistic_peach.trees-tKVaZx-PR2FlzJuAoEYdjQ==/lib/arm64/libtrees.so
DEBUG   :       #02 pc 00000000000bd08c  /data/app/com.optimistic_peach.trees-tKVaZx-PR2FlzJuAoEYdjQ==/lib/arm64/libtrees.so
DEBUG   :       #03 pc 00000000000a5c6c  /data/app/com.optimistic_peach.trees-tKVaZx-PR2FlzJuAoEYdjQ==/lib/arm64/libtrees.so
ActivityTaskManager:   Force finishing activity com.optimistic_peach.trees/android.app.NativeActivity
/system/bin/tombstoned: Tombstone written to: /data/tombstones/tombstone_03
DropBoxManagerService: add tag=data_app_native_crash isTagEnabled=true flags=0x2
threaded_app: Pause: 0x76c432bd00
threaded_app: activityState=13
BootReceiver: Copying /data/tombstones/tombstone_03 to DropBox (SYSTEM_TOMBSTONE)
ActivityManager: Showing crash dialog for package com.optimistic_peach.trees u0
DropBoxManagerService: add tag=SYSTEM_TOMBSTONE isTagEnabled=true flags=0x2
BroadcastQueue: Background execution not allowed: receiving Intent { act=android.intent.action.DROPBOX_ENTRY_ADDED flg=0x10 (has extras) } to com.google.android.gms/.stats.service.DropBoxEntryAddedReceiver
BroadcastQueue: Background execution not allowed: receiving Intent { act=android.intent.action.DROPBOX_ENTRY_ADDED flg=0x10 (has extras) } to com.google.android.gms/.chimera.GmsIntentOperationService$PersistentTrustedReceiver
threaded_app: WindowFocusChanged: 0x76c432bd00 -- 0

This happens on similar apps which try to initialize a window using glutin.

Note that this is happening on an android 10 device, where it used to work on android pie. (IE the update broke it 😞 )

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions