ChillingVan / android-openGL-canvas

An Android library that provides views using openGL canvas to draw things on SurfaceView or TextureView.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

调用时报: SIGSEGV(SEGV_ACCERR)/(SEGV_MAPERR)

opened this issue · comments

都是bugly上收集来的堆栈信息, 都是在调用GLES20Canvas.texSubImage2D出现的问题
不知道有没有什么思路?
找了3个堆栈信息,如下

机型1:
---------红米 REDMI NOTE 3--------Android 5.0.2----SIGSEGV(SEGV_ACCERR)---
#00 pc 0000000000017a00 /system/lib64/libc.so (memcpy+128) [arm64-v8a]

#1 pc 0000000000068490 /system/vendor/lib64/egl/libGLESv2_mtk.so [arm64-v8a]
#2 pc 00000000000693f0 /system/vendor/lib64/egl/libGLESv2_mtk.so [arm64-v8a]
#3 pc 00000000000600a0 /system/vendor/lib64/egl/libGLESv2_mtk.so (glTexSubImage2D+2644) [arm64-v8a]
#4 pc 00000000000929e8 /system/lib64/libandroid_runtime.so [arm64-v8a]
#5 pc 0000000000e341a4 /data/dalvik-cache/arm64/system@framework@boot.oat []
7 java:
8 android.opengl.GLUtils.texSubImage2D(GLUtils.java:222)

----------- VIVO X6SPLUS D Android 5.1.1,level 22------- SIGSEGV(SEGV_ACCERR)---------
#00 pc 00000000002886dc /system/vendor/lib64/egl/libGLESv2_adreno.so (A5xBltDevice::A5xBltMacroTileGeneral565Swizzle(unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, BltExecSwCopy*)+844) [arm64-v8a]

#1 pc 000000000028a754 /system/vendor/lib64/egl/libGLESv2_adreno.so (A5xBltDevice::A5xBltMacroTileGeneral(unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, BltExecSwCopy*)+296) [arm64-v8a]
#2 pc 000000000028b3b0 /system/vendor/lib64/egl/libGLESv2_adreno.so (A5xBltDevice::ExecFastSwCopyLinearInputMacroTiledOutput(BltExecSwCopy*)+1308) [arm64-v8a]
#3 pc 000000000026f274 /system/vendor/lib64/egl/libGLESv2_adreno.so (BltDevice::ExecSwCopyInternal(BltExecSwCopy*)+5648) [arm64-v8a]
#4 pc 000000000026f470 /system/vendor/lib64/egl/libGLESv2_adreno.so (BltDevice::ExecSwCopy(BltExecSwCopy*)+228) [arm64-v8a]
#5 pc 000000000023cd68 /system/vendor/lib64/egl/libGLESv2_adreno.so (EsxBltLib::CopyHostPtrBltSw(EsxBltCopyHostPtr const*)+1432) [arm64-v8a]
#6 pc 0000000000187e6c /system/vendor/lib64/egl/libGLESv2_adreno.so (EsxResource::UpdateSubResourceDirect(EsxContext*, unsigned int, EsxBox const*, EsxSurfaceAccessDesc const*)+1416) [arm64-v8a]
#7 pc 0000000000140a50 /system/vendor/lib64/egl/libGLESv2_adreno.so (EsxContext::UpdateSubResource(EsxResource*, unsigned int, EsxBox const*, EsxSurfaceAccessDesc const*)+860) [arm64-v8a]
#8 pc 000000000013f5f8 /system/vendor/lib64/egl/libGLESv2_adreno.so (EsxContext::TexImage(EsxTextureType, unsigned int, EsxInternalFormat, EsxBox const*, EsxPixFormat, EsxPixType, int, void const*)+700) [arm64-v8a]
10 #9 pc 0000000000115910 /system/vendor/lib64/egl/libGLESv2_adreno.so (EsxContext::GlTexSubImage2D(unsigned int, int, int, int, int, int, unsigned int, unsigned int, void const*)+96) [arm64-v8a]
11 #10 pc 0000000000155e5c /system/vendor/lib64/egl/libGLESv2_adreno.so (EsxGlApiParamValidate::GlTexSubImage2D(EsxDispatch*, unsigned int, int, int, int, int, int, unsigned int, unsigned int, void const*)+416) [arm64-v8a]
12 #11 pc 0000000000105b2c /system/vendor/lib64/egl/libGLESv2_adreno.so (glTexSubImage2D+124) [arm64-v8a]
13 #12 pc 000000000008ea9c /system/lib64/libandroid_runtime.so [arm64-v8a]
14 #13 pc 00000000012d74a8 /system/framework/arm64/boot.oat []
15 java:
16 android.opengl.GLUtils.texSubImage2D(GLUtils.java:222)

机型2:
------------ VIVO Y66L Android 6.0.1,level 23----------SIGSEGV(SEGV_ACCERR)----------

#00 pc 00167cb6 /system/vendor/lib/egl/libESXGLESv2_adreno.so (A5xBltDevice::A5xBltMacroTileGeneral565Swizzle(unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, BltExecSwCopy*)+533) [armeabi-v7a]

