Search Unity

  1. We are looking for your feedback about Templates! Tell us about your experiences by taking our survey.
    Dismiss Notice
  2. Curious about what's going to be in 2021.1? Have a look at the 2021.1 beta blog post.
    Dismiss Notice

Camera to render texture crash ?

Discussion in '5.5 Beta' started by dworm, Nov 24, 2016.

  1. dworm

    dworm

    Joined:
    Jun 17, 2015
    Posts:
    71
    There is some bug making unity crash, apparently it has to do with an additional camera I use that renders on a texture and then on a Raw Image UI element, anyone has any clue what is changed that might make unity crash?

    Unity Editor [version: Unity 5.5.0f1_d44b7ab76b45]

    Unity.exe caused an Access Violation (0xc0000005)
    in module Unity.exe at 0033:40b8618f.
     
  2. StaffanEk

    StaffanEk

    Joined:
    Jul 13, 2012
    Posts:
    380
    Could you attach the bug report number?
     
  3. dworm

    dworm

    Joined:
    Jun 17, 2015
    Posts:
    71
    Where can I find that?
     
  4. StaffanEk

    StaffanEk

    Joined:
    Jul 13, 2012
    Posts:
    380
    You need to file a bug Report. In Unity: Help/Report a bug.... It's much easier if you can create a clean project with only your bug and no other unnecessary assets.

    So a clean project with your render texture, and UI element.
     
  5. Kef-niark

    Kef-niark

    Joined:
    Jun 20, 2016
    Posts:
    6
    I don't know if it's related but I have some crash on android with unity 5.5, related to camera texture too
    library: https://github.com/kefniark/UnityBarcodeScanner

    This crash happen when the camera is released (like clicking on the back button), the app completely crash.
    I can reproduce this bug on multiple version of android (4 -> 6)
    Code (csharp):
    1.  
    2. 11-28 16:46:03.808 202-819/? I/CameraService: onTorchStatusChangedLocked: Torch status changed for cameraId=0, newStatus=1
    3. 11-28 16:46:03.808 202-819/? I/CameraService: onTorchStatusChangedLocked: Torch status changed for cameraId=0, newStatus=1
    4. 11-28 16:46:03.808 202-819/? I/CameraService: disconnect: Disconnected client for camera 0 for PID 29596
    5. 11-28 16:46:03.817 202-889/? I/Camera2Client: Camera 0: Closed
    6. 11-28 16:46:03.817 202-889/? I/Camera2ClientBase: Closed Camera 0. Client was: com.ganbaranai.BarcodeScanner (PID 29596, UID 10218)
    7. 11-28 16:46:03.817 202-889/? D/NuPlayerDriver: reset(0xb34da540)
    8. 11-28 16:46:03.817 202-889/? D/NuPlayerDriver: notifyListener_l(0xb34da540), (8, 0, 0)
    9. 11-28 16:46:03.823 202-30247/? D/NuPlayerDriver: notifyResetComplete(0xb34da540)
    10. 11-28 16:46:03.824 202-889/? D/NuPlayerDriver: reset(0xb3253b40)
    11. 11-28 16:46:03.824 202-889/? D/NuPlayerDriver: notifyListener_l(0xb3253b40), (8, 0, 0)
    12. 11-28 16:46:03.824 202-30249/? D/NuPlayerDriver: notifyResetComplete(0xb3253b40)
    13. 11-28 16:46:03.824 202-889/? D/NuPlayerDriver: reset(0xb3253ba0)
    14. 11-28 16:46:03.824 202-889/? D/NuPlayerDriver: notifyListener_l(0xb3253ba0), (8, 0, 0)
    15. 11-28 16:46:03.825 202-30251/? D/NuPlayerDriver: notifyResetComplete(0xb3253ba0)
    16. 11-28 16:46:03.850 29596-30088/com.ganbaranai.BarcodeScanner D/Unity: Unloading 2 Unused Serialized files (Serialized files now loaded: 0)
    17.  
    18.                                                                       --------- beginning of crash
    19. 11-28 16:46:03.866 29596-29610/com.ganbaranai.BarcodeScanner A/libc: Fatal signal 11 (SIGSEGV), code 1, fault addr 0x44 in tid 29610 (UnityMain)
    20. 11-28 16:46:03.972 199-199/? A/DEBUG: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
    21. 11-28 16:46:03.972 199-199/? A/DEBUG: Build fingerprint: 'google/hammerhead/hammerhead:6.0.1/M4B30X/3237893:user/release-keys'
    22. 11-28 16:46:03.972 199-199/? A/DEBUG: Revision: '11'
    23. 11-28 16:46:03.972 199-199/? A/DEBUG: ABI: 'arm'
    24. 11-28 16:46:03.972 199-199/? A/DEBUG: pid: 29596, tid: 29610, name: UnityMain  >>> com.ganbaranai.BarcodeScanner <<<
    25. 11-28 16:46:03.973 199-199/? A/DEBUG: signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x44
    26. 11-28 16:46:04.013 199-199/? A/DEBUG:     r0 00000000  r1 a14c7410  r2 0000010f  r3 00000001
    27. 11-28 16:46:04.013 199-199/? A/DEBUG:     r4 9d26fef0  r5 a2252080  r6 a222d36c  r7 aedbf364
    28. 11-28 16:46:04.013 199-199/? A/DEBUG:     r8 aedbf37c  r9 9613e838  sl 3b9aca00  fp 9ef2f44c
    29. 11-28 16:46:04.013 199-199/? A/DEBUG:     ip a20c022c  sp aedbf328  lr a16f2f70  pc a14c741c  cpsr 80070010
    30. 11-28 16:46:04.103 199-199/? A/DEBUG: backtrace:
    31. 11-28 16:46:04.104 199-199/? A/DEBUG:     #00 pc 007e641c  /data/app/com.ganbaranai.BarcodeScanner-1/lib/arm/libunity.so (_ZN13WebCamTexture5PauseEv+12)
    32. 11-28 16:46:04.104 199-199/? A/DEBUG:     #01 pc 00a11f6c  /data/app/com.ganbaranai.BarcodeScanner-1/lib/arm/libunity.so (_ZN16BaseVideoTexture18PauseVideoTexturesEv+60)
    33. 11-28 16:46:04.104 199-199/? A/DEBUG:     #02 pc 004eeebc  /data/app/com.ganbaranai.BarcodeScanner-1/lib/arm/libunity.so (_ZN18LoadSceneOperation25PlayerLoadSceneFromThreadEv+236)
    34. 11-28 16:46:04.104 199-199/? A/DEBUG:     #03 pc 004eec74  /data/app/com.ganbaranai.BarcodeScanner-1/lib/arm/libunity.so (_ZN18LoadSceneOperation19IntegrateMainThreadEv+244)
    35. 11-28 16:46:04.104 199-199/? A/DEBUG:     #04 pc 004efd98  /data/app/com.ganbaranai.BarcodeScanner-1/lib/arm/libunity.so (_ZN14PreloadManager26UpdatePreloadingSingleStepENS_21UpdatePreloadingFlagsEi+584)
    36. 11-28 16:46:04.104 199-199/? A/DEBUG:     #05 pc 004f0490  /data/app/com.ganbaranai.BarcodeScanner-1/lib/arm/libunity.so (_ZN14PreloadManager35WaitForAllAsyncOperationsToCompleteEv+104)
    37. 11-28 16:46:04.104 199-199/? A/DEBUG:     #06 pc 004f059c  /data/app/com.ganbaranai.BarcodeScanner-1/lib/arm/libunity.so (_ZN14PreloadManager16UpdatePreloadingEv+164)
    38. 11-28 16:46:04.104 199-199/? A/DEBUG:     #07 pc 0049df5c  /data/app/com.ganbaranai.BarcodeScanner-1/lib/arm/libunity.so (_ZZ23InitPlayerLoopCallbacksvEN33EarlyUpdateUpdatePreloadingstruct7ForwardEv+72)
    39. 11-28 16:46:04.104 199-199/? A/DEBUG:     #08 pc 0049eb58  /data/app/com.ganbaranai.BarcodeScanner-1/lib/arm/libunity.so (_Z10PlayerLoopv+688)
    40. 11-28 16:46:04.104 199-199/? A/DEBUG:     #09 pc 007c19cc  /data/app/com.ganbaranai.BarcodeScanner-1/lib/arm/libunity.so (_Z15UnityPlayerLoopv+820)
    41. 11-28 16:46:04.104 199-199/? A/DEBUG:     #10 pc 007c4504  /data/app/com.ganbaranai.BarcodeScanner-1/lib/arm/libunity.so (_Z12nativeRenderP7_JNIEnvP8_jobject+264)
    42. 11-28 16:46:04.104 199-199/? A/DEBUG:     #11 pc 00026fb9  /data/app/com.ganbaranai.BarcodeScanner-1/oat/arm/base.odex (offset 0x1a000) (boolean com.unity3d.player.UnityPlayer.nativeRender()+76)
    43. 11-28 16:46:04.104 199-199/? A/DEBUG:     #12 pc 00024c27  /data/app/com.ganbaranai.BarcodeScanner-1/oat/arm/base.odex (offset 0x1a000) (boolean com.unity3d.player.UnityPlayer.a(com.unity3d.player.UnityPlayer)+50)
    44. 11-28 16:46:04.104 199-199/? A/DEBUG:     #13 pc 0002239d  /data/app/com.ganbaranai.BarcodeScanner-1/oat/arm/base.odex (offset 0x1a000) (boolean com.unity3d.player.UnityPlayer$b$1.handleMessage(android.os.Message)+1104)
    45. 11-28 16:46:04.105 199-199/? A/DEBUG:     #14 pc 723325c5  /data/dalvik-cache/arm/system@framework@boot.oat (offset 0x1ed6000)
    46. 11-28 16:46:05.734 199-199/? A/DEBUG: Tombstone written to: /data/tombstones/tombstone_05
    47. 11-28 16:46:05.767 776-787/? W/MediaFocusControl:   AudioFocus   audio focus client died
    48. 11-28 16:46:05.767 776-787/? I/MediaFocusControl: AudioFocus  removeFocusStackEntry(): removing entry for android.os.BinderProxy@35567f1
    49. 11-28 16:46:05.768 776-2058/? I/WindowState: WIN DEATH: Window{91fb43a u0 com.ganbaranai.BarcodeScanner/com.unity3d.player.UnityPlayerActivity}
    50. 11-28 16:46:05.773 213-213/? I/Zygote: Process 29596 exited due to signal (11)
    51.  
    I will try later at home to reproduce this issue with unity editor (to have a better stacktrace) and make a simpler project to allow other people to reproduce it too.
     
  6. Kef-niark

    Kef-niark

    Joined:
    Jun 20, 2016
    Posts:
    6
    I did a small project to reproduce this crash on android device (not able to reproduce it in unity editor, win64 or OSX)
    The code needed is really short ^^

    Code (csharp):
    1.  
    2. using UnityEngine;
    3. using System.Linq;
    4. using UnityEngine.UI;
    5. using UnityEngine.SceneManagement;
    6.  
    7. public class CrashScript : MonoBehaviour {
    8.  
    9.     public RawImage rawImage;
    10.     private WebCamTexture Webcam;
    11.  
    12.     // Use this for initialization
    13.     void Start () {
    14.         WebCamDevice selectCamera = WebCamTexture.devices.First();
    15.  
    16.         // Create webcamTexture
    17.         Webcam = new WebCamTexture(selectCamera.name);
    18.         Webcam.Play();
    19.  
    20.         // Set Texture
    21.         rawImage.texture = Webcam;
    22.     }
    23.  
    24.     // Click and reload view
    25.     public void ClickButton()
    26.     {
    27.         Webcam.Stop();
    28.         rawImage = null;
    29.         SceneManager.LoadScene("CrashView");
    30.     }
    31. }
    32.  
    P.S. To be sure, I also submitted a bug report directly through unity editor
     

    Attached Files:

    Last edited: Nov 28, 2016
  7. Alex-Lian

    Alex-Lian

    Guest

  8. Kef-niark

    Kef-niark

    Joined:
    Jun 20, 2016
    Posts:
    6
    #855603
    with some misspelled words, my bad :D
     
unityunity