1

I'm working with some code that is based heavily on the Grafika sample application from Google/Andy McFadden.

I'm seeing an intermittent low level crash every now and then and the stack trace looks like this:

F/libc    (15674): Fatal signal 11 (SIGSEGV), code 1, fault addr 0x680070 in tid 16451 (TextureMovieEnc)
I/art     (15674): Background sticky concurrent mark sweep GC freed 95508(4MB) AllocSpace objects, 0(0B) LOS objects, 4% free, 86MB/90MB, paused 14.478ms total 80.728ms
W/TextureMovieEncoder(15674): MSG_FRAME_AVAILABLE sent
I/DEBUG   ( 1532): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
I/DEBUG   ( 1532): Build fingerprint: 'google/shamu/shamu:5.1.1/LMY48M/2167285:user/release-keys'
I/DEBUG   ( 1532): Revision: '33696'
I/DEBUG   ( 1532): ABI: 'arm'
I/DEBUG   ( 1532): pid: 15674, tid: 16451, name: TextureMovieEnc  >>> com.wizix.wizixgrid <<<
I/DEBUG   ( 1532): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x680070
I/DEBUG   ( 1532):     r0 9f53a900  r1 00000000  r2 00000000  r3 00680070
I/DEBUG   ( 1532):     r4 00000001  r5 9eb455c0  r6 9f53a900  r7 9c82d05c
I/DEBUG   ( 1532):     r8 aed5ae28  r9 00000001  sl 9eb455c0  fp aed5ae00
I/DEBUG   ( 1532):     ip 97418e00  sp 9b1f7700  lr aacad477  pc aacad240  cpsr 200e8c30
I/DEBUG   ( 1532): 
I/DEBUG   ( 1532): backtrace:
I/DEBUG   ( 1532):     #00 pc 00100240  /system/vendor/lib/egl/libGLESv2_adreno.so (EsxResource::GfxMem(unsigned int) const+7)
I/DEBUG   ( 1532):     #01 pc 00100473  /system/vendor/lib/egl/libGLESv2_adreno.so (EsxResource::UpdateGfxMemReference(EsxCmdMgr*, unsigned int, EsxAccessType)+18)
I/DEBUG   ( 1532):     #02 pc 00100537  /system/vendor/lib/egl/libGLESv2_adreno.so (EsxResource::UpdatePackedGfxMemReference(EsxCmdMgr*, EsxSubResourceRange const*, EsxAccessType)+170)
I/DEBUG   ( 1532):     #03 pc 0014b357  /system/vendor/lib/egl/libGLESv2_adreno.so (A4xContext::ValidateTexSamplers()+434)
I/DEBUG   ( 1532):     #04 pc 00149e97  /system/vendor/lib/egl/libGLESv2_adreno.so (A4xContext::ValidateState(EsxDrawDescriptor const*)+1394)
I/DEBUG   ( 1532):     #05 pc 0014a0a1  /system/vendor/lib/egl/libGLESv2_adreno.so (A4xContext::HwValidateGfxState(EsxDrawDescriptor const*)+8)
I/DEBUG   ( 1532):     #06 pc 00114235  /system/vendor/lib/egl/libGLESv2_adreno.so (EsxContext::ValidateGfxState(EsxDrawDescriptor const*)+420)
I/DEBUG   ( 1532):     #07 pc 00117211  /system/vendor/lib/egl/libGLESv2_adreno.so (EsxContext::DrawArraysInstanced(EsxPrimType, int, unsigned int, unsigned int)+92)
I/DEBUG   ( 1532):     #08 pc 000b2e81  /system/vendor/lib/egl/libGLESv2_adreno.so (EsxContext::GlDrawArrays(unsigned int, int, int)+52)
I/DEBUG   ( 1532):     #09 pc 000e54eb  /system/vendor/lib/egl/libGLESv2_adreno.so (EsxGlApiParamValidate::GlDrawArrays(EsxDispatch*, unsigned int, int, int)+58)
I/DEBUG   ( 1532):     #10 pc 000a9a61  /system/vendor/lib/egl/libGLESv2_adreno.so (glDrawArrays+44)
I/DEBUG   ( 1532):     #11 pc 00a3fbd3  /data/dalvik-cache/arm/system@framework@boot.oat

This was on a Nexus 6 running 5.1.1

I'm pretty sure this is occurring inside the handleFrameAvailable method of my TextureMovieEncoder which looks like this:

mVideoEncoder.drainEncoder(false);
mFullScreen.drawFrame(mTextureId, transform);
mInputWindowSurface.setPresentationTime(timestampNanos);
mInputWindowSurface.swapBuffers();

Where mVideoEncoder encapsulates a MediaCodec instance with an input surface.

Can anyone can identify any clues from this stack trace?

fadden
  • 51,356
  • 5
  • 116
  • 166
Dean Wild
  • 5,886
  • 3
  • 38
  • 45
  • 1
    Put log messages before and after the `drawFrame()` call. It's crashing in `glDrawArrays()`, so it's probably there, but it's always wise to be sure. The fault address on the SEGV_MAPERR is close enough to a page boundary that there's probably some memory being handed to the GLES driver that is no longer mapped. The GLES Java-language bindings use "direct" ByteBuffers, which are essentially an address and length to memory managed elsewhere, so it's possible to have the underlying memory discarded while the ByteBuffer is still around. Check your GLES setup. – fadden Oct 13 '15 at 17:21
  • http://pastebin.com/gkiYMsG5 think that i have pretty same error – Yevgen Kulik Jul 06 '16 at 19:24
  • I have been using the MediaCodec/MediaMuxer combo for encoding/recording from an input Surface. Some devices such as LG G3S, Samsung Galasy SIII (i93000), Samsung Galaxy S5 (G900F), Moto G (XT1032) seem to work forever, however devices like Moto G (XT1039), Galaxy S4 Mini (GT-9195), Galaxy S4 (GT-9505) seem to throw SIGSEGV faults and reboot/shutdown afterward. Have you encountered such issues? Am I right if I say it seems like a driver or hardware problem? Can you please point me to the right direction @fadden ? Thanks. – Endre Börcsök Jul 12 '16 at 16:07
  • Changing the Surface attributes to this seems to help:`attribList = new int[]{EGL14.EGL_RED_SIZE, 8, EGL14.EGL_GREEN_SIZE, 8, EGL14.EGL_BLUE_SIZE, 8, EGL14.EGL_ALPHA_SIZE, 8, EGL14.EGL_RENDERABLE_TYPE, EGL14.EGL_OPENGL_ES2_BIT, EGL_RECORDABLE_ANDROID, 1, EGL14.EGL_NONE };` – Endre Börcsök Jul 13 '16 at 08:00
  • 1
    Please share your solution if you found any. Thanks. – Ziad Halabi Oct 31 '16 at 15:21
  • Were you able to solve this issue? I'm facing a similar error. – Dustin Kerstein Apr 08 '19 at 20:33

0 Answers0