#1 pc 00169891 /system/vendor/lib/egl/libESXGLESv2_adreno.so (A5xBltDevice::A5xBltMacroTileGeneral(unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, BltExecSwCopy*)+208) [armeabi-v7a]
#2 pc 0016a061 /system/vendor/lib/egl/libESXGLESv2_adreno.so (A5xBltDevice::ExecFastSwCopyLinearInputMacroTiledOutput(BltExecSwCopy*)+800) [armeabi-v7a]
#3 pc 00153607 /system/vendor/lib/egl/libESXGLESv2_adreno.so (BltDevice::ExecSwCopyInternal(BltExecSwCopy*)+5574) [armeabi-v7a]
#4 pc 001537ad /system/vendor/lib/egl/libESXGLESv2_adreno.so (BltDevice::ExecSwCopy(BltExecSwCopy*)+172) [armeabi-v7a]
#5 pc 00128a2f /system/vendor/lib/egl/libESXGLESv2_adreno.so (EsxBltLib::CopyHostPtrBltSw(EsxBltCopyHostPtr const*)+1230) [armeabi-v7a]
#6 pc 000fc441 /system/vendor/lib/egl/libESXGLESv2_adreno.so (EsxResource::UpdateSubResourceDirect(EsxContext*, unsigned int, EsxBox const*, EsxSurfaceAccessDesc const*)+608) [armeabi-v7a]
#7 pc 000c007d /system/vendor/lib/egl/libESXGLESv2_adreno.so (EsxContext::UpdateSubResource(EsxResource*, unsigned int, EsxBox const*, EsxSurfaceAccessDesc const*)+668) [armeabi-v7a]
#8 pc 000bee55 /system/vendor/lib/egl/libESXGLESv2_adreno.so (EsxContext::TexImage(EsxTextureType, unsigned int, EsxInternalFormat, EsxBox const*, EsxPixFormat, EsxPixType, int, void const*)+500) [armeabi-v7a]
10 #9 pc 0009d029 /system/vendor/lib/egl/libESXGLESv2_adreno.so (EsxContext::GlTexSubImage2D(unsigned int, int, int, int, int, int, unsigned int, unsigned int, void const*)+72) [armeabi-v7a]
11 #10 pc 000d3f69 /system/vendor/lib/egl/libESXGLESv2_adreno.so (EsxGlApiParamValidate::GlTexSubImage2D(EsxDispatch*, unsigned int, int, int, int, int, int, unsigned int, unsigned int, void const*)+104) [armeabi-v7a]
12 #11 pc 00091d1b /system/vendor/lib/egl/libESXGLESv2_adreno.so (glTexSubImage2D+58) [armeabi-v7a]
13 #12 pc 000a17d7 /system/lib/libandroid_runtime.so [armeabi-v7a]
14 #13 pc 00d901f5 /system/framework/arm/boot.oat (oatdata+14217717) [armeabi]
15 java:
16 android.opengl.GLUtils.texSubImage2D(GLUtils.java:214)

机型3:
--------------三星 SM G5520 Android 8.1.0,level 27--------------SIGSEGV(SEGV_MAPERR)-----------
#00 pc 00143b6a /system/vendor/lib/egl/libRBGLESv2_adreno.so (oxili_setshaderbinary_and_linkerdata+581) [armeabi-v8]

#1 pc 00142fe9 /system/vendor/lib/egl/libRBGLESv2_adreno.so (oxili_tile_texture+1748) [armeabi-v8]
#2 pc 000e6cb1 /system/vendor/lib/egl/libRBGLESv2_adreno.so (rb_surface_map_texture3d+1964) [armeabi-v8]
#3 pc 000e620b /system/vendor/lib/egl/libRBGLESv2_adreno.so (rb_texture_update_hw_subimage+8030) [armeabi-v8]
#4 pc 00092d53 /system/vendor/lib/egl/libRBGLESv2_adreno.so (TexSubImageLoad+306) [armeabi-v8]
#5 pc 000937db /system/vendor/lib/egl/libRBGLESv2_adreno.so (core_glTexSubImage2D+234) [armeabi-v8]
#6 pc 0004735b /system/vendor/lib/egl/libRBGLESv2_adreno.so (glTexSubImage2D+94) [armeabi-v8]
#7 pc 000e5cfb /system/lib/libandroid_runtime.so [armeabi-v8]
#8 pc 00daa9f5 /system/framework/arm/boot-framework.oat (oatexec+7801333) [armeabi]
10 java:
11 android.opengl.GLUtils.texSubImage2D(GLUtils.java:214)

    /**
     * Calls glTexSubImage2D() on the current OpenGL context. If no context is
     * current the behavior is the same as calling glTexSubImage2D() with  no
     * current context, that is, eglGetError() will return the appropriate
     * error.
     * Unlike glTexSubImage2D() bitmap cannot be null and will raise an exception
     * in that case.
     * All other parameters are identical to those used for glTexSubImage2D().
     *
     * NOTE: this method doesn't change GL_UNPACK_ALIGNMENT, you must make
     * sure to set it properly according to the supplied bitmap.
     *
     * Whether or not bitmap can have non power of two dimensions depends on
     * the current OpenGL context. Always check glGetError() some time
     * after calling this method, just like when using OpenGL directly.
     *
     * @param target
     * @param level
     * @param xoffset
     * @param yoffset
     * @param bitmap
     */
    public static void texSubImage2D(int target, int level, int xoffset, int yoffset,
            Bitmap bitmap) {
        if (bitmap == null) {
            throw new NullPointerException("texSubImage2D can't be used with a null Bitmap");
        }
        if (bitmap.isRecycled()) {
            throw new IllegalArgumentException("bitmap is recycled");
        }
        int type = getType(bitmap);
        if (native_texSubImage2D(target, level, xoffset, yoffset, bitmap, -1, type)!=0) {
            throw new IllegalArgumentException("invalid Bitmap format");
        }
    }

从上面源代码看似乎看不出什么。实在没办法的话,看检查一下像RawTexture这些对象有没有泄露。
最好能重现,不能重现,手头上又没有相应机型,还是挺难搞的