cocos2d / cocos2d-x

Cocos2d-x is a suite of open-source, cross-platform, game-development tools utilized by millions of developers across the globe. Its core has evolved to serve as the foundation for Cocos Creator 1.x & 2.x.
https://www.cocos.com/en/cocos2d-x
18.29k stars 7.05k forks source link

Crash on Android loading default GL programs #10084

Closed diamond-msc closed 9 years ago

diamond-msc commented 9 years ago

git bisect

git bisect bad 8ad9867ea7d3a1e09b3b4d084dc9dad52efa271e
# good: [06c8f093eca6ffb7bd6fd6fe37ef557969a80d36] Merge pull request #9413 from natural-law/v3
git bisect good 06c8f093eca6ffb7bd6fd6fe37ef557969a80d36
# good: [f73a07c7b962b4f3b93b0dd4de61e932c8869726] added missing files
git bisect good f73a07c7b962b4f3b93b0dd4de61e932c8869726
# good: [c1b958c540312ae5992eb576465c0d70aecedd5a] Merge pull request #9904 from Dhilan007/v3-systemfont-android-fix
git bisect good c1b958c540312ae5992eb576465c0d70aecedd5a
# bad: [1a121b4633a5727d1ce8432aef3268d61076f140] [ci skip] Update CHANGELOG
git bisect bad 1a121b4633a5727d1ce8432aef3268d61076f140
# good: [1bb4c12b1d4795fe4244a297c2bd36e6a3c987f8] Merge pull request #9948 from samuele3hu/v3_4_fix_bug
git bisect good 1bb4c12b1d4795fe4244a297c2bd36e6a3c987f8
# bad: [5faeb6919a6956852ba702c9e95db49f36f0ab15] [AUTO][ci skip]: updating cocos2dx_files.json
git bisect bad 5faeb6919a6956852ba702c9e95db49f36f0ab15
# good: [4fdc21e81a9a9c6d68846d52971cd5265052348c] Merge pull request #9956 from samuele3hu/v3_4_fix_bug
git bisect good 4fdc21e81a9a9c6d68846d52971cd5265052348c
# good: [45562f3203df16ac4cfe11ef77f8e055c03766fd] optimize based on review commends
git bisect good 45562f3203df16ac4cfe11ef77f8e055c03766fd
# good: [861b60832794e4877c4e29774925bdc123e8c266] [ci skip] update changelog
git bisect good 861b60832794e4877c4e29774925bdc123e8c266
# bad: [f4ac7c4e44ce06c5bbc92db39e25ee0d98f373a7] modify WP8 project and update precompileshader
git bisect bad f4ac7c4e44ce06c5bbc92db39e25ee0d98f373a7
# bad: [fea492ab4fef3deca96f2c47534038243ea58b40] DrawNode enable draw different size points
git bisect bad fea492ab4fef3deca96f2c47534038243ea58b40
# first bad commit: [fea492ab4fef3deca96f2c47534038243ea58b40] DrawNode enable draw different size points

crash log

