Camera to render texture crash ?

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.

Could you attach the bug report number?

Where can I find that?

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.

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: GitHub - kefniark/UnityBarcodeScanner: Simple Unity Barcode Scanner

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)

11-28 16:46:03.808 202-819/? I/CameraService: onTorchStatusChangedLocked: Torch status changed for cameraId=0, newStatus=1
11-28 16:46:03.808 202-819/? I/CameraService: onTorchStatusChangedLocked: Torch status changed for cameraId=0, newStatus=1
11-28 16:46:03.808 202-819/? I/CameraService: disconnect: Disconnected client for camera 0 for PID 29596
11-28 16:46:03.817 202-889/? I/Camera2Client: Camera 0: Closed
11-28 16:46:03.817 202-889/? I/Camera2ClientBase: Closed Camera 0. Client was: com.ganbaranai.BarcodeScanner (PID 29596, UID 10218)
11-28 16:46:03.817 202-889/? D/NuPlayerDriver: reset(0xb34da540)
11-28 16:46:03.817 202-889/? D/NuPlayerDriver: notifyListener_l(0xb34da540), (8, 0, 0)
11-28 16:46:03.823 202-30247/? D/NuPlayerDriver: notifyResetComplete(0xb34da540)
11-28 16:46:03.824 202-889/? D/NuPlayerDriver: reset(0xb3253b40)
11-28 16:46:03.824 202-889/? D/NuPlayerDriver: notifyListener_l(0xb3253b40), (8, 0, 0)
11-28 16:46:03.824 202-30249/? D/NuPlayerDriver: notifyResetComplete(0xb3253b40)
11-28 16:46:03.824 202-889/? D/NuPlayerDriver: reset(0xb3253ba0)
11-28 16:46:03.824 202-889/? D/NuPlayerDriver: notifyListener_l(0xb3253ba0), (8, 0, 0)
11-28 16:46:03.825 202-30251/? D/NuPlayerDriver: notifyResetComplete(0xb3253ba0)
11-28 16:46:03.850 29596-30088/com.ganbaranai.BarcodeScanner D/Unity: Unloading 2 Unused Serialized files (Serialized files now loaded: 0)

                                                                      --------- beginning of crash
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)
11-28 16:46:03.972 199-199/? A/DEBUG: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
11-28 16:46:03.972 199-199/? A/DEBUG: Build fingerprint: 'google/hammerhead/hammerhead:6.0.1/M4B30X/3237893:user/release-keys'
11-28 16:46:03.972 199-199/? A/DEBUG: Revision: '11'
11-28 16:46:03.972 199-199/? A/DEBUG: ABI: 'arm'
11-28 16:46:03.972 199-199/? A/DEBUG: pid: 29596, tid: 29610, name: UnityMain  >>> com.ganbaranai.BarcodeScanner <<<
11-28 16:46:03.973 199-199/? A/DEBUG: signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x44
11-28 16:46:04.013 199-199/? A/DEBUG:     r0 00000000  r1 a14c7410  r2 0000010f  r3 00000001
11-28 16:46:04.013 199-199/? A/DEBUG:     r4 9d26fef0  r5 a2252080  r6 a222d36c  r7 aedbf364
11-28 16:46:04.013 199-199/? A/DEBUG:     r8 aedbf37c  r9 9613e838  sl 3b9aca00  fp 9ef2f44c
11-28 16:46:04.013 199-199/? A/DEBUG:     ip a20c022c  sp aedbf328  lr a16f2f70  pc a14c741c  cpsr 80070010
11-28 16:46:04.103 199-199/? A/DEBUG: backtrace:
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
11-28 16:46:04.105 199-199/? A/DEBUG:     #14 pc 723325c5  /data/dalvik-cache/arm/system@framework@boot.oat (offset 0x1ed6000)
11-28 16:46:05.734 199-199/? A/DEBUG: Tombstone written to: /data/tombstones/tombstone_05
11-28 16:46:05.767 776-787/? W/MediaFocusControl:   AudioFocus   audio focus client died
11-28 16:46:05.767 776-787/? I/MediaFocusControl: AudioFocus  removeFocusStackEntry(): removing entry for android.os.BinderProxy@35567f1
11-28 16:46:05.768 776-2058/? I/WindowState: WIN DEATH: Window{91fb43a u0 com.ganbaranai.BarcodeScanner/com.unity3d.player.UnityPlayerActivity}
11-28 16:46:05.773 213-213/? I/Zygote: Process 29596 exited due to signal (11)

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.

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 ^^

using UnityEngine;
using System.Linq;
using UnityEngine.UI;
using UnityEngine.SceneManagement;

public class CrashScript : MonoBehaviour {

    public RawImage rawImage;
    private WebCamTexture Webcam;

    // Use this for initialization
    void Start () {
        WebCamDevice selectCamera = WebCamTexture.devices.First();

        // Create webcamTexture
        Webcam = new WebCamTexture(selectCamera.name);
        Webcam.Play();

        // Set Texture
        rawImage.texture = Webcam;
    }

    // Click and reload view
    public void ClickButton()
    {
        Webcam.Stop();
        rawImage = null;
        SceneManager.LoadScene("CrashView");
    }
}

P.S. To be sure, I also submitted a bug report directly through unity editor

2866446–209928–CrashWebcam.zip (31.8 KB)

@Kef-niark Could you share the bug # please?

#855603
with some misspelled words, my bad :smile: