Can you guys help me figure out the following crash?
01-30 14:56:38.886 29251 29370 F libc : Fatal signal 11 (SIGSEGV), code 2, fault addr 0xc1ef4848 in tid 29370 (Thread-49)
01-30 14:56:39.080 29500 29500 F DEBUG : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
01-30 14:56:39.081 29500 29500 F DEBUG : Build fingerprint: 'google/sailfish/sailfish:7.1.1/NMF26O/3514931:user/release-keys'
01-30 14:56:39.081 29500 29500 F DEBUG : Revision: '0'
01-30 14:56:39.081 29500 29500 F DEBUG : ABI: 'arm'
01-30 14:56:39.081 29500 29500 F DEBUG : pid: 29251, tid: 29370, name: Thread-49 >>> com.*** <<<
01-30 14:56:39.081 29500 29500 F DEBUG : signal 11 (SIGSEGV), code 2 (SEGV_ACCERR), fault addr 0xc1ef4848
01-30 14:56:39.081 29500 29500 F DEBUG : r0 c60152e0 r1 00000000 r2 80000000 r3 c1ef4848
01-30 14:56:39.081 29500 29500 F DEBUG : r4 b54a6280 r5 ebdb2008 r6 c7612990 r7 00672c90
01-30 14:56:39.081 29500 29500 F DEBUG : r8 ea5bacd0 r9 000027b5 sl cb372cd0 fp ccdc9c40
01-30 14:56:39.081 29500 29500 F DEBUG : ip eb74c3b0 sp ca4f0318 lr c1e186e3 pc c1ef4848 cpsr 80000010
01-30 14:56:39.088 29500 29500 F DEBUG :
01-30 14:56:39.088 29500 29500 F DEBUG : backtrace:
01-30 14:56:39.088 29500 29500 F DEBUG : #00 pc 00001848 /data/app/com.***/lib/arm/libgvr.so (offset 0xf5000)
01-30 14:56:39.088 29500 29500 F DEBUG : #01 pc 0001b6e1 /data/app/com.***/lib/arm/libgvr.so (gvr_frame_unbind+108)
01-30 14:56:39.089 29500 29500 F DEBUG : #02 pc 0081cde0 /data/app/com.***/lib/arm/libunity.so
01-30 14:56:39.089 29500 29500 F DEBUG : #03 pc 00817d5c /data/app/com.***/lib/arm/libunity.so
01-30 14:56:39.089 29500 29500 F DEBUG : #04 pc 004cfca0 /data/app/com.***/lib/arm/libunity.so
01-30 14:56:39.089 29500 29500 F DEBUG : #05 pc 004d0ae0 /data/app/com.***/lib/arm/libunity.so
01-30 14:56:39.089 29500 29500 F DEBUG : #06 pc 004cb30c /data/app/com.***/lib/arm/libunity.so
01-30 14:56:39.089 29500 29500 F DEBUG : #07 pc 0046d4a4 /data/app/com.***/lib/arm/libunity.so
01-30 14:56:39.089 29500 29500 F DEBUG : #08 pc 00047003 /system/lib/libc.so (_ZL15__pthread_startPv+22)
01-30 14:56:39.089 29500 29500 F DEBUG : #09 pc 00019bdd /system/lib/libc.so (__start_thread+6)
01-30 14:57:17.734 29625 29738 F libc : Fatal signal 11 (SIGSEGV), code 2, fault addr 0xc21a6848 in tid 29738 (Thread-48)
Hi,
Which version of Unity are you running and which device are you running it in?
@martinbilello
I am using Unity5.4.2f2-Gvr13 and running the app on Pixel phone.
This crash happens when enabling UnityEngine.VR.VRSettings.enabled while transitioning to a new scene using LoadLevelAdditiveAsync and only on a fresh install.
btw, I see a few GL erros right before the crash.
2-02 12:21:19.949 6600 6718 E Unity : OPENGL NATIVE PLUG-IN ERROR: GL_INVALID_FRAMEBUFFER_OPERATION: Framebuffer is not complete or incompatible with command
02-02 12:21:19.949 6600 6718 E Unity :
02-02 12:21:19.949 6600 6718 E Unity : (Filename: ./Runtime/GfxDevice/opengles/GfxDeviceGLES.cpp Line: 265)
02-02 12:21:19.949 6600 6718 E Unity :
02-02 12:21:19.950 6600 6718 E Unity : OPENGL NATIVE PLUG-IN ERROR: GL_INVALID_FRAMEBUFFER_OPERATION: Framebuffer is not complete or incompatible with command
02-02 12:21:19.950 6600 6718 E Unity :
02-02 12:21:19.950 6600 6718 E Unity : (Filename: ./Runtime/GfxDevice/opengles/GfxDeviceGLES.cpp Line: 265)
02-02 12:21:19.950 6600 6718 E Unity :
02-02 12:21:19.950 6600 6718 E Unity : OPENGL NATIVE PLUG-IN ERROR: GL_INVALID_FRAMEBUFFER_OPERATION: Framebuffer is not complete or incompatible with command
02-02 12:21:19.950 6600 6718 E Unity :
02-02 12:21:19.950 6600 6718 E Unity : (Filename: ./Runtime/GfxDevice/opengles/GfxDeviceGLES.cpp Line: 265)
Is there a file Assets/Plugins/Android/AndroidManifest? If so, you can delete it if you don't use any dangerous permissions in your app. That may resolve your crash.
@miraleung the only dangerous permission that I am using is
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
which as far as I know is required for cardboard to be able to read viewer profile?
@miraleung that didn't solve the problem. thanks for help though. any other ideas?
I was able to prevent the crash by delaying the load device for a few frames. I started by delaying for a few seconds then narrowed down to a few frames. I didn't measure exactly how many since it was sufficient for us.
We see this crash for Unity 5.6.0b9-10-11 and Google SDK 1.20 and 1.30. b9-10 and 1.20 was Android 7 specific (Google Pixel) but b11 and 1.30 was also crashing on Android 6 (Samsung S7).
Eventually I used WaitForSeconds because single frame delay is unable to return back to portrait UI. This time it doesn't crash either way, but when switching back to 2D it stucks with split screen rotated 90 degrees to portrait mode, displaying my 2D UI.
So the solution was something like:
void Start() {
StartCoroutine(LoadDevice("cardboard"));
}
IEnumerator LoadDevice(string newDevice)
{
yield return null; // repeat this a few more times or use yield return new WaitForSeconds(1f);
VRSettings.LoadDeviceByName(newDevice);
yield return null;
VRSettings.enabled = true;
}
crash log is:
Finishing drawing window Window{3cba25c u0 d0 com.Test.Test/com.unity3d.player.UnityPlayerActivity}: mDrawState=DRAW_PENDING
Timeline: Activity_windows_visible id: ActivityRecord{422a918 u0 com.Test.Test/com.unity3d.player.UnityPlayerActivity t4140} time:6680603
Screen frozen for +207ms due to Window{3cba25c u0 d0 com.Test.Test/com.unity3d.player.UnityPlayerActivity}
[EGL] Failed to create window surface: EGL_BAD_ALLOC: EGL failed to allocate resources for the requested operation.
Skipped rendering frame because GfxDevice is in invalid state (device lost)
OPENGL NATIVE PLUG-IN ERROR: GL_INVALID_OPERATION: Operation illegal in current state
(Filename: ./Runtime/GfxDevice/opengles/GfxDeviceGLES.cpp Line: 365)
OPENGL NATIVE PLUG-IN ERROR: GL_INVALID_VALUE: Numeric argument out of range
(Filename: ./Runtime/GfxDevice/opengles/GfxDeviceGLES.cpp Line: 365)
Force finishing activity com.Test.Test/com.unity3d.player.UnityPlayerActivity
WIN DEATH: Window{3cba25c u0 d0 com.Test.Test/com.unity3d.player.UnityPlayerActivity}
The process of this window already died: Window{3cba25c u0 d0 com.Test.Test/com.unity3d.player.UnityPlayerActivity} : android.os.DeadObjectException
Failed to report 'resized' to the client of Window{3cba25c u0 d0 com.Test.Test/com.unity3d.player.UnityPlayerActivity}, removing this window.
dispatchOnViewCreated > Target : com.unity3d.player.UnityPlayerActivity isFragment :false
Could it be that yeild return null is subtly different from yield return WaitForNextFrame()?
https://github.com/googlevr/gvr-unity-sdk/issues/492#issuecomment-285752385
Have you been able to fix this problem? Was yield return WaitForNextFrame() instead of yield return null helpful?
After reading https://docs.unity3d.com/Manual/ExecutionOrder.html more closely, and after some testing, it seems that the https://docs.unity3d.com/ScriptReference/VR.VRSettings.LoadDeviceByName.html documentation is correct: use yield return null after invoking VRSettings.LoadDeviceByName(...) to wait until the next frame.
Using yield return new WaitForEndOfFrame() is not the right thing to do as it returns control at the end of the current frame, which is too soon.
@Baptistegrv To be more specific our problem is only when calling this at Start(). Delaying everything by at least a frame by using yield return null before VRSettings.LoadDeviceByName(newDevice); resolves our problem.
For the yield statement after VRSettings.LoadDeviceByName(newDevice);, weird but starting with some version of Unity 5.60fx I had to separate VR and None cases. So current working code called from Start() looks like:
IEnumerator LoadDevice(string newDevice)
{
if (newDevice != "None")
{
yield return new WaitForSeconds(initialSceneDelayTime);
}
VRSettings.LoadDeviceByName(newDevice);
if (newDevice == "None")
{
yield return new WaitForEndOfFrame();
}
else
{
yield return null;
}
if (newDevice == "None")
{
VRSettings.enabled = false;
}
else
{
VRSettings.enabled = true;
}
if (newDevice == "None")
{
SceneManager.LoadScene("MainMenu");
}
}
(By the way, for the "after" case I like the approach of checking if the device is ready but I believe that kind of stuff shouldn't be necessary and taken care of internally.)
Just to close this thread out, I ported our app to Unity 5.6.0f3 today, and the bug is fixed. the app is working as expected.
I'm running 5.6.0f3 and still having the issue :/ Running Unity 5.6.0f3 and GVR 1.4
We were having the same issue with 5.6.0f3 and the problem was the Vulkan API being present. Removing it fixed the crash.
Removing Vulkan API also fixed the issue for me. 5.6.0f3 with GVR 1.4 on Android 7.1.2 (Pixel). Did not have the issue on a Galaxy S6 running Android 5.1.1 or Moto X running Android 6.0.
**Edit: I spoke too soon, the error persists even without Vulkan API so I believe this issue should be reopened. The issue is intermittent for me and I haven't isolated the exact conditions needed to reproduce it. It's occurring more often than not right now.
I'm going to try the suggestion from guneyozsan.**
5.6.0f3 tried everything here but switching on and off cardboard in combination with resetting the ScreenOrientation in order to fix the weird camera angle after returning from Cardboard is extremely buggy. It crashes every few switches. Any other suggestions to really fix this issue would be greatly appreciated.
Could you please file a bug within Unity, and reply with the case ID?
I have the same issue as you, @Fragilem17 , do you happen to have a solution ?
I have the same issue. Disabling and then enabling VR with cardboard SDK causes sporadic crashes. Please resolve this issue.
I'm having some success by just never doing a loadDeviceByName after the first one. Just toggling the VR settings.enabled and leaving the device to cardboard so it's either in MagicWindow or cardboard mode. works more reliable. However it eats battery and the phone becomes hot even when not in cardboard. I guess all the sensors are working for the rotation at full speed.
*EDIT: I am using loadDeviceByName twice as I want to have non-VR in one scene and VR in another. If i load "cardboard" and change the VR.Settings to false, its not coming out of VR mode. So have to load "" once, change VR.Settings to false for non-VR mode and then load "cardboard", change VR.Settings to true for VR mode, which is causing crashes. @Fragilem17
Was trying to find the smallest set of files in order to file a bug report
but it's not crashing for the moment here. If you do have a filed bugreport
I'll be happy to vote on it.
On Fri, May 19, 2017, 22:16 Dhawal notifications@github.com wrote:
What I am doing is disabling VR in one scene and enabling it in another. I
use loadDeviceByName once only. Still there are crashes. Getting the OPENGL
NATIVE PLUG-IN ERROR in logs.—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/googlevr/gvr-unity-sdk/issues/453#issuecomment-302801027,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AEKQGuLr2bp_2O82GPP8WvW4yiZM9c7Dks5r7fiagaJpZM4L1jrB
.
Hi, I can assure that Unity version 5.6.1p1 (patch release) fixes the OPENGL NATIVE PLUG-IN ERROR and hence fixes the crash. I have tested it and I am getting no crash at all. Thanks.
Thanks for the update.
Hello,
We may have a different issue there but we are still getting crashes with Unity 5.6.1p1, event if they occur at a smaller scale (every 10/20 switches between VR and Normal view)
Thanks
I had to also add support for daydream. Having support for only cardboard caused a freeze every single time after about ten seconds of being in cardboard view mode after enabling
Having the same issue here. Application crashes when changing VRSettins.enabled. WaitForSeconds helps and allows me to change a couple of times but then it crashes again. I'm using Unity 5.6.2f1. Anyone have some idea or workaround?
I suggest switching to Unity 2017.1.0f1. Any version of Unity 5.6 gives OPENGL errors regardless of a crash or not (both sample logs below for GVR 1.30). It just can recover if it doesn't crash and looks like WaitForSeconds is buying time for recovery. WaitForSeconds can work for some time but anytime the crashes can revive back.
Log when it crashes
06-30 16:40:54.331 3111 3867 E BufferQueueProducer: [SurfaceView - com.company.product/com.unity3d.player.UnityPlayerActivity] connect: BufferQueue has been abandoned
06-30 16:40:54.332 23543 23561 E libEGL : eglCreateWindowSurface: native_window_api_connect (win=0xdede9008) failed (0xffffffed) (already connected to another API?)
06-30 16:40:54.332 23543 23561 E libEGL : eglCreateWindowSurface:473 error 3003 (EGL_BAD_ALLOC)
06-30 16:40:54.333 23543 23561 E Unity : [EGL] Failed to create window surface: EGL_BAD_ALLOC: EGL failed to allocate resources for the requested operation.
06-30 16:40:54.333 23543 23561 E Unity :
06-30 16:40:54.333 23543 23561 E Unity : (Filename: ./Runtime/GfxDevice/egl/WindowContextEGL.cpp Line: 141)
06-30 16:40:54.333 23543 23561 E Unity :
06-30 16:40:54.333 23543 23561 E libEGL : call to OpenGL ES API with no current context (logged once per thread)
06-30 16:40:54.366 23543 23580 E libEGL : call to OpenGL ES API with no current context (logged once per thread)
06-30 16:40:54.378 23543 23580 F libc : Fatal signal 11 (SIGSEGV), code 1, fault addr 0x2d0 in tid 23580 (Thread-115)
Log when it doesn't crash
07-01 02:05:28.065 23509 23544 E Unity : OPENGL NATIVE PLUG-IN ERROR: GL_OUT_OF_MEMORY: Not enough memory left to execute command
07-01 02:05:28.065 23509 23544 E Unity :
07-01 02:05:28.065 23509 23544 E Unity : (Filename: ./Runtime/GfxDevice/opengles/GfxDeviceGLES.cpp Line: 383)
07-01 02:05:28.065 23509 23544 E Unity :
07-01 02:05:28.096 3111 3868 E BufferQueueProducer: [SurfaceView - com.company.product/com.unity3d.player.UnityPlayerActivity] dequeueBuffer: BufferQueue has been abandoned
07-01 02:05:28.115 3111 3868 E BufferQueueProducer: [SurfaceView - com.company.product/com.unity3d.player.UnityPlayerActivity] dequeueBuffer: BufferQueue has been abandoned
07-01 02:05:28.139 23509 23544 E Unity : OPENGL NATIVE PLUG-IN ERROR: GL_STACK_OVERFLOW_KHR: OpenGL stack overflow
07-01 02:05:28.139 23509 23544 E Unity :
07-01 02:05:28.139 23509 23544 E Unity : (Filename: ./Runtime/GfxDevice/opengles/GfxDeviceGLES.cpp Line: 383)
In regards to the invalid state ( device lost ) I was able workaround a similar issue by swapping the device order in the Unity player settings so that Daydream is listed first then Cardboard.
@OllieGamer This issue is closed. Would you mind filing a new issue for the crash you're seeing when Cardboard is listed first? Before you do, check to see if #671 is what you're seeing.
@fredsa Hey Fred, it's Oliver, you're familiar with the exact issue I encountered, I wanted to share the workaround of swapping the device list in case it helped others, in my case I got the "invalid state (device lost) " message which was also in the crash log @guneyozsan shared above. I didn't see that message in #671 although the other symptoms were the same. Let me know if you still want a new issue created.
Hey Oliver, thanks for connecting the dots, and sharing your workaround!
No need to file a new issue, as I believe your issue is what we're tracking in #671: apps closing / crashing when they try to load the "cardboard" VR SDK / device when the phone is set to a non-native (HD+/FHD+) screen resolution. Your workaround of putting "daydream" before "cardboard" in the Player Settings > Android > Virtual Reality SDKs means the app will avoid the bug, since Unity loads supported VR devices in order, and it finds "daydream" before it finds "cardboard".
Oliver, thanks for posting your workaround, I just had the same issue and had no idea that my problem was that I removed daydream support! I'm keeping it in now exclusively as a workaround.
Getting a crash when using Vulkan on latest 2017.0.3b8 with GVR v1.110.0, running on Pixel XL + Daydream. Using GLES3 works, or running Vulkan with non-VR enabled works.
11-10 11:44:48.834 18932 18947 I cjw : Performance overlay has been initialised.
11-10 11:44:48.834 18932 18947 F libc : Fatal signal 11 (SIGSEGV), code 1, fault addr 0x20 in tid 18947 (UnityMain)
11-10 11:44:48.894 19012 19012 I crash_dump32: performing dump of process 18932 (target tid = 18947)
11-10 11:44:48.895 19012 19012 F DEBUG : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
11-10 11:44:48.895 19012 19012 F DEBUG : Build fingerprint: 'google/marlin/marlin:8.0.0/OPR3.170623.008/4294783:user/release-keys'
11-10 11:44:48.895 19012 19012 F DEBUG : Revision: '0'
11-10 11:44:48.895 19012 19012 F DEBUG : ABI: 'arm'
11-10 11:44:48.895 19012 19012 F DEBUG : pid: 18932, tid: 18947, name: UnityMain >>> com.Vulkan.Test <<<
11-10 11:44:48.895 19012 19012 F DEBUG : signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x20
11-10 11:44:48.895 19012 19012 F DEBUG : Cause: null pointer dereference
11-10 11:44:48.895 19012 19012 F DEBUG : r0 00000000 r1 ced7e878 r2 00000000 r3 00000000
11-10 11:44:48.895 19012 19012 F DEBUG : r4 c897c280 r5 00000004 r6 cc785410 r7 ced7ed28
11-10 11:44:48.895 19012 19012 F DEBUG : r8 0000005a r9 df1fc800 sl ced7eb38 fp ced7eac4
11-10 11:44:48.895 19012 19012 F DEBUG : ip ed7a6db8 sp ced7e8b8 lr c7826d7b pc c76ce8d4 cpsr 60070030
11-10 11:44:48.897 19012 19012 F DEBUG :
11-10 11:44:48.897 19012 19012 F DEBUG : backtrace:
11-10 11:44:48.897 19012 19012 F DEBUG : #00 pc 000ce8d4 /data/app/com.google.vr.vrcore-W1xajeEeaui6FlBVIElNng==/lib/arm/libvrcore_native.so
11-10 11:44:48.897 19012 19012 F DEBUG : #01 pc 00226d77 /data/app/com.google.vr.vrcore-W1xajeEeaui6FlBVIElNng==/lib/arm/libvrcore_native.so
11-10 11:44:48.898 19012 19012 F DEBUG : #02 pc 00975624 /data/app/com.Vulkan.Test-4QkgL8dSk_Aozi-u8EjynQ==/lib/arm/libunity.so
11-10 11:44:48.898 19012 19012 F DEBUG : #03 pc 0076cf74 /data/app/com.Vulkan.Test-4QkgL8dSk_Aozi-u8EjynQ==/lib/arm/libunity.so
11-10 11:44:48.898 19012 19012 F DEBUG : #04 pc 00768f00 /data/app/com.Vulkan.Test-4QkgL8dSk_Aozi-u8EjynQ==/lib/arm/libunity.so
@kalineh, vulkan is not supported for daydream or cardboard.
Also, that bug is unrelated to this thread. In the future please try to file new issues in cases like this.
I slove is by enable the multithreaded rendering!