googlevr / gvr-unity-sdk

Google VR SDK for Unity
http://developers.google.com/vr/unity/
Other
2.71k stars 1.09k forks source link

crash after launch: Fatal signal 11 (SIGSEGV) at 0x00000000 (code=1) #49

Closed ro4tub closed 8 years ago

ro4tub commented 9 years ago

Phone: Samsung S4(GT-i9502) Android: 4.2.2 Unity: 4.6.5 App: DemoScene in cardboard-unity(on master branch)

Logcat:

07-14 21:12:39.536 1477-1558/com.oscar.FirstVR D/Unity﹕ Platform assembly: /mnt/asec/com.oscar.FirstVR-2/pkg.apk/assets/bin/Data/Managed/System.Core.dll (this message is harmless) 07-14 21:12:39.616 1477-1558/com.oscar.FirstVR D/Unity﹕ Platform assembly: /mnt/asec/com.oscar.FirstVR-2/pkg.apk/assets/bin/Data/Managed/System.dll (this message is harmless) 07-14 21:12:40.301 1477-1502/com.oscar.FirstVR D/dalvikvm﹕ Trying to load lib /mnt/asec/com.oscar.FirstVR-2/lib/libvrunity.so 0x42ba58a0 07-14 21:12:40.446 1477-1502/com.oscar.FirstVR D/dalvikvm﹕ Added shared lib /mnt/asec/com.oscar.FirstVR-2/lib/libvrunity.so 0x42ba58a0 07-14 21:12:40.446 1477-1502/com.oscar.FirstVR D/dalvikvm﹕ Trying to load lib /mnt/asec/com.oscar.FirstVR-2/lib/libvrunity.so 0x42ba58a0 07-14 21:12:40.446 1477-1502/com.oscar.FirstVR D/dalvikvm﹕ Shared lib '/mnt/asec/com.oscar.FirstVR-2/lib/libvrunity.so' already loaded in same CL 0x42ba58a0 07-14 21:12:40.461 1477-1502/com.oscar.FirstVR A/libc﹕ Fatal signal 11 (SIGSEGV) at 0x00000000 (code=1), thread 1502 (UnityMain) 07-14 21:12:40.516 2434-2434/? I/DEBUG﹕ pid: 1477, tid: 1502, name: UnityMain >>> com.oscar.FirstVR <<< 07-14 21:12:41.261 2434-2434/? I/DEBUG﹕ #01 pc 00173983 /mnt/asec/com.oscar.FirstVR-2/lib/libvrunity.so (gvr::PlatformInfo::PlatformInfo()+626) 07-14 21:12:41.261 2434-2434/? I/DEBUG﹕ #02 pc 0004bd6b /mnt/asec/com.oscar.FirstVR-2/lib/libvrunity.so (Start+102) 07-14 21:12:41.261 2434-2434/? I/DEBUG﹕ 753912bc 79728368 /mnt/asec/com.oscar.FirstVR-2/lib/libvrunity.so 07-14 21:12:41.261 2434-2434/? I/DEBUG﹕ 753912c4 797866a0 /mnt/asec/com.oscar.FirstVR-2/lib/libvrunity.so 07-14 21:12:41.261 2434-2434/? I/DEBUG﹕ 75391304 796d8985 /mnt/asec/com.oscar.FirstVR-2/lib/libvrunity.so (gvr::PlatformInfo::PlatformInfo()+628) 07-14 21:12:41.261 2434-2434/? I/DEBUG﹕ 7539130c 7407a3b8 /mnt/asec/com.oscar.FirstVR-2/lib/libmono.so (lookup_generic_method+32) 07-14 21:12:41.261 2434-2434/? I/DEBUG﹕ 75391320 79784b30 /mnt/asec/com.oscar.FirstVR-2/lib/libvrunity.so 07-14 21:12:41.266 2434-2434/? I/DEBUG﹕ 75391324 7977fd50 /mnt/asec/com.oscar.FirstVR-2/lib/libvrunity.so 07-14 21:12:41.266 2434-2434/? I/DEBUG﹕ 75391328 79780038 /mnt/asec/com.oscar.FirstVR-2/lib/libvrunity.so 07-14 21:12:41.266 2434-2434/? I/DEBUG﹕ 7539132c 79784ab0 /mnt/asec/com.oscar.FirstVR-2/lib/libvrunity.so 07-14 21:12:41.266 2434-2434/? I/DEBUG﹕ 75391330 7977ffc8 /mnt/asec/com.oscar.FirstVR-2/lib/libvrunity.so 07-14 21:12:41.266 2434-2434/? I/DEBUG﹕ 75391334 7977ffb4 /mnt/asec/com.oscar.FirstVR-2/lib/libvrunity.so 07-14 21:12:41.266 2434-2434/? I/DEBUG﹕ 7539133c 7407a574 /mnt/asec/com.oscar.FirstVR-2/lib/libmono.so (lookup_method+292) 07-14 21:12:51.291 2934-2945/? I/ActivityManager﹕ Process com.oscar.FirstVR (pid 1477) (adj 0) has died. 07-14 21:12:51.301 2934-2945/? W/ActivityManager﹕ Force removing ActivityRecord{42d94818 u0 com.oscar.FirstVR/com.google.unity.GoogleUnityActivity}: app died, no saved state 07-14 21:12:51.481 2934-3014/? V/SmartFaceService - 3rd party pause﹕ onReceive [android.intent.action.ACTIVITY_STATE/com.oscar.FirstVR/pause]

smdol commented 9 years ago

That bug will be fixed in an upcoming release. Thanks for reporting!

aviomaksim commented 9 years ago

Thank you. Problem is solved at v0.5.1. :+1:

bmasala commented 8 years ago

Also experiencing the same crash when pulling the logcat. It happens when I rotate my phone from landscape to portrait (this exits the VR mode and loads a new level). The odd thing is, I can't replicate it very easily - at times it crashes on rotate...other times it rotates out of VR mode just fine.

LG G3 working on Android 5.0 Unity 5.2 and Cardboard 0.5.2

12-08 22:36:47.523 27554-27573/? I/Unity: (Filename: ./artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 64) 12-08 22:36:49.772 27554-27573/? A/libc: Fatal signal 11 (SIGSEGV), code 1, fault addr 0x98c3fff0 in tid 27573 (UnityMain) 12-08 22:36:49.833 964-1271/? W/InputDispatcher: channel '116783be com.Tourly.andapp12/com.google.unity.GoogleUnityActivity (server)' ~ Consumer closed input channel or an error occurred. events=0x9 12-08 22:36:49.833 964-1271/? E/InputDispatcher: channel '116783be com.Tourly.andapp12/com.google.unity.GoogleUnityActivity (server)' ~ Channel is unrecoverably broken and will be disposed! 12-08 22:36:49.834 964-981/? I/WindowState: WIN DEATH: Window{116783be u0 com.Tourly.andapp12/com.google.unity.GoogleUnityActivity} 12-08 22:36:49.836 964-981/? W/InputDispatcher: Attempted to unregister already unregistered input channel '116783be com.Tourly.andapp12/com.google.unity.GoogleUnityActivity (server)' 12-08 22:36:49.836 964-981/? W/WindowManager: Force-removing child win Window{14e06b3b u0 SurfaceView} from container Window{116783be u0 com.Tourly.andapp12/com.google.unity.GoogleUnityActivity} 12-08 22:36:49.847 964-981/? D/InputDispatcher: Focus left window: Window{116783be u0 com.Tourly.andapp12/com.google.unity.GoogleUnityActivity} 12-08 22:36:49.847 964-981/? D/InputDispatcher: Window went away: Window{116783be u0 com.Tourly.andapp12/com.google.unity.GoogleUnityActivity} 12-08 22:36:49.902 964-1971/? W/ActivityManager: Force removing ActivityRecord{20c3a2d3 u0 com.Tourly.andapp12/com.google.unity.GoogleUnityActivity t399}: app died, no saved state 12-08 22:36:49.904 2016-2872/? D/SplitWindowPolicy: topRunningActivity=ActivityInfo{3e6cff9a co.....GoogleUnityActivity}, taskId=399, activityType=0, bIsSplit=false 12-08 22:36:49.996 964-1036/? I/WindowManager: Screen frozen for +84ms due to Window{116783be u0 com.Tourly.andapp12/com.google.unity.GoogleUnityActivity}

ZXLiverpool10 commented 8 years ago

yes,me too! With the upstairs

smdol commented 8 years ago

Are you using the OnTilt event to register a handler? If so, try switching to using

if (Cardboard.SDK.Tilted) ....

in an Update() function.

(We have found an issue with unregistering C# event handlers on Cardboard.SDK during app quit or level loading.)

bmasala commented 8 years ago

Just tried that, crash frequency increases for some reason.

ZXLiverpool10 commented 8 years ago

I try to switch the android minimum api level from 4.4 to 5.0. the crash case is no longer appear

bmasala commented 8 years ago

^Tried raising to 5.0 - unfortunately problem persists.

smdol commented 8 years ago

Would it be possible to get a stripped down test case project that reproduces the problem?

dill0wn commented 8 years ago

We're having a similar problem on our end on both iOS and Android. I also tried raising to 5.0 and unfortunately the problem persists for us as well.

Our project has one main scene that uses the new Multi Scene Editing features of Unity 5.3 to load and unload scenes additively. This means cardboard's pieces are never created, destroyed, or changed much because they all live in that main scene.

That main scene loads other scenes that request to be in either the "landscape with VR ON" or "portrait with VR OFF" state. And the main scene does some transition bits to make that happen.

Our crashes are occurring after going back and forth between portrait vr-disabled / landscape vr-enabled three or four times. The meat of these transitions happen in a coroutine that essentially just set the Screen.orientation, and Cardboard.SDK.VRModeEnabled, with a yield return new WaitForEndOfFrame(); in between those two operations (We make sure when going to portrait to disable vrmode before the orientation change, and when going to landscape we change orientation before enabling vrmode).

Here's an Android crashlog of what we're seeing. This is from a Samsung Galaxy S4 running Android 5.0.1, and built using Unity 5.3.0f4.

D/CrashAnrDetector( 3186): Build: samsung/ja3gxx/ja3g:5.0.1/LRX22C/I9500XXUHOH7:user/release-keys
D/CrashAnrDetector( 3186): Hardware: universal5410
D/CrashAnrDetector( 3186): Revision: 10
D/CrashAnrDetector( 3186): Bootloader: I9500XXUHOH7
D/CrashAnrDetector( 3186): Radio: unknown
D/CrashAnrDetector( 3186): Kernel: Linux version 3.4.5-5680973 (dpi@SWHD7415) (gcc version 4.8 (GCC) ) #1 SMP PREEMPT Wed Aug 26 16:40:35 KST 2015
D/CrashAnrDetector( 3186): 
D/CrashAnrDetector( 3186): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
D/CrashAnrDetector( 3186): Build fingerprint: 'samsung/ja3gxx/ja3g:5.0.1/LRX22C/I9500XXUHOH7:user/release-keys'
D/CrashAnrDetector( 3186): Revision: '10'
D/CrashAnrDetector( 3186): ABI: 'arm'
D/CrashAnrDetector( 3186): pid: 9472, tid: 9491, name: UnityMain  >>> com.yeticgi.vmtech.proto01 <<<
D/CrashAnrDetector( 3186): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x4
D/CrashAnrDetector( 3186):     r0 00000000  r1 98209250  r2 00000004  r3 00000000
D/CrashAnrDetector( 3186):     r4 00000000  r5 98209250  r6 00000001  r7 00000001
D/CrashAnrDetector( 3186):     r8 00000000  r9 00000000  sl 98209257  fp 00000013
D/CrashAnrDetector( 3186):     ip 00000001  sp b3800930  lr 9ae4519c  pc a0d5f6bc  cpsr 800f0010
D/CrashAnrDetector( 3186):     d0  ff80000000000000  d1  0000000000000000
D/CrashAnrDetector( 3186):     d2  400000007f800000  d3  000000007f800000
D/CrashAnrDetector( 3186):     d4  3f7b85df7f800000  d5  000000007f800000
D/CrashAnrDetector( 3186):     d6  bd28f6a0ff800000  d7  3f800000ff800000
D/CrashAnrDetector( 3186):     d8  000000003f800000  d9  00000000bf800000
D/CrashAnrDetector( 3186):     d10 0000000000000000  d11 0000000000000000
D/CrashAnrDetector( 3186):     d12 0000000000000000  d13 0000000000000000
D/CrashAnrDetector( 3186):     d14 0000000000000000  d15 0000000000000000
D/CrashAnrDetector( 3186):     d16 bc4b3f233d8a7434  d17 000000003e3576f3
D/CrashAnrDetector( 3186):     d18 3e256806bdb6ea60  d19 000000003d39e048
D/CrashAnrDetector( 3186):     d20 bdcb97cfbe1d3ef0  d21 000000003d537270
D/CrashAnrDetector( 3186):     d22 c2493438c2a19460  d23 3f80000041d9463e
D/CrashAnrDetector( 3186):     d24 3ea41c253e809ae6  d25 bf72c442bf72ca79
D/CrashAnrDetector( 3186):     d26 3d12539abf70e169  d27 be845f2ebe846292
D/CrashAnrDetector( 3186):     d28 3fd9d343bce1c032  d29 3e3c755c3e3c7a2f
D/CrashAnrDetector( 3186):     d30 bd92539a3ff0e169  d31 3f045f2e3ed59149
D/CrashAnrDetector( 3186):     scr 6000001b
D/CrashAnrDetector( 3186): 
D/CrashAnrDetector( 3186): backtrace:
D/CrashAnrDetector( 3186):     #00 pc 004e76bc  /data/app/com.yeticgi.vmtech.proto01-1/lib/arm/libunity.so (SetVertexStateGLES(ChannelAssigns const&, VertexDeclarationGLES*, VertexStreamSource const*, unsigned int, unsigned int, unsigned int)+380)
D/CrashAnrDetector( 3186):     #01 pc 004e7290  /data/app/com.yeticgi.vmtech.proto01-1/lib/arm/libunity.so (GfxDeviceGLES::DrawBuffers(GfxBuffer*, VertexStreamSource const*, int, DrawBuffersRange const*, int, VertexDeclaration*, ChannelAssigns const&)+152)
D/CrashAnrDetector( 3186):     #02 pc 0012aa10  /data/app/com.yeticgi.vmtech.proto01-1/lib/arm/libunity.so (CanvasBatchIntermediateRenderer::Render(int, ChannelAssigns const&)+156)
D/CrashAnrDetector( 3186):     #03 pc 00177444  /data/app/com.yeticgi.vmtech.proto01-1/lib/arm/libunity.so (BatchRenderer::Add(BaseRenderer&, TransformInfo const&, int, ChannelAssigns const*)+320)
D/CrashAnrDetector( 3186):     #04 pc 0017e338  /data/app/com.yeticgi.vmtech.proto01-1/lib/arm/libunity.so (ForwardShaderRenderLoop::PerformRendering(JobFence&, ActiveLight const*, ShadowCullData const&, bool, bool, bool, int)+3008)
D/CrashAnrDetector( 3186):     #05 pc 0017f8b0  /data/app/com.yeticgi.vmtech.proto01-1/lib/arm/libunity.so (DoForwardShaderRenderLoop(RenderLoopContext&, dynamic_array<RenderObjectData, 4u>&, bool, bool, ActiveLights&, bool, int)+3336)
D/CrashAnrDetector( 3186):     #06 pc 00183e10  /data/app/com.yeticgi.vmtech.proto01-1/lib/arm/libunity.so (DoRenderLoop(RenderLoop&, RenderingPath, CullResults&, ShadowMapCache&, bool)+1560)
D/CrashAnrDetector( 3186):     #07 pc 00119e30  /data/app/com.yeticgi.vmtech.proto01-1/lib/arm/libunity.so (Camera::DoRender(CullResults&, void (*)(Camera&, RenderLoop&, CullResults&), int)+324)
D/CrashAnrDetector( 3186):     #08 pc 0011c8dc  /data/app/com.yeticgi.vmtech.proto01-1/lib/arm/libunity.so (Camera::Render(CullResults&, ShaderPassContext&, CameraRenderingParams const*, int)+732)
D/CrashAnrDetector( 3186):     #09 pc 00139094  /data/app/com.yeticgi.vmtech.proto01-1/lib/arm/libunity.so (RenderManager::RenderCameras(int)+508)
D/CrashAnrDetector( 3186):     #10 pc 003a6e70  /data/app/com.yeticgi.vmtech.proto01-1/lib/arm/libunity.so (PlayerRender(bool)+344)
D/CrashAnrDetector( 3186):     #11 pc 003a82a4  /data/app/com.yeticgi.vmtech.proto01-1/lib/arm/libunity.so (PlayerLoop(bool, bool, IHookEvent*)+4156)
D/CrashAnrDetector( 3186):     #12 pc 00513b2c  /data/app/com.yeticgi.vmtech.proto01-1/lib/arm/libunity.so (UnityPlayerLoop()+700)
D/CrashAnrDetector( 3186):     #13 pc 005192c8  /data/app/com.yeticgi.vmtech.proto01-1/lib/arm/libunity.so (nativeRender(_JNIEnv*, _jobject*)+264)
D/CrashAnrDetector( 3186):     #14 pc 00035723  /data/dalvik-cache/arm/data@app@com.yeticgi.vmtech.proto01-1@base.apk@classes.dex
D/CrashAnrDetector( 3186): 
D/CrashAnrDetector( 3186): stack:
D/CrashAnrDetector( 3186):          b38008b0  a0d57730  /data/app/com.yeticgi.vmtech.proto01-1/lib/arm/libunity.so (
D/CrashAnrDetector( 3186): processName:com.yeticgi.vmtech.proto01
bmasala commented 8 years ago

After some testing I've managed to limit the crashes from SigSegv by loading the cardboard object at the beginning and disabling VR mode as well as disabling the camera associated with the Cardboard Main. Basically keeping the thing alive stops it from crashing.

I am however running into the same problem when I Pause the app and restart it (press home button and come back).

The crash frequency is much lower but it's still happening and spits out the same LogCat....

I've tried to Application.Pause when the app isn't running in the foreground which seems to help a bit but not 100%

Any thoughts here?

smdol commented 8 years ago

If you are seeing the crash from rotating the phone and later pausing/quitting/loading, yes, we have traced down the crash to the event handler in the native code that looks for this rotation to occur (it's called a "Tilt" event). Exact cause is not determined, but it is definitely related to that particular event handler. It's in the native code layer, so there's no easy workaround at the Unity level.

nathanmartz commented 8 years ago

This should be fixed in the 0.6.0 SDK. Please reopen if not.