D/libEGL  ( 6109): loaded /vendor/lib/egl/libEGL_POWERVR_SGX540_120.so
D/libEGL  ( 6109): loaded /vendor/lib/egl/libGLESv1_CM_POWERVR_SGX540_120.so
D/libEGL  ( 6109): loaded /vendor/lib/egl/libGLESv2_POWERVR_SGX540_120.so
V/ConfigFetchTask( 7490): ConfigFetchTask getDeviceDataVersionInfo(): ABFEt1XhzZ2ssJE5lS3i8NfBqBrLRqjS5CwYGhZLQA_tkpPqWD3Q5T41FmyPEbWzON1mY_e45f52yxsJqDAJW-xT4IPGCqyFUYm4_0ibvBkc92YC1hHNkVtoyA_f3JhoeEW9JTwnwqXIO3j7uiJu638B-OL_wGcwtxC2NXKNLeGhx0SvonZMbg2L0jQ7UpL2qHo1-HTpXFbT0dkPd_-nkP7QCbtQ6qmM-6X08edaGb6fqAESDP9hm4DMyBcVawNNDmQ86lgpRI3-7Z2gu7xptVVam-WGsq-VRpoK6N3fNRYvywII9XQg6Uh3g4lWCbXupiZmrKJaVVRyG1MsngqYTwAP-sia3pPN_lU7S44OmcMwXYXAF4phXRw
I/GoogleHttpClient( 7490): Falling back to old SSLCertificateSocketFactory
D/OpenGLRenderer( 6109): Enabling debug mode 0
D/cocos2d-x debug info( 6109): 
D/cocos2d-x debug info( 6109): {
D/cocos2d-x debug info( 6109):  cocos2d.x.version: cocos2d-x 3.4
D/cocos2d-x debug info( 6109):  cocos2d.x.compiled_with_gl_state_cache: true
D/cocos2d-x debug info( 6109):  gl.supports_S3TC: false
D/cocos2d-x debug info( 6109):  cocos2d.x.build_type: DEBUG
D/cocos2d-x debug info( 6109):  gl.supports_vertex_array_object: true
D/cocos2d-x debug info( 6109):  cocos2d.x.compiled_with_profiler: false
D/cocos2d-x debug info( 6109):  gl.renderer: PowerVR SGX 540
D/cocos2d-x debug info( 6109):  gl.vendor: Imagination Technologies
D/cocos2d-x debug info( 6109):  gl.version: OpenGL ES 2.0 build 1.9@2291151
D/cocos2d-x debug info( 6109):  gl.supports_ATITC: false
D/cocos2d-x debug info( 6109):  gl.supports_ETC1: true
D/cocos2d-x debug info( 6109):  gl.max_texture_units: 8
D/cocos2d-x debug info( 6109):  gl.supports_PVRTC: true
D/cocos2d-x debug info( 6109):  gl.max_texture_size: 2048
D/cocos2d-x debug info( 6109):  gl.supports_NPOT: true
D/cocos2d-x debug info( 6109):  gl.supports_discard_framebuffer: true
D/cocos2d-x debug info( 6109):  gl.supports_BGRA8888: true
D/cocos2d-x debug info( 6109): }
D/cocos2d-x debug info( 6109): 
D/cocos2d-x debug info( 6109): 
D/cocos2d-x debug info( 6109): OpenGL error 0x0501 in jni/../../../3rdparty/cocos2d-x-3/cocos/./renderer/CCGLProgramCache.cpp loadDefaultGLProgram 442
D/cocos2d-x debug info( 6109): 
...
D/cocos2d-x debug info( 6109): OpenGL error 0x0501 in jni/../../../3rdparty/cocos2d-x-3/cocos/./renderer/CCGLProgramCache.cpp loadDefaultGLProgram 442
D/cocos2d-x debug info( 6109): 
D/cocos2d-x debug info( 6109): OpenGL error 0x0501 in jni/../../../3rdparty/cocos2d-x-3/cocos/./renderer/CCGLProgramCache.cpp loadDefaultGLProgram 442
D/cocos2d-x debug info( 6109): 
D/cocos2d-x debug info( 6109): OpenGL error 0x0501 in jni/../../../3rdparty/cocos2d-x-3/cocos/./renderer/CCGLProgramCache.cpp loadDefaultGLProgram 442
D/cocos2d-x debug info( 6109): 
D/cocos2d-x debug info( 6109): OpenGL error 0x0501 in jni/../../../3rdparty/cocos2d-x-3/cocos/./renderer/CCGLProgramCache.cpp loadDefaultGLProgram 442
D/cocos2d-x debug info( 6109): 
D/cocos2d-x debug info( 6109): OpenGL error 0x0501 in jni/../../../3rdparty/cocos2d-x-3/cocos/./renderer/CCGLProgramCache.cpp loadDefaultGLProgram 442
D/cocos2d-x debug info( 6109): 
D/cocos2d-x debug info( 6109): OpenGL error 0x0501 in jni/../../../3rdparty/cocos2d-x-3/cocos/./renderer/CCGLProgramCache.cpp loadDefaultGLProgram 442
D/cocos2d-x debug info( 6109): 
D/cocos2d-x debug info( 6109): OpenGL error 0x0501 in jni/../../../3rdparty/cocos2d-x-3/cocos/./renderer/CCGLProgramCache.cpp loadDefaultGLProgram 442
D/cocos2d-x debug info( 6109): 
D/cocos2d-x debug info( 6109): error: 0x501
F/libc    ( 6109): jni/../../../3rdparty/cocos2d-x-3/cocos/./renderer/CCGLProgram.cpp:378: void cocos2d::GLProgram::parseUniforms(): assertion "__gl_error_code == GL_NO_ERROR" failed
F/libc    ( 6109): Fatal signal 11 (SIGSEGV) at 0xdeadbaad (code=1), thread 6127 (Thread-1900)
I/DEBUG   (  108): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
I/DEBUG   (  108): Build fingerprint: 'Android/cm_acclaim/acclaim:4.3.1/JLS36I/9eb2689822:userdebug/test-keys'
I/DEBUG   (  108): Revision: '5'
I/DEBUG   (  108): pid: 6109, tid: 6127, name: Thread-1900  >>> org.cocos2dx.MyCppGame <<<
I/DEBUG   (  108): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr deadbaad
I/DEBUG   (  108): Abort message: 'jni/../../../3rdparty/cocos2d-x-3/cocos/./renderer/CCGLProgram.cpp:378: void cocos2d::GLProgram::parseUniforms(): assertion "__gl_error_code == GL_NO_ERROR" failed'
I/ConfigFetchService( 7490): fetch service done; releasing wakelock
I/ConfigFetchService( 7490): stopping self
I/ConfigService( 7076): onDestroy
I/DEBUG   (  108):     r0 00000027  r1 00000000  r2 00000008  r3 deadbaad
...
I/DEBUG   (  108):     scr 60000011
I/DEBUG   (  108): 
I/DEBUG   (  108): backtrace:
I/DEBUG   (  108):     #00  pc 0001ee84  /system/lib/libc.so
I/DEBUG   (  108):     #01  pc 0001c67c  /system/lib/libc.so (abort+4)
I/DEBUG   (  108):     #02  pc 00012365  /system/lib/libc.so
I/DEBUG   (  108):     #03  pc 00011895  /system/lib/libc.so (__assert2+20)
I/DEBUG   (  108):     #04  pc 00d1273c  /data/app-lib/org.cocos2dx.MyCppGame-2/libmycocos2dcpp.so (cocos2d::GLProgram::parseUniforms()+1172)
I/DEBUG   (  108):     #05  pc 00d136ac  /data/app-lib/org.cocos2dx.MyCppGame-2/libmycocos2dcpp.so (cocos2d::GLProgram::link()+236)
I/DEBUG   (  108):     #06  pc 00d1f058  /data/app-lib/org.cocos2dx.MyCppGame-2/libmycocos2dcpp.so (cocos2d::GLProgramCache::loadDefaultGLProgram(cocos2d::GLProgram*, int)+4940)
I/DEBUG   (  108):     #07  pc 00d1c5f4  /data/app-lib/org.cocos2dx.MyCppGame-2/libmycocos2dcpp.so (cocos2d::GLProgramCache::loadDefaultGLPrograms()+2372)
I/DEBUG   (  108):     #08  pc 00d1bc9c  /data/app-lib/org.cocos2dx.MyCppGame-2/libmycocos2dcpp.so (cocos2d::GLProgramCache::init()+20)
I/DEBUG   (  108):     #09  pc 00d1b7b4  /data/app-lib/org.cocos2dx.MyCppGame-2/libmycocos2dcpp.so (cocos2d::GLProgramCache::getInstance()+120)
I/DEBUG   (  108):     #10  pc 00d43c1c  /data/app-lib/org.cocos2dx.MyCppGame-2/libmycocos2dcpp.so (cocos2d::Texture2D::initWithMipmaps(cocos2d::_MipmapInfo*, int, cocos2d::Texture2D::PixelFormat, int, int)+2340)
I/DEBUG   (  108):     #11  pc 00d432c4  /data/app-lib/org.cocos2dx.MyCppGame-2/libmycocos2dcpp.so (cocos2d::Texture2D::initWithData(void const*, int, cocos2d::Texture2D::PixelFormat, int, int, cocos2d::Size const&)+308)
I/DEBUG   (  108):     #12  pc 00d4416c  /data/app-lib/org.cocos2dx.MyCppGame-2/libmycocos2dcpp.so (cocos2d::Texture2D::initWithImage(cocos2d::Image*, cocos2d::Texture2D::PixelFormat)+728)
I/DEBUG   (  108):     #13  pc 00d43e78  /data/app-lib/org.cocos2dx.MyCppGame-2/libmycocos2dcpp.so (cocos2d::Texture2D::initWithImage(cocos2d::Image*)+44)
I/DEBUG   (  108):     #14  pc 00d4e6c4  /data/app-lib/org.cocos2dx.MyCppGame-2/libmycocos2dcpp.so (cocos2d::TextureCache::addImage(cocos2d::Image*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)+560)
I/DEBUG   (  108):     #15  pc 00ca512c  /data/app-lib/org.cocos2dx.MyCppGame-2/libmycocos2dcpp.so (cocos2d::Director::createStatsLabel()+776)
I/DEBUG   (  108):     #16  pc 00ca1928  /data/app-lib/org.cocos2dx.MyCppGame-2/libmycocos2dcpp.so (cocos2d::Director::setOpenGLView(cocos2d::GLView*)+588)
I/DEBUG   (  108):     #17  pc 00bbb4c0  /data/app-lib/org.cocos2dx.MyCppGame-2/libmycocos2dcpp.so (Java_org_cocos2dx_lib_Cocos2dxRenderer_nativeInit+200)
I/DEBUG   (  108):     #18  pc 0001eb0c  /system/lib/libdvm.so (dvmPlatformInvoke+112)
I/DEBUG   (  108):     #19  pc 0004f457  /system/lib/libdvm.so (dvmCallJNIMethod(unsigned int const*, JValue*, Method const*, Thread*)+398)
I/DEBUG   (  108):     #20  pc 00050e45  /system/lib/libdvm.so (dvmResolveNativeMethod(unsigned int const*, JValue*, Method const*, Thread*)+184)
I/DEBUG   (  108):     #21  pc 00027fa0  /system/lib/libdvm.so
I/DEBUG   (  108):     #22  pc 0002c9d0  /system/lib/libdvm.so (dvmInterpret(Thread*, Method const*, JValue*)+184)
I/DEBUG   (  108):     #23  pc 000614ad  /system/lib/libdvm.so (dvmCallMethodV(Thread*, Method const*, Object*, bool, JValue*, std::__va_list)+292)
I/DEBUG   (  108):     #24  pc 000614d7  /system/lib/libdvm.so (dvmCallMethod(Thread*, Method const*, Object*, JValue*, ...)+20)
I/DEBUG   (  108):     #25  pc 0005625f  /system/lib/libdvm.so
I/DEBUG   (  108):     #26  pc 0000cb60  /system/lib/libc.so (__thread_entry+72)
I/DEBUG   (  108):     #27  pc 0000ccdc  /system/lib/libc.so (pthread_create+208)
I/DEBUG   (  108):     #28  pc 000008c4  <unknown>
I/DEBUG   (  108): 
I/DEBUG   (  108): stack:
I/DEBUG   (  108):          60413488  00000000  
I/DEBUG   (  108):          6041348c  00000000  
I/DEBUG   (  108):          60413490  400db170  /system/lib/libc.so
minggo commented 9 years ago

@diamond-msc What's the engine version? How to reproduce it? What's the device you tested on? What's the Android OS version?

diamond-msc commented 9 years ago

engine: c++ cocos2d.x.version: cocos2d-x 3.4 fea492ab4fef3deca96f2c47534038243ea58b40 device/version: Android/cm_acclaim/acclaim:4.3.1(rooted http://en.wikipedia.org/wiki/Nook_Tablet#16_GB_version) reproduce: Seen on my project, that crashed after updating cocos2d-x, I'm going to check if it occurs on a test project.

diamond-msc commented 9 years ago

Reproducible with android-build.py -p17 -n -j8 cpp-empty-test App crashes immediately on startup.

minggo commented 9 years ago

I think it is fixed in v3.4rc1. Because we tested before releasing. Could you please have a try?

minggo commented 9 years ago

What's your Android device tested on?

diamond-msc commented 9 years ago

Still reproducible on https://github.com/cocos2d/cocos2d-x/tree/cocos2d-x-3.4rc1

diamond-msc commented 9 years ago

Nook tablet 16 GB ARM Cortex-A9, 2x 1.00GHz (TI OMAP 4430) • 1GB • PowerVR SGX540

dabingnn commented 9 years ago

@diamond-msc Could you please test the latest version of cocos2d-x v3 branch? It seems that this problem is similar to #10079

diamond-msc commented 9 years ago

verified :+1: