Hello!

We are developing an application for a customer on new hardware and
have an issue with crashes/blinking/freezing when running GL
applications.

What is worrying is that we recently discovered that this error is
reproducible not only when running our own program on the customer's
device, but also when running the APIDemos sample (that comes with
android-sdk-windows-1.5_r3) on a regular Android developer phone
(flashed with Android 1.5).

To reproduce this crash we ran the APIdemos application on the dev
phone, navigated to Graphics->OpenGL ES, and started the Kube
application (any app in that menu will do). Then, in a very rapid
fashion, press the Off button on the device, followed by two presses
on the menu button to turn the device back on (or two presses on the
off button followed by one on the menu button). Repeat this n times
(sometimes 100 tries, sometimes 10...) quickly and irregularly
(basically, press off/menu buttons randomly). What happens eventually
is that we either get a crash (see below), or we see that the kube
application is either frozen or "blinking" (switches between two
previous frame back and forth). If, at this point, we turn the device
off again, eglTerminate is called by the system which then causes the
crash.

Pressing lots of buttons quickly over and over to cause a crash might
seem like a bit of a pseudo issue but this is only a quick way of
reproducing an issue that happens anyway from time to time when
running a GL app (e.g. sometimes when leaving a GL app causing the
screen to turn off automatically and later pressing the menu button to
turn it on again, this can (though rarely) happen.)

The crash output typically looks like this:

D/EGL     (13060): CONTEXT_LOST: Releasing GPU upon request from
SurfaceFlinger.
D/EGL.oem (13060): SMI  region at virtual=0x458a8000, physical=0x0,
size=7340032 offset=0
D/EGL.oem (13060): EBI1 region at virtual=0x45fa8000,
physical=0x16500000, size=8388608 offset=1228800
D/EGL.oem (13060): REGS region at virtual=0x457a8000,
physical=0xa0000000, size=1048576, offset=0
D/WindowManager(   60): I'm tired mEndcallBehavior=0x2
D/GLLogger(13060): 0: eglInitialize() failed (EGL_CONTEXT_LOST)
I/ARMAssembler(13060): generated
scanline__00000097:03010104_00000000_00000000 [ 12 ipp] (43 ins) at
[0x2cc3f0:0x2cc49c] in 2380374 ns
D/KeyguardViewMediator(   60): wakeWhenReadyLocked(6)
D/KeyguardViewMediator(   60): handleWakeWhenReady(6)
D/KeyguardViewMediator(   60): pokeWakelock(5000)
I/DEBUG   ( 4078): *** *** *** *** *** *** *** *** *** *** *** *** ***
*** *** *
**
I/DEBUG   ( 4078): Build fingerprint: 'android-devphone1/
dream_devphone/dream/tr
out:1.5/CRB21/147201:userdebug/adp,test-keys'
I/DEBUG   ( 4078): pid: 13060, tid: 13098  >>>com.example.android.apis
<<<
I/DEBUG   ( 4078): signal 11 (SIGSEGV), fault addr 00000150
I/DEBUG   ( 4078):  r0 00000000  r1 4570fd38  r2 00000001  r3 00000000
I/DEBUG   ( 4078):  r4 002c7e70  r5 002c7e70  r6 ac708c74  r7 ac708ad0
I/DEBUG   ( 4078):  r8 4570fda0  r9 41046f60  10 41046f4c  fp 00000001
I/DEBUG   ( 4078):  ip ac708bcc  sp 4570fd38  lr 80442a2c  pc
80416790  cpsr 60000010
I/DEBUG   ( 4078):          #00  pc 00016790  /system/lib/libhgl.so
I/DEBUG   ( 4078):          #01  lr 80442a2c  /system/lib/libhgl.so
I/DEBUG   ( 4078): stack:
I/DEBUG   ( 4078):     4570fcf8  002cc168  [heap]
I/DEBUG   ( 4078):     4570fcfc  afe0e940  /system/lib/libc.so
I/DEBUG   ( 4078):     4570fd00  002c8338  [heap]
I/DEBUG   ( 4078):     4570fd04  afe0e940  /system/lib/libc.so
I/DEBUG   ( 4078):     4570fd08  00002bb0
...
D/SurfaceFlinger(   60): Screen about to return, flinger = 0x1841c8
I/ActivityManager(   60): Process com.example.android.apis (pid 13060)
has died.
I/WindowManager(   60): WIN DEATH: Window{4381ba80 SurfaceView
paused=false}


The faulty address is always the same (00000150). It seems to be
related to EGL_CONTEXT_LOST and eglInitialize failing.

We have tried waiting for the context to return (surfaceCreated), but
it never happens at this point. Trying to call eglInitialize
repeatedly fails indefinitely.


We do not know how to proceed with this problem at this point, and
would be very thankful for some help or input. Does loss of context
sometimes have to be treated in some manner we are not aware of? Is it
possible that the APIdemos sample has omitted to take care of this
special case as well?


Note: Our own code, as well as the APIdemos 1.1 code, calls
eglInitialize and eglTerminate explicitly. In ApiDemos for 1.5, this
seems to have been overtaken by the GLSurfaceView class. However, the
crash log output looks exactly the same when running ApiDemos for 1.5,
even the complaints about eglInitialize failing is the same, so I am
assuming the above-mentioned methods are called implicitly.


------------------------------------------------------------------------------------
Mikael Sollenborn @ The Astonishing Tribe

--~--~---------~--~----~------------~-------~--~----~
unsubscribe: [email protected]
website: http://groups.google.com/group/android-porting
-~----------~----~----~----~------~----~------~--~---

Reply via email to