Android OpenGL Surface 在设备方向改变时崩溃

标签 android opengl-es android-ndk

我的 Android 版 OpenGL 应用程序出现问题。我有一个 GLSurfaceView,它依次调用一些使用 OpenGL 绘制的 native NDK 代码。相同的代码在 iOS 上运行良好,但在 Android 上,当我旋转设备时,应用程序经常会崩溃(有时不会)。

崩溃时的日志如下:

04-30 14:30:20.365: I/visualizer_native(4326): Drawing
04-30 14:30:20.365: I/visualizer_native(4326): Starting native draw
04-30 14:30:20.365: I/visualizer_native(4326): Native draw done
04-30 14:30:20.365: D/Visualizer(4326): Draw done
04-30 14:30:20.365: D/Activity(4326): Pausing view
04-30 14:30:21.416: E/Fence(159): SurfaceTexture::doGLFenceWaitLocked: fence 55 didn't signal in 1000 ms
04-30 14:30:22.267: W/WindowManager(515): Window freeze timeout expired.
04-30 14:30:22.267: W/WindowManager(515): Force clearing orientation change: Window{42b0e4d0 u0 NavigationBar}
04-30 14:30:22.267: W/WindowManager(515): Force clearing orientation change: Window{4296dec8 u0 StatusBar}
04-30 14:30:22.267: W/WindowManager(515): Force clearing orientation change: Window{42d81ec8 u0 com.example.discovervisualizer/com.example.discovervisualizer.MainActivity}
04-30 14:30:22.267: W/WindowManager(515): Force clearing orientation change: Window{42d823b0 u0 SurfaceView}
04-30 14:30:22.267: W/WindowManager(515): Force clearing orientation change: Window{42f36b58 u0 com.android.systemui.ImageWallpaper}
04-30 14:30:24.759: I/VisualizerView(4326): Destroying OpenGL ES 2.0 context
04-30 14:30:24.769: W/Adreno200-GSL(4326): <gsl_ldd_control:226>: ioctl code 0xc0140910 (IOCTL_KGSL_RINGBUFFER_ISSUEIBCMDS) failed: errno 35 Resource deadlock would occur
04-30 14:30:25.360: W/WindowManager(515): App freeze timeout expired.
04-30 14:30:25.360: W/WindowManager(515): Force clearing freeze: AppWindowToken{431e4fb8 token=Token{4263d968 ActivityRecord{426dda50 u0 com.example.discovervisualizer/.MainActivity}}}
04-30 14:30:29.024: W/Adreno200-GSL(159): <gsl_ldd_control:226>: ioctl code 0xc0140910 (IOCTL_KGSL_RINGBUFFER_ISSUEIBCMDS) failed: errno 35 Resource deadlock would occur
04-30 14:30:29.024: W/Adreno200-EGL(159): <eglSwapBuffers:3498>: EGL_CONTEXT_LOST
04-30 14:30:29.024: A/SurfaceFlinger(159): eglSwapBuffers(0x1, 0x41d02c58) failed with 0x0000300e
04-30 14:30:29.024: A/libc(159): Fatal signal 11 (SIGSEGV) at 0xdeadbaad (code=1), thread 263 (SurfaceFlinger)
04-30 14:30:29.044: D/Activity(4326): Creating view
04-30 14:30:29.064: D/Activity(4326): Resuming view

04-30 14:30:29.124: I/DEBUG(157): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
04-30 14:30:29.124: I/DEBUG(157): Build fingerprint: 'google/occam/mako:4.2.2/JDQ39/573038:user/release-keys'
04-30 14:30:29.124: I/DEBUG(157): Revision: '10'
04-30 14:30:29.124: I/DEBUG(157): pid: 159, tid: 263, name: SurfaceFlinger  >>> /system/bin/surfaceflinger <<<
04-30 14:30:29.124: I/DEBUG(157): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr deadbaad
04-30 14:30:29.154: I/DEBUG(157):     r0 00000027  r1 deadbaad  r2 40224258  r3 00000000
04-30 14:30:29.154: I/DEBUG(157):     r4 00000000  r5 406837bc  r6 00000000  r7 00000000
04-30 14:30:29.154: I/DEBUG(157):     r8 41e06c20  r9 00000000  sl 40ea455c  fp 00000008
04-30 14:30:29.154: I/DEBUG(157):     ip 4011dfa8  sp 406837b8  lr 401f70d9  pc 401f3772  cpsr 60000030
04-30 14:30:29.154: I/DEBUG(157):     d0  2068746977206433  d1  0000000000000030
04-30 14:30:29.154: I/DEBUG(157):     d2  0000000000000030  d3  0000000000000065
04-30 14:30:29.154: I/DEBUG(157):     d4  0000000000000000  d5  0000000000000000
04-30 14:30:29.154: I/DEBUG(157):     d6  0000000000000000  d7  0000000000000000
04-30 14:30:29.154: I/DEBUG(157):     d8  0000000000000000  d9  0000000000000000
04-30 14:30:29.154: I/DEBUG(157):     d10 0000000000000000  d11 0000000000000000
04-30 14:30:29.154: I/DEBUG(157):     d12 0000000000000000  d13 0000000000000000
04-30 14:30:29.154: I/DEBUG(157):     d14 0000000000000000  d15 0000000000000000
04-30 14:30:29.154: I/DEBUG(157):     d16 0000000000000001  d17 0000000000000000
04-30 14:30:29.154: I/DEBUG(157):     d18 0000000000000000  d19 4314807e75b9c20c
04-30 14:30:29.154: I/DEBUG(157):     d20 3fe0000000009470  d21 0000000000000000
04-30 14:30:29.154: I/DEBUG(157):     d22 0000000000000000  d23 0000000000000000
04-30 14:30:29.154: I/DEBUG(157):     d24 0000000000000000  d25 0000000000000000
04-30 14:30:29.154: I/DEBUG(157):     d26 0000000000000000  d27 0000000000000000
04-30 14:30:29.154: I/DEBUG(157):     d28 0000000000000000  d29 0000000000000000
04-30 14:30:29.154: I/DEBUG(157):     d30 0000000000000000  d31 0000000000000000
04-30 14:30:29.154: I/DEBUG(157):     scr 60000012
04-30 14:30:29.154: I/DEBUG(157): backtrace:
04-30 14:30:29.154: I/DEBUG(157):     #00  pc 0001a772  /system/lib/libc.so
04-30 14:30:29.154: I/DEBUG(157):     #01  pc 00018070  /system/lib/libc.so (abort+4)
04-30 14:30:29.154: I/DEBUG(157):     #02  pc 00001425  /system/lib/liblog.so (__android_log_assert+88)
04-30 14:30:29.154: I/DEBUG(157):     #03  pc 0001d4f3  /system/lib/libsurfaceflinger.so (android::DisplayDevice::swapBuffers(android::HWComposer&) const+82)
04-30 14:30:29.154: I/DEBUG(157):     #04  pc 00025471  /system/lib/libsurfaceflinger.so (android::SurfaceFlinger::doDisplayComposition(android::sp<android::DisplayDevice const> const&, android::Region const&)+144)
04-30 14:30:29.154: I/DEBUG(157):     #05  pc 00028405  /system/lib/libsurfaceflinger.so (android::SurfaceFlinger::doComposition()+96)
04-30 14:30:29.154: I/DEBUG(157):     #06  pc 00028671  /system/lib/libsurfaceflinger.so (android::SurfaceFlinger::handleMessageRefresh()+52)
04-30 14:30:29.154: I/DEBUG(157):     #07  pc 000291ff  /system/lib/libsurfaceflinger.so (android::SurfaceFlinger::onMessageReceived(int)+58)
04-30 14:30:29.154: I/DEBUG(157):     #08  pc 00014c53  /system/lib/libutils.so (android::Looper::pollInner(int)+426)
04-30 14:30:29.154: I/DEBUG(157):     #09  pc 00014d71  /system/lib/libutils.so (android::Looper::pollOnce(int, int*, int*, void**)+104)
04-30 14:30:29.154: I/DEBUG(157):     #10  pc 00023d7d  /system/lib/libsurfaceflinger.so (android::MessageQueue::waitMessage()+40)
04-30 14:30:29.154: I/DEBUG(157):     #11  pc 00024369  /system/lib/libsurfaceflinger.so (android::SurfaceFlinger::threadLoop()+6)
04-30 14:30:29.154: I/DEBUG(157):     #12  pc 00011267  /system/lib/libutils.so (android::Thread::_threadLoop(void*)+114)
04-30 14:30:29.154: I/DEBUG(157):     #13  pc 00010dcd  /system/lib/libutils.so
04-30 14:30:29.154: I/DEBUG(157):     #14  pc 0000e3d8  /system/lib/libc.so (__thread_entry+72)
04-30 14:30:29.154: I/DEBUG(157):     #15  pc 0000dac4  /system/lib/libc.so (pthread_create+160)
04-30 14:30:29.154: I/DEBUG(157): stack:
04-30 14:30:29.154: I/DEBUG(157):          40683778  4194575c  
04-30 14:30:29.154: I/DEBUG(157):          4068377c  00000000  
04-30 14:30:29.154: I/DEBUG(157):          40683780  00000000  
04-30 14:30:29.154: I/DEBUG(157):          40683784  40e3ae48  
04-30 14:30:29.154: I/DEBUG(157):          40683788  00004000  
04-30 14:30:29.154: I/DEBUG(157):          4068378c  40683822  [stack:263]
04-30 14:30:29.154: I/DEBUG(157):          40683790  40221254  /system/lib/libc.so
04-30 14:30:29.154: I/DEBUG(157):          40683794  402211b4  /system/lib/libc.so
04-30 14:30:29.154: I/DEBUG(157):          40683798  00000000  
04-30 14:30:29.154: I/DEBUG(157):          4068379c  401f70d9  /system/lib/libc.so (_fwalk+32)
04-30 14:30:29.154: I/DEBUG(157):          406837a0  00000001  
04-30 14:30:29.154: I/DEBUG(157):          406837a4  406837bc  [stack:263]
04-30 14:30:29.154: I/DEBUG(157):          406837a8  00000000  
04-30 14:30:29.154: I/DEBUG(157):          406837ac  00000000  
04-30 14:30:29.154: I/DEBUG(157):          406837b0  df0027ad  
04-30 14:30:29.154: I/DEBUG(157):          406837b4  00000000  
04-30 14:30:29.154: I/DEBUG(157):     #00  406837b8  00000000  
04-30 14:30:29.154: I/DEBUG(157):          406837bc  fffffbdf  
04-30 14:30:29.154: I/DEBUG(157):          406837c0  406837bc  [stack:263]
04-30 14:30:29.154: I/DEBUG(157):          406837c4  00000001  
04-30 14:30:29.154: I/DEBUG(157):          406837c8  402e4d78  /system/lib/libsurfaceflinger.so
04-30 14:30:29.154: I/DEBUG(157):          406837cc  0000000f  
04-30 14:30:29.154: I/DEBUG(157):          406837d0  406837ec  [stack:263]
04-30 14:30:29.154: I/DEBUG(157):          406837d4  402e4d78  /system/lib/libsurfaceflinger.so
04-30 14:30:29.154: I/DEBUG(157):          406837d8  41d02c58  
04-30 14:30:29.164: I/DEBUG(157):          406837dc  401f1074  /system/lib/libc.so (__pthread_clone)
04-30 14:30:29.164: I/DEBUG(157):     #01  406837e0  4011b089  /system/lib/liblog.so
04-30 14:30:29.164: I/DEBUG(157):          406837e4  4011b429  /system/lib/liblog.so (__android_log_assert+92)
04-30 14:30:29.164: I/DEBUG(157):     #02  406837e8  40683bfc  [stack:263]
04-30 14:30:29.164: I/DEBUG(157):          406837ec  536c6765  
04-30 14:30:29.164: I/DEBUG(157):          406837f0  42706177  anon_inode:dmabuf
04-30 14:30:29.164: I/DEBUG(157):          406837f4  65666675  
04-30 14:30:29.164: I/DEBUG(157):          406837f8  30287372  
04-30 14:30:29.164: I/DEBUG(157):          406837fc  202c3178  
04-30 14:30:29.164: I/DEBUG(157):          40683800  31347830  
04-30 14:30:29.164: I/DEBUG(157):          40683804  63323064  
04-30 14:30:29.164: I/DEBUG(157):          40683808  20293835  
04-30 14:30:29.164: I/DEBUG(157):          4068380c  6c696166  
04-30 14:30:29.164: I/DEBUG(157):          40683810  77206465  
04-30 14:30:29.164: I/DEBUG(157):          40683814  20687469  
04-30 14:30:29.164: I/DEBUG(157):          40683818  30307830  
04-30 14:30:29.164: I/DEBUG(157):          4068381c  30333030  
04-30 14:30:29.164: I/DEBUG(157):          40683820  40006530  /dev/__properties__ (deleted)
04-30 14:30:29.164: I/DEBUG(157):          40683824  406e2f4f  /system/lib/egl/libGLESv2_adreno200.so (oxili_cmdbuffer_context_preamble+388)
04-30 14:30:29.164: I/DEBUG(157):          ........  ........
04-30 14:30:29.174: I/DEBUG(157): memory near r2:
04-30 14:30:29.174: I/DEBUG(157):     40224238 00000000 00000000 00000000 00000000  
04-30 14:30:29.174: I/DEBUG(157):     40224248 00000000 00000000 00000000 00000000  
04-30 14:30:29.174: I/DEBUG(157):     40224258 00000001 00000000 00000000 00000000  
04-30 14:30:29.174: I/DEBUG(157):     40224268 00000000 00000000 00000000 00000000  
04-30 14:30:29.174: I/DEBUG(157):     40224278 00000000 00000000 00000000 00000000  
04-30 14:30:29.174: I/DEBUG(157):     40224288 00000000 00000000 00000000 00000000  
04-30 14:30:29.174: I/DEBUG(157):     40224298 00000000 00000000 00352dd7 00000000  
04-30 14:30:29.174: I/DEBUG(157):     402242a8 00000000 00000000 00000000 00000000  
04-30 14:30:29.174: I/DEBUG(157):     402242b8 00000000 00000000 00000000 00000000  
04-30 14:30:29.174: I/DEBUG(157):     402242c8 00000000 00000000 00000000 00000000  
04-30 14:30:29.174: I/DEBUG(157):     402242d8 00000000 00000000 00000000 00000000  
04-30 14:30:29.174: I/DEBUG(157):     402242e8 00000000 00000000 00000000 00000000  
04-30 14:30:29.174: I/DEBUG(157):     402242f8 00000000 00000000 00000000 00004000  
04-30 14:30:29.174: I/DEBUG(157):     40224308 00000000 00000000 00000000 00004000  
04-30 14:30:29.174: I/DEBUG(157):     40224318 00000000 00000000 00000000 00004000  
04-30 14:30:29.174: I/DEBUG(157):     40224328 00000000 00000000 00000000 00004000  
04-30 14:30:29.174: I/DEBUG(157): memory near r5:
04-30 14:30:29.174: I/DEBUG(157):     4068379c 401f70d9 00000001 406837bc 00000000  
04-30 14:30:29.174: I/DEBUG(157):     406837ac 00000000 df0027ad 00000000 00000000  
04-30 14:30:29.174: I/DEBUG(157):     406837bc fffffbdf 406837bc 00000001 402e4d78  
04-30 14:30:29.174: I/DEBUG(157):     406837cc 0000000f 406837ec 402e4d78 41d02c58  
04-30 14:30:29.174: I/DEBUG(157):     406837dc 401f1074 4011b089 4011b429 40683bfc  
04-30 14:30:29.174: I/DEBUG(157):     406837ec 536c6765 42706177 65666675 30287372  
04-30 14:30:29.174: I/DEBUG(157):     406837fc 202c3178 31347830 63323064 20293835  
04-30 14:30:29.174: I/DEBUG(157):     4068380c 6c696166 77206465 20687469 30307830  
04-30 14:30:29.174: I/DEBUG(157):     4068381c 30333030 40006530 406e2f4f 406e2dcb  
04-30 14:30:29.174: I/DEBUG(157):     4068382c 40e3ae48 40185008 41944008 000000a0  
04-30 14:30:29.174: I/DEBUG(157):     4068383c 40334fb8 00000001 0000001c 40721eac  
04-30 14:30:29.174: I/DEBUG(157):     4068384c 42f21c4b c0140910 00000000 00000000  
04-30 14:30:29.174: I/DEBUG(157):     4068385c 00000000 00000000 00000208 4068390c  
04-30 14:30:29.174: I/DEBUG(157):     4068386c 00000daa 00000000 4017536c 40174778  
04-30 14:30:29.174: I/DEBUG(157):     4068387c 00000001 40ea5ea0 401fa2e7 000031e0  
04-30 14:30:29.174: I/DEBUG(157):     4068388c 00000000 00000000 00003efe 00004000  
04-30 14:30:29.174: I/DEBUG(157): memory near r8:
04-30 14:30:29.174: I/DEBUG(157):     41e06c00 00000000 0000004b 00000001 00000030  
04-30 14:30:29.174: I/DEBUG(157):     41e06c10 00000000 00000000 41c43fc0 41d02960  
04-30 14:30:29.174: I/DEBUG(157):     41e06c20 41e06748 00000000 00000000 00000000  
04-30 14:30:29.174: I/DEBUG(157):     41e06c30 00000000 00000000 00000000 00000000  
04-30 14:30:29.174: I/DEBUG(157):     41e06c40 00000000 00000000 00000000 0000001b  
04-30 14:30:29.174: I/DEBUG(157):     41e06c50 4010fbac 00000000 00000000 4010fc0c  
04-30 14:30:29.174: I/DEBUG(157):     41e06c60 41e06c68 0000001b 00000001 00000001  
04-30 14:30:29.174: I/DEBUG(157):     41e06c70 41e06c5c 00000000 00000000 00000093  
04-30 14:30:29.174: I/DEBUG(157):     41e06c80 00000021 41e06d14 00000000 00000000  
04-30 14:30:29.174: I/DEBUG(157):     41e06c90 00000000 00000000 00000000 00000000  
04-30 14:30:29.174: I/DEBUG(157):     41e06ca0 00000000 00000000 00000000 00000000  
04-30 14:30:29.174: I/DEBUG(157):     41e06cb0 00000000 00000000 00000000 00000000  
04-30 14:30:29.174: I/DEBUG(157):     41e06cc0 00000000 00000000 00000000 00000000  
04-30 14:30:29.174: I/DEBUG(157):     41e06cd0 00000000 00000000 00000000 00000000  
04-30 14:30:29.174: I/DEBUG(157):     41e06ce0 00000000 00000000 00000000 00000000  
04-30 14:30:29.174: I/DEBUG(157):     41e06cf0 00000000 00000000 00000000 00000000  
04-30 14:30:29.174: I/DEBUG(157): memory near sl:
04-30 14:30:29.174: I/DEBUG(157):     40ea453c 00000000 00000000 00000073 4027ebd8  
04-30 14:30:29.174: I/DEBUG(157):     40ea454c 40ea45b8 00000001 00000008 0000000a  
04-30 14:30:29.174: I/DEBUG(157):     40ea455c 00000000 4027ea18 40e8fc30 00000001  
04-30 14:30:29.174: I/DEBUG(157):     40ea456c 00000000 00000010 00000001 0000000b  
04-30 14:30:29.174: I/DEBUG(157):     40ea457c 4027ea60 4009b080 00000001 00000000  
04-30 14:30:29.174: I/DEBUG(157):     40ea458c 00000014 4027ead0 41d33008 00000000  
04-30 14:30:29.174: I/DEBUG(157):     40ea459c 00000000 00000014 00000000 ffffffff  
04-30 14:30:29.174: I/DEBUG(157):     40ea45ac 7fffffff 00000000 0000001b 00000001  
04-30 14:30:29.174: I/DEBUG(157):     40ea45bc 00000001 40ea4548 00000000 00000000  
04-30 14:30:29.174: I/DEBUG(157):     40ea45cc 0000001b 402eabe4 40ea44dc 00000000  
04-30 14:30:29.174: I/DEBUG(157):     40ea45dc 402eac0c 40ea45e8 0000001b 00000002  
04-30 14:30:29.174: I/DEBUG(157):     40ea45ec 00000002 40ea45dc 00000000 00000000  
04-30 14:30:29.174: I/DEBUG(157):     40ea45fc 00000013 40ea5688 40168f84 fffffff8  
04-30 14:30:29.174: I/DEBUG(157):     40ea460c 00000013 00000006 40ea4620 66727553  
04-30 14:30:29.174: I/DEBUG(157):     40ea461c 00000013 00000000 40ea4670 40ea4680  
04-30 14:30:29.174: I/DEBUG(157):     40ea462c 00000043 400dc3dc 40ea4ed8 00000001  
04-30 14:30:29.174: I/DEBUG(157): memory near ip:
04-30 14:30:29.174: I/DEBUG(157):     4011df88 401f0558 401f19a4 40211bb3 401f2560  
04-30 14:30:29.174: I/DEBUG(157):     4011df98 401fa29d 401eb771 401f7a7d 401f18ac  
04-30 14:30:29.174: I/DEBUG(157):     4011dfa8 401f106c 401f1600 401f6635 401e5f1d  
04-30 14:30:29.174: I/DEBUG(157):     4011dfb8 401e5f09 401fe041 401fe061 401fe1c7  
04-30 14:30:29.174: I/DEBUG(157):     4011dfc8 401f66f5 40200dd1 40201bc1 40211c9c  
04-30 14:30:29.174: I/DEBUG(157):     4011dfd8 401e5ef5 401fe021 401fe0f9 401efd88  
04-30 14:30:29.174: I/DEBUG(157):     4011dfe8 401efec4 401f1ca9 401efe44 401f4d53  
04-30 14:30:29.174: I/DEBUG(157):     4011dff8 401fd629 401fad77 4011e000 00000004  
04-30 14:30:29.174: I/DEBUG(157):     4011e008 00000005 00000006 00000007 4011b089  
04-30 14:30:29.174: I/DEBUG(157):     4011e018 00000000 00000000 00000000 00000000  
04-30 14:30:29.174: I/DEBUG(157):     4011e028 00000000 00000000 00000000 00000000  
04-30 14:30:29.174: I/DEBUG(157):     4011e038 00000000 00000000 00000000 00000000  
04-30 14:30:29.174: I/DEBUG(157):     4011e048 00000000 00000000 00000000 00000000  
04-30 14:30:29.174: I/DEBUG(157):     4011e058 00000000 00000000 00000000 00000000  
04-30 14:30:29.174: I/DEBUG(157):     4011e068 00000000 00000000 00000000 00000000  
04-30 14:30:29.174: I/DEBUG(157):     4011e078 00000000 00000000 00000000 00000000  
04-30 14:30:29.174: I/DEBUG(157): memory near sp:
04-30 14:30:29.184: I/DEBUG(157):     40683798 00000000 401f70d9 00000001 406837bc  
04-30 14:30:29.184: I/DEBUG(157):     406837a8 00000000 00000000 df0027ad 00000000  
04-30 14:30:29.184: I/DEBUG(157):     406837b8 00000000 fffffbdf 406837bc 00000001  
04-30 14:30:29.184: I/DEBUG(157):     406837c8 402e4d78 0000000f 406837ec 402e4d78  
04-30 14:30:29.184: I/DEBUG(157):     406837d8 41d02c58 401f1074 4011b089 4011b429  
04-30 14:30:29.184: I/DEBUG(157):     406837e8 40683bfc 536c6765 42706177 65666675  
04-30 14:30:29.184: I/DEBUG(157):     406837f8 30287372 202c3178 31347830 63323064  
04-30 14:30:29.184: I/DEBUG(157):     40683808 20293835 6c696166 77206465 20687469  
04-30 14:30:29.184: I/DEBUG(157):     40683818 30307830 30333030 40006530 406e2f4f  
04-30 14:30:29.184: I/DEBUG(157):     40683828 406e2dcb 40e3ae48 40185008 41944008  
04-30 14:30:29.184: I/DEBUG(157):     40683838 000000a0 40334fb8 00000001 0000001c  
04-30 14:30:29.184: I/DEBUG(157):     40683848 40721eac 42f21c4b c0140910 00000000  
04-30 14:30:29.184: I/DEBUG(157):     40683858 00000000 00000000 00000000 00000208  
04-30 14:30:29.184: I/DEBUG(157):     40683868 4068390c 00000daa 00000000 4017536c  
04-30 14:30:29.184: I/DEBUG(157):     40683878 40174778 00000001 40ea5ea0 401fa2e7  
04-30 14:30:29.184: I/DEBUG(157):     40683888 000031e0 00000000 00000000 00003efe  
04-30 14:30:29.184: I/DEBUG(157): code around pc:
04-30 14:30:29.184: I/DEBUG(157):     401f3750 e000b164 6823461c d1fb2b00 68e3e026  
04-30 14:30:29.184: I/DEBUG(157):     401f3760 4a17b123 447a2401 47986014 20274911  
04-30 14:30:29.184: I/DEBUG(157):     401f3770 70082400 eb86f7fc f7fd2106 a902ecea  
04-30 14:30:29.184: I/DEBUG(157):     401f3780 f04f2006 460a5380 94029304 f7fd9403  
04-30 14:30:29.184: I/DEBUG(157):     401f3790 4629e8d0 20024622 e8d8f7fd eb72f7fc  
04-30 14:30:29.184: I/DEBUG(157):     401f37a0 f7fd2106 2001ecd6 e892f7fc 2a006962  
04-30 14:30:29.184: I/DEBUG(157):     401f37b0 e7d4d1dc deadbaad 0002d826 00030b0a  
04-30 14:30:29.184: I/DEBUG(157):     401f37c0 00030aee 2400b510 aa04b088 46699002  
04-30 14:30:29.184: I/DEBUG(157):     401f37d0 94014620 94039400 e830f7fd bfb842a0  
04-30 14:30:29.184: I/DEBUG(157):     401f37e0 db054620 b1139b07 1c489906 98069006  
04-30 14:30:29.184: I/DEBUG(157):     401f37f0 bd10b008 4604b510 e9c6f7fc d10542a0  
04-30 14:30:29.184: I/DEBUG(157):     401f3800 447b4b04 6018681b bd102000 30fff04f  
04-30 14:30:29.184: I/DEBUG(157):     401f3810 bf00bd10 0002d75a 460db538 481eb928  
04-30 14:30:29.184: I/DEBUG(157):     401f3820 f7fc4478 2800edc4 b9fdd130 2102481b  
04-30 14:30:29.184: I/DEBUG(157):     401f3830 f0014478 2800faae db274604 f7fc4629  
04-30 14:30:29.184: I/DEBUG(157):     401f3840 2800ec4e 2101db0b f7fc4620 2800ec48  
04-30 14:30:29.184: I/DEBUG(157): code around lr:
04-30 14:30:29.184: I/DEBUG(157):     401f70b8 41f0e92d 4c0b2600 447c4680 68a56824  
04-30 14:30:29.184: I/DEBUG(157):     401f70c8 e0076867 300cf9b5 dd022b00 47c04628  
04-30 14:30:29.184: I/DEBUG(157):     401f70d8 35544306 d5f53f01 2c006824 4630d1ef  
04-30 14:30:29.184: I/DEBUG(157):     401f70e8 81f0e8bd 00029ec2 43f0e92d fb01461f  
04-30 14:30:29.184: I/DEBUG(157):     401f70f8 f8dff602 b0878058 44f8460c 8000f8d8  
04-30 14:30:29.184: I/DEBUG(157):     401f7108 9001a901 f8d84615 20013000 96059602  
04-30 14:30:29.184: I/DEBUG(157):     401f7118 90049103 4638b113 fa35f7ff a9034638  
04-30 14:30:29.184: I/DEBUG(157):     401f7128 fe9bf7ff 2000f8d8 b1124681 f7ff4638  
04-30 14:30:29.184: I/DEBUG(157):     401f7138 f1b9fa37 d0050f00 46219d05 f01a1b70  
04-30 14:30:29.184: I/DEBUG(157):     401f7148 4605ed46 b0074628 83f0e8bd 00029e3a  
04-30 14:30:29.184: I/DEBUG(157):     401f7158 1e4b6841 2b006043 f000da01 6803bbab  
04-30 14:30:29.184: I/DEBUG(157):     401f7168 2b01f813 46106003 00004770 4604b570  
04-30 14:30:29.184: I/DEBUG(157):     401f7178 447e4e0d 68336836 f7ffb10b 6861fa04  
04-30 14:30:29.184: I/DEBUG(157):     401f7188 60601e48 bfa22800 f8106820 60205b01  
04-30 14:30:29.184: I/DEBUG(157):     401f7198 4620da03 fb8ef000 68324605 4620b112  
04-30 14:30:29.184: I/DEBUG(157):     401f71a8 f9fef7ff bd704628 00029dc2 447b4b07  
04-30 14:30:29.184: I/DEBUG(157): memory map around fault addr deadbaad:
04-30 14:30:29.184: I/DEBUG(157):     bed17000-bed38000 [stack]
04-30 14:30:29.184: I/DEBUG(157):     (no map for address)
04-30 14:30:29.184: I/DEBUG(157):     ffff0000-ffff1000 [vectors]

此时窗口服务器看起来已经死了,我无法重新启动设备。

我基本上是在处理 OpenGL 2 示例。没什么太复杂的。只添加了一个速率限制器到 30 fps,但没有这个我仍然看到崩溃。

还有其他人看到过这种行为吗?这是运行最新 Android 系统的 Nexus 4。

最佳答案

我在使用 Unity 和自定义 Activity 时遇到了类似的问题。我不希望该应用随设备自动旋转并始终保持横向模式。所以我将 AndroidManifest 中的配置更改设置为以下内容:

<activity android:name="your.package.name.YourActivity" android:configChanges="orientation|keyboard|keyboardHidden|screenLayout|uiMode|screenSize|smallestScreenSize" android:screenOrientation="landscape">
...

我从 AdMob 广告 Activity 示例中获取了这些 configChanges。这成功了。现在,当我在锁定屏幕期间旋转它时,我的应用程序不会崩溃。在此之前,我只设置了 keyboardHidden|orientation,这还不足以修复它。

关于Android OpenGL Surface 在设备方向改变时崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16309459/

相关文章:

java - 重用密码(防止初始化)

Android SDL2 App黑屏然后退出

java - 设置 2D OpenGL ES 渲染器?

iphone - 在 iOS 设备上显示像素光栅的最快方法

android - Flutter - 如何使用包含表单的可扩展面板构建 ListView ?

sql查询字符串中的Android引号

android - EGL14类是什么意思?

android - 有使用 Android NDK 的经验吗?

android - 应用程序应如何处理使用 "Clear Data"的情况?

android - onLongPress 后继续 onScroll 事件