Samsung / GearVRf

The GearVR framework(GearVRf) is an Open Source VR rendering library for application development on VR-supported Android devices.
http://www.gearvrf.org
Apache License 2.0
407 stars 217 forks source link

SIGSEGVs reported by gvr-simplephysics #1100

Open rahul27 opened 7 years ago

rahul27 commented 7 years ago

Here are the two stacktraces. Note that I am using Oculus SDK 1.5.0

03-21 06:47:02.066 18831 18831 F DEBUG   : backtrace:
03-21 06:47:02.066 18831 18831 F DEBUG   :     #00 pc 001b1d96  /data/app/org.gearvrf.gvrsimlephysics-1/lib/arm/libgvrf.so (_ZNSt8_Rb_treeIiSt4pairIKibESt10_Select1stIS2_ESt4lessIiESaIS2_EE8_M_beginEv+9)
03-21 06:47:02.066 18831 18831 F DEBUG   :     #01 pc 001b4885  /data/app/org.gearvrf.gvrsimlephysics-1/lib/arm/libgvrf.so (_ZNSt8_Rb_treeIiSt4pairIKibESt10_Select1stIS2_ESt4lessIiESaIS2_EE4findERS1_+24)
03-21 06:47:02.066 18831 18831 F DEBUG   :     #02 pc 001b4159  /data/app/org.gearvrf.gvrsimlephysics-1/lib/arm/libgvrf.so (_ZNSt3mapIibSt4lessIiESaISt4pairIKibEEE4findERS3_+16)
03-21 06:47:02.066 18831 18831 F DEBUG   :     #03 pc 001b31a9  /data/app/org.gearvrf.gvrsimlephysics-1/lib/arm/libgvrf.so (_ZN3gvr5Light6renderEii+44)
03-21 06:47:02.066 18831 18831 F DEBUG   :     #04 pc 001ea861  /data/app/org.gearvrf.gvrsimlephysics-1/lib/arm/libgvrf.so (_ZN3gvr12CustomShader6renderEPNS_11RenderStateEPNS_10RenderDataEPNS_8MaterialE+1204)
03-21 06:47:02.066 18831 18831 F DEBUG   :     #05 pc 00185545  /data/app/org.gearvrf.gvrsimlephysics-1/lib/arm/libgvrf.so (_ZN3gvr10GLRenderer20renderMaterialShaderERNS_11RenderStateEPNS_10RenderDataEPNS_8MaterialE+1468)
03-21 06:47:02.066 18831 18831 F DEBUG   :     #06 pc 00184f63  /data/app/org.gearvrf.gvrsimlephysics-1/lib/arm/libgvrf.so (_ZN3gvr10GLRenderer10renderMeshERNS_11RenderStateEPNS_10RenderDataE+142)
03-21 06:47:02.066 18831 18831 F DEBUG   :     #07 pc 0017f2ef  /data/app/org.gearvrf.gvrsimlephysics-1/lib/arm/libgvrf.so (_ZN3gvr8Renderer16renderRenderDataERNS_11RenderStateEPNS_10RenderDataE+94)
03-21 06:47:02.066 18831 18831 F DEBUG   :     #08 pc 0018498f  /data/app/org.gearvrf.gvrsimlephysics-1/lib/arm/libgvrf.so (_ZN3gvr10GLRenderer15renderShadowMapERNS_11RenderStateEPNS_6CameraEjRSt6vectorIPNS_11SceneObjectESaIS7_EE+258)
03-21 06:47:02.066 18831 18831 F DEBUG   :     #09 pc 001b3f5d  /data/app/org.gearvrf.gvrsimlephysics-1/lib/arm/libgvrf.so (_ZN3gvr5Light13makeShadowMapEPNS_5SceneEPNS_13ShaderManagerEiRSt6vectorIPNS_11SceneObjectESaIS7_EEii+748)
03-21 06:47:02.066 18831 18831 F DEBUG   :     #10 pc 001847e5  /data/app/org.gearvrf.gvrsimlephysics-1/lib/arm/libgvrf.so (_ZN3gvr10GLRenderer14makeShadowMapsEPNS_5SceneEPNS_13ShaderManagerEii+200)
03-21 06:47:02.066 18831 18831 F DEBUG   :     #11 pc 00122e8f  /data/app/org.gearvrf.gvrsimlephysics-1/lib/arm/libgvrf.so (Java_org_gearvrf_GVRViewManager_makeShadowMaps+74)
03-21 06:47:02.066 18831 18831 F DEBUG   :     #12 pc 0042e3f5  /data/app/org.gearvrf.gvrsimlephysics-1/oat/arm/base.odex (offset 0x3cd000)
03-21 08:14:27.075  6678  6678 F DEBUG   : backtrace:
03-21 08:14:27.075  6678  6678 F DEBUG   :     #00 pc 0012388e  /data/app/org.gearvrf.gvrsimlephysics-2/lib/arm/libgvrf.so (_ZNKSt12__shared_ptrIbLN9__gnu_cxx12_Lock_policyE2EE3getEv+9)
03-21 08:14:27.075  6678  6678 F DEBUG   :     #01 pc 001a2d9d  /data/app/org.gearvrf.gvrsimlephysics-2/lib/arm/libgvrf.so (_ZSteqIbbEbRKSt10shared_ptrIT_ERKS0_IT0_E+24)
03-21 08:14:27.075  6678  6678 F DEBUG   :     #02 pc 001a2bb5  /data/app/org.gearvrf.gvrsimlephysics-2/lib/arm/libgvrf.so (_ZNKSt8equal_toISt10shared_ptrIbEEclERKS1_S4_+16)
03-21 08:14:27.075  6678  6678 F DEBUG   :     #03 pc 001a2955  /data/app/org.gearvrf.gvrsimlephysics-2/lib/arm/libgvrf.so (_ZNSt8__detail13_Equal_helperISt10shared_ptrIbES2_NS_9_IdentityESt8equal_toIS2_EjLb0EE9_S_equalsERKS5_RKS3_RKS2_jPNS_10_Hash_nodeIS2_Lb0EEE+40)
03-21 08:14:27.076  6678  6678 F DEBUG   :     #04 pc 001a2647  /data/app/org.gearvrf.gvrsimlephysics-2/lib/arm/libgvrf.so (_ZNKSt8__detail15_Hashtable_baseISt10shared_ptrIbES2_NS_9_IdentityESt8equal_toIS2_ESt4hashIS2_ENS_18_Mod_range_hashingENS_20_Default_ranged_hashENS_17_Hashtable_traitsILb0ELb1ELb1EEEE9_M_equalsERKS2_jPNS_10_Hash_nodeIS2_Lb0EEE+42)
03-21 08:14:27.076  6678  6678 F DEBUG   :     #05 pc 001a1e69  /data/app/org.gearvrf.gvrsimlephysics-2/lib/arm/libgvrf.so (_ZNKSt10_HashtableISt10shared_ptrIbES1_SaIS1_ENSt8__detail9_IdentityESt8equal_toIS1_ESt4hashIS1_ENS3_18_Mod_range_hashingENS3_20_Default_ranged_hashENS3_20_Prime_rehash_policyENS3_17_Hashtable_traitsILb0ELb1ELb1EEEE19_M_find_before_nodeEjRKS1_j+52)
03-21 08:14:27.076  6678  6678 F DEBUG   :     #06 pc 001a111b  /data/app/org.gearvrf.gvrsimlephysics-2/lib/arm/libgvrf.so (_ZNKSt10_HashtableISt10shared_ptrIbES1_SaIS1_ENSt8__detail9_IdentityESt8equal_toIS1_ESt4hashIS1_ENS3_18_Mod_range_hashingENS3_20_Default_ranged_hashENS3_20_Prime_rehash_policyENS3_17_Hashtable_traitsILb0ELb1ELb1EEEE12_M_find_nodeEjRKS1_j+22)
03-21 08:14:27.076  6678  6678 F DEBUG   :     #07 pc 0019f8c1  /data/app/org.gearvrf.gvrsimlephysics-2/lib/arm/libgvrf.so (_ZNSt10_HashtableISt10shared_ptrIbES1_SaIS1_ENSt8__detail9_IdentityESt8equal_toIS1_ESt4hashIS1_ENS3_18_Mod_range_hashingENS3_20_Default_ranged_hashENS3_20_Prime_rehash_policyENS3_17_Hashtable_traitsILb0ELb1ELb1EEEE9_M_insertIRKS1_NS3_10_AllocNodeISaINS3_10_Hash_nodeIS1_Lb0EEEEEEEESt4pairINS3_14_Node_iteratorIS1_Lb1ELb0EEEbEOT_RKT0_St17integral_constantIbLb1EE+80)
03-21 08:14:27.076  6678  6678 F DEBUG   :     #08 pc 0019e557  /data/app/org.gearvrf.gvrsimlephysics-2/lib/arm/libgvrf.so (_ZNSt8__detail12_Insert_baseISt10shared_ptrIbES2_SaIS2_ENS_9_IdentityESt8equal_toIS2_ESt4hashIS2_ENS_18_Mod_range_hashingENS_20_Default_ranged_hashENS_20_Prime_rehash_policyENS_17_Hashtable_traitsILb0ELb1ELb1EEEE6insertERKS2_+62)
03-21 08:14:27.076  6678  6678 F DEBUG   :     #09 pc 0019d5e7  /data/app/org.gearvrf.gvrsimlephysics-2/lib/arm/libgvrf.so (_ZNSt13unordered_setISt10shared_ptrIbESt4hashIS1_ESt8equal_toIS1_ESaIS1_EE6insertERKS1_+22)
03-21 08:14:27.076  6678  6678 F DEBUG   :     #10 pc 0019d56b  /data/app/org.gearvrf.gvrsimlephysics-2/lib/arm/libgvrf.so (_ZN3gvr4Mesh14add_dirty_flagERKSt10shared_ptrIbE+38)
03-21 08:14:27.076  6678  6678 F DEBUG   :     #11 pc 001cbe05  /data/app/org.gearvrf.gvrsimlephysics-2/lib/arm/libgvrf.so (_ZN3gvr10RenderData8set_meshEPNS_4MeshE+24)
03-21 08:14:27.076  6678  6678 F DEBUG   :     #12 pc 001c3463  /data/app/org.gearvrf.gvrsimlephysics-2/lib/arm/libgvrf.so (Java_org_gearvrf_NativeRenderData_setMesh+26)
03-21 08:14:27.076  6678  6678 F DEBUG   :     #13 pc 003ec66b  /data/app/org.gearvrf.gvrsimlephysics-2/oat/arm/base.odex (offset 0x3cd000)
NolaDonato commented 7 years ago

I ran this yesterday and it worked OK for me. What did you do with the app to cause the crash? Is it just Oculus SDK 1.5?

liaxim commented 7 years ago

This looks like a build-related issue. Have you tried completely cleaning the trees before building?

I just ran the app with 1.5.0 and it worked fine for me.

rahul27 commented 7 years ago

The app works fine for me as well. The crashes happen occasionally on some runs that causes the app to shutdown.

liaxim commented 7 years ago

Do you want to hold up the 1.5.0 pull request for this or can we look at it separately?

Have you tried master? What's the behavior there?

rahul27 commented 7 years ago

Don't think it is necessarily an 1.5.0 issue. Haven't tried master as yet. Its just that I have been using this app and 1.5.0 to test the gear controller support.

liaxim commented 7 years ago

Interesting.. I saw a crash too though not exactly the same (on master). Was throwing the balls as quickly as possible continuously.

03-21 10:04:26.832 20665 20691 F libc    : Fatal signal 11 (SIGSEGV), code 1, fault addr 0xc2640028 in tid 20691 (GLThread 671)
03-21 10:04:26.912  3152  3152 F DEBUG   : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
03-21 10:04:26.912  3152  3152 F DEBUG   : Build fingerprint: 'samsung/noblelteuc/noblelteatt:6.0.1/MMB29K/N920AUCS4CQB2:user/release-keys'
03-21 10:04:26.912  3152  3152 F DEBUG   : Revision: '9'
03-21 10:04:26.912  3152  3152 F DEBUG   : ABI: 'arm'
03-21 10:04:26.912  3152  3152 F DEBUG   : pid: 20665, tid: 20691, name: GLThread 671  >>> org.gearvrf.gvrsimlephysics <<<
03-21 10:04:26.912  3152  3152 F DEBUG   : signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0xc2640028
03-21 10:04:26.942  3152  3152 F DEBUG   :     r0 eec8df44  r1 de15cc90  r2 de753298  r3 d8b0d0d0
03-21 10:04:26.942  3152  3152 F DEBUG   :     r4 d84f4ab0  r5 eec8df44  r6 c2640000  r7 eec8df44
03-21 10:04:26.942  3152  3152 F DEBUG   :     r8 de15cc90  r9 eec8df44  sl de15cc90  fp 00000000
03-21 10:04:26.942  3152  3152 F DEBUG   :     ip d52234d1  sp de753240  lr d520284d  pc d52023f6  cpsr 200e0030
03-21 10:04:26.962  3152  3152 F DEBUG   : 
03-21 10:04:26.962  3152  3152 F DEBUG   : backtrace:
03-21 10:04:26.962  3152  3152 F DEBUG   :     #00 pc 0005b3f6  /data/app/org.gearvrf.gvrsimlephysics-1/lib/arm/libBullet.so
03-21 10:04:26.962  3152  3152 F DEBUG   :     #01 pc 0005b849  /data/app/org.gearvrf.gvrsimlephysics-1/lib/arm/libBullet.so (_ZN6btDbvt6updateEP10btDbvtNodeR12btDbvtAabbMm+10)
03-21 10:04:26.962  3152  3152 F DEBUG   :     #02 pc 0005c983  /data/app/org.gearvrf.gvrsimlephysics-1/lib/arm/libBullet.so (_ZN16btDbvtBroadphase7setAabbEP17btBroadphaseProxyRK9btVector3S4_P12btDispatcher+286)
03-21 10:04:26.962  3152  3152 F DEBUG   :     #03 pc 00065c9b  /data/app/org.gearvrf.gvrsimlephysics-1/lib/arm/libBullet.so (_ZN16btCollisionWorld16updateSingleAabbEP17btCollisionObject+130)
03-21 10:04:26.962  3152  3152 F DEBUG   :     #04 pc 00065dd3  /data/app/org.gearvrf.gvrsimlephysics-1/lib/arm/libBullet.so (_ZN16btCollisionWorld11updateAabbsEv+58)
03-21 10:04:26.962  3152  3152 F DEBUG   :     #05 pc 000648ef  /data/app/org.gearvrf.gvrsimlephysics-1/lib/arm/libBullet.so (_ZN16btCollisionWorld33performDiscreteCollisionDetectionEv+22)
03-21 10:04:26.962  3152  3152 F DEBUG   :     #06 pc 00096c7f  /data/app/org.gearvrf.gvrsimlephysics-1/lib/arm/libBullet.so (_ZN23btDiscreteDynamicsWorld28internalSingleStepSimulationEf+66)
03-21 10:04:26.962  3152  3152 F DEBUG   :     #07 pc 000964ef  /data/app/org.gearvrf.gvrsimlephysics-1/lib/arm/libBullet.so (_ZN23btDiscreteDynamicsWorld14stepSimulationEfif+250)
03-21 10:04:26.962  3152  3152 F DEBUG   :     #08 pc 006be477  /data/app/org.gearvrf.gvrsimlephysics-1/oat/arm/base.odex (offset 0x51a000) (void org.gearvrf.physics.NativePhysics3DWorld.step(long, float)+98)
03-21 10:04:26.962  3152  3152 F DEBUG   :     #09 pc 00c0418d  /data/app/org.gearvrf.gvrsimlephysics-1/oat/arm/base.odex (offset 0x51a000) (void org.gearvrf.physics.GVRWorld.onDrawFrame(float)+120)
03-21 10:04:26.962  3152  3152 F DEBUG   :     #10 pc 00ba62d9  /data/app/org.gearvrf.gvrsimlephysics-1/oat/arm/base.odex (offset 0x51a000) (long org.gearvrf.GVRViewManager.doMemoryManagementAndPerFrameCallbacks()+956)
03-21 10:04:26.962  3152  3152 F DEBUG   :     #11 pc 00ba5bad  /data/app/org.gearvrf.gvrsimlephysics-1/oat/arm/base.odex (offset 0x51a000) (long org.gearvrf.GVRViewManager.access$600(org.gearvrf.GVRViewManager)+56)
03-21 10:04:26.962  3152  3152 F DEBUG   :     #12 pc 00a63fc5  /data/app/org.gearvrf.gvrsimlephysics-1/oat/arm/base.odex (offset 0x51a000) (void org.gearvrf.GVRViewManager$3.beforeDrawEyes()+136)
03-21 10:04:26.962  3152  3152 F DEBUG   :     #13 pc 00ba6c5f  /data/app/org.gearvrf.gvrsimlephysics-1/oat/arm/base.odex (offset 0x51a000) (void org.gearvrf.GVRViewManager.beforeDrawEyes()+114)
03-21 10:04:26.962  3152  3152 F DEBUG   :     #14 pc 00bfeff9  /data/app/org.gearvrf.gvrsimlephysics-1/oat/arm/base.odex (offset 0x51a000) (void org.gearvrf.OvrViewManager.beforeDrawEyes()+252)
03-21 10:04:26.962  3152  3152 F DEBUG   :     #15 pc 00bff94d  /data/app/org.gearvrf.gvrsimlephysics-1/oat/arm/base.odex (offset 0x51a000) (void org.gearvrf.OvrViewManager.onDrawFrame()+48)
03-21 10:04:26.962  3152  3152 F DEBUG   :     #16 pc 0066b6ad  /data/app/org.gearvrf.gvrsimlephysics-1/oat/arm/base.odex (offset 0x51a000) (void org.gearvrf.OvrVrapiActivityHandler$7.onDrawFrame(javax.microedition.khronos.opengles.GL10)+120)
03-21 10:04:26.962  3152  3152 F DEBUG   :     #17 pc 03f1e387  /system/framework/arm/boot.oat (offset 0x3004000)
03-21 10:04:27.882  3152  3152 F DEBUG   : 
03-21 10:04:27.882  3152  3152 F DEBUG   : Tombstone written to: /data/tombstones/tombstone_00
03-21 10:04:27.882  3152  3152 E DEBUG   : AM write failed: Broken pipe
liaxim commented 7 years ago

One crash launch time:

03-21 10:21:06.972  3152  3152 F DEBUG   : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
03-21 10:21:06.972  3152  3152 F DEBUG   : Build fingerprint: 'samsung/noblelteuc/noblelteatt:6.0.1/MMB29K/N920AUCS4CQB2:user/release-keys'
03-21 10:21:06.972  3152  3152 F DEBUG   : Revision: '9'
03-21 10:21:06.972  3152  3152 F DEBUG   : ABI: 'arm'
03-21 10:21:06.972  3152  3152 F DEBUG   : pid: 29035, tid: 29110, name: gvrf-8  >>> org.gearvrf.gvrsimlephysics <<<
03-21 10:21:06.972  3152  3152 F DEBUG   : signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
03-21 10:21:07.002  3152  3152 F DEBUG   : Abort message: 'Pure virtual function called!'
03-21 10:21:07.002  3152  3152 F DEBUG   :     r0 00000000  r1 000071b6  r2 00000006  r3 d24e4978
03-21 10:21:07.002  3152  3152 F DEBUG   :     r4 d24e4980  r5 d24e4930  r6 00000016  r7 0000010c
03-21 10:21:07.002  3152  3152 F DEBUG   :     r8 d5953544  r9 eec8dbdf  sl 49444154  fp 00000000
03-21 10:21:07.002  3152  3152 F DEBUG   :     ip 00000006  sp d24e3488  lr f734f37d  pc f735176c  cpsr 40000010
03-21 10:21:07.032  3152  3152 F DEBUG   : 
03-21 10:21:07.032  3152  3152 F DEBUG   : backtrace:
03-21 10:21:07.032  3152  3152 F DEBUG   :     #00 pc 0004276c  /system/lib/libc.so (tgkill+12)
03-21 10:21:07.032  3152  3152 F DEBUG   :     #01 pc 00040379  /system/lib/libc.so (pthread_kill+32)
03-21 10:21:07.032  3152  3152 F DEBUG   :     #02 pc 0001ca9b  /system/lib/libc.so (raise+10)
03-21 10:21:07.032  3152  3152 F DEBUG   :     #03 pc 00019d19  /system/lib/libc.so (__libc_android_abort+34)
03-21 10:21:07.032  3152  3152 F DEBUG   :     #04 pc 0001755c  /system/lib/libc.so (abort+4)
03-21 10:21:07.032  3152  3152 F DEBUG   :     #05 pc 00032a91  /system/lib/libc++.so
03-21 10:21:07.032  3152  3152 F DEBUG   :     #06 pc 000494cd  /system/lib/libc++.so (__cxa_pure_virtual+12)
03-21 10:21:07.032  3152  3152 F DEBUG   :     #07 pc 0009ddc9  /system/lib/libandroid_runtime.so (_ZN7android18AssetStreamAdaptor4readEPvj+104)
03-21 10:21:07.032  3152  3152 F DEBUG   :     #08 pc 00185af5  /system/lib/libskia.so
03-21 10:21:07.032  3152  3152 F DEBUG   :     #09 pc 00010bbb  /system/lib/libpng.so (png_read_data+18)
03-21 10:21:07.032  3152  3152 F DEBUG   :     #10 pc 00014a77  /system/lib/libpng.so (png_crc_read+18)
03-21 10:21:07.032  3152  3152 F DEBUG   :     #11 pc 00017af7  /system/lib/libpng.so (png_read_IDAT_data+154)
03-21 10:21:07.032  3152  3152 F DEBUG   :     #12 pc 0000d725  /system/lib/libpng.so (png_read_row+312)
03-21 10:21:07.032  3152  3152 F DEBUG   :     #13 pc 0000d93f  /system/lib/libpng.so (png_read_rows+54)
03-21 10:21:07.032  3152  3152 F DEBUG   :     #14 pc 0018686f  /system/lib/libskia.so (_ZN17SkPNGImageDecoder8onDecodeEP8SkStreamP8SkBitmapN14SkImageDecoder4ModeE+650)
03-21 10:21:07.032  3152  3152 F DEBUG   :     #15 pc 001829a7  /system/lib/libskia.so (_ZN14SkImageDecoder6decodeEP8SkStreamP8SkBitmap11SkColorTypeNS_4ModeE+38)
03-21 10:21:07.032  3152  3152 F DEBUG   :     #16 pc 00094793  /system/lib/libandroid_runtime.so
03-21 10:21:07.032  3152  3152 F DEBUG   :     #17 pc 00094cc7  /system/lib/libandroid_runtime.so
03-21 10:21:07.032  3152  3152 F DEBUG   :     #18 pc 0342f61b  /system/framework/arm/boot.oat (offset 0x3004000)
liaxim commented 7 years ago

It is all very random though. We might have to get everybody to hammer on this app to make it more robust for the demo.

liaxim commented 7 years ago

@rahul27 Do you have a branch we can test?

rahul27 commented 7 years ago

Think @NolaDonato is already looking at this. In any case here is the branch:

https://github.com/rahul27/GearVRf-Demos/tree/modified-physics

liaxim commented 7 years ago

Are you seeing the crashes with the controller or they happen with the trackpad too?

rahul27 commented 7 years ago

I've only tried with the controller. Not sure about the trackpad.

thomasflynn commented 7 years ago

@NolaDonato was saying last night that it seemed like it had something to do with shadows. If she disabled shadows, everything worked fine. but, it could be that it just changed the timing so it was less likely to occur.

liaxim commented 7 years ago

I guess a workaround for the demo would be to put MainScript.onSwipe on the GL thread (currently on the main android thread); based on my experience with crashes related to fast swiping.

liaxim commented 7 years ago

@rahul27 's version requires a controller a presume. If we have spare ones we can test it but for now only the one from master can be tested.

liaxim commented 7 years ago

I can consistently get the crash in NativePhysics3DWorld.step by launching 10 balls on a swipe; each as a separate task submitted to the thread pool. Diff attached. diff.txt

@rahul27 's crashes though are something else.

NolaDonato commented 7 years ago

The crash on startup in Light::render is definitely due to shadows. I cannot reproduce it without shadows and I have a potential fix. I will try the 10 balls version without shadows and see what happens.