System.Runtime.InteropServices.SEHException (520922)

I use version is 4.3.0f4 and sometimes receive the following Exception:

System.Runtime.InteropServices.SEHException was unhandled by user code
Message: An exception of type ‘System.Runtime.InteropServices.SEHException’ occurred in UnityEngineProxy.DLL but was not handled in user code
Additional information: External component has thrown an exception.

With the debugger from VS 2013 the exception rises in OnGUI() method.

GUILayout.Label ("" + maxGuleCountBeforeGameEnd, guleLabelStyle);

maxGuleCountBeforeGameEnd is a private int variable.

The exception rises again. Here is the UnityPlayer.log

Build from ‘’ branch, version is ‘4.3.0f4 (e01000627d60)’ (Release build).
Physical memory: 898 MB, commited memory limit: 380 MB.
PlayerConnection initialized from C:/Data/Programs/{8ED7A2BE-C28F-4617-AD14-6D61AA4147C7}/Install/Data (debug = 0)
PlayerConnection initialized network socket : 0.0.0.0 55347
GetLocalIP: Error during connect, 10065 Multi-casting “[IP] 127.0.0.1 [Port] 55347 [Flags] 2 [Guid] 907637971 [EditorId] 2328478545 [Version] 1048832 [Id] WP8Player(0.0.0.0) [Debug] 0” to [225.0.0.222:54997]…
Direct3D:
Version: Direct3D 11.0 [level 9.3]
Renderer: Qualcomm Adreno 225 (WDDM v1.2) (ID=0x32303032)
Vendor: Qualcomm
VRAM: 96 MB
Initialize engine version: 4.3.0f4 (e01000627d60)
UnloadTime: 63.420444 ms
Unloading 4 Unused Serialized files (Serialized files now loaded: 0 / Dirty serialized files: 0)

Unloading 50 unused Assets to reduce memory usage. Loaded Objects now: 157. Operation took 70.562218 ms.
System memory in use: 1.9 MB.
UnloadTime: 9.386518 ms
Unloading 2 Unused Serialized files (Serialized files now loaded: 0 / Dirty serialized files: 0)

Unloading 12 unused Assets to reduce memory usage. Loaded Objects now: 133. Operation took 42.078369 ms.
System memory in use: 2.0 MB.
UnloadTime: 1.511111 ms
Unloading 5 Unused Serialized files (Serialized files now loaded: 0 / Dirty serialized files: 0)

Unloading 12 unused Assets to reduce memory usage. Loaded Objects now: 324. Operation took 18.308001 ms.
System memory in use: 4.0 MB.
UnloadTime: 4.503555 ms
Unloading 2 Unused Serialized files (Serialized files now loaded: 0 / Dirty serialized files: 0)

Unloading 4 unused Assets to reduce memory usage. Loaded Objects now: 308. Operation took 18.383852 ms.
System memory in use: 3.9 MB.
UnloadTime: 7.109185 ms
Unloading 2 Unused Serialized files (Serialized files now loaded: 0 / Dirty serialized files: 0)

Unloading 4 unused Assets to reduce memory usage. Loaded Objects now: 308. Operation took 22.587259 ms.
System memory in use: 3.9 MB.
UnloadTime: 4.908148 ms
Unloading 2 Unused Serialized files (Serialized files now loaded: 0 / Dirty serialized files: 0)

Unloading 4 unused Assets to reduce memory usage. Loaded Objects now: 308. Operation took 11.442962 ms.
System memory in use: 3.9 MB.
UnloadTime: 6.561629 ms
Unloading 2 Unused Serialized files (Serialized files now loaded: 0 / Dirty serialized files: 0)

Unloading 4 unused Assets to reduce memory usage. Loaded Objects now: 308. Operation took 31.959999 ms.
System memory in use: 3.9 MB.
UnloadTime: 9.089333 ms
Unloading 2 Unused Serialized files (Serialized files now loaded: 0 / Dirty serialized files: 0)

Unloading 56 unused Assets to reduce memory usage. Loaded Objects now: 135. Operation took 45.738369 ms.
System memory in use: 2.0 MB.
UnloadTime: 1.928000 ms
Unloading 6 Unused Serialized files (Serialized files now loaded: 0 / Dirty serialized files: 0)

Unloading 9 unused Assets to reduce memory usage. Loaded Objects now: 388. Operation took 75.460892 ms.
System memory in use: 4.0 MB.
UnloadTime: 13.233629 ms
Unloading 3 Unused Serialized files (Serialized files now loaded: 0 / Dirty serialized files: 0)

Unloading 59 unused Assets to reduce memory usage. Loaded Objects now: 144. Operation took 172.810074 ms.
System memory in use: 2.0 MB.
UnloadTime: 2.175111 ms
Unloading 5 Unused Serialized files (Serialized files now loaded: 0 / Dirty serialized files: 0)

Unloading 12 unused Assets to reduce memory usage. Loaded Objects now: 397. Operation took 29.994370 ms.
System memory in use: 4.0 MB.
UnloadTime: 7.828741 ms
Unloading 2 Unused Serialized files (Serialized files now loaded: 0 / Dirty serialized files: 0)

Unloading 4 unused Assets to reduce memory usage. Loaded Objects now: 381. Operation took 12.689185 ms.
System memory in use: 4.0 MB.
UnloadTime: 28.816000 ms
Unloading 2 Unused Serialized files (Serialized files now loaded: 0 / Dirty serialized files: 0)

Unloading 4 unused Assets to reduce memory usage. Loaded Objects now: 381. Operation took 11.450370 ms.
System memory in use: 4.0 MB.
UnloadTime: 7.732444 ms
Unloading 2 Unused Serialized files (Serialized files now loaded: 0 / Dirty serialized files: 0)

Unloading 4 unused Assets to reduce memory usage. Loaded Objects now: 381. Operation took 20.078667 ms.
System memory in use: 4.0 MB.
UnloadTime: 13.206223 ms
Unloading 2 Unused Serialized files (Serialized files now loaded: 0 / Dirty serialized files: 0)

Unloading 4 unused Assets to reduce memory usage. Loaded Objects now: 381. Operation took 11.356000 ms.
System memory in use: 4.0 MB.
UnloadTime: 14.758074 ms
Unloading 2 Unused Serialized files (Serialized files now loaded: 0 / Dirty serialized files: 0)

Unloading 59 unused Assets to reduce memory usage. Loaded Objects now: 134. Operation took 126.881477 ms.
System memory in use: 2.0 MB.
UnloadTime: 1.848888 ms
Unloading 8 Unused Serialized files (Serialized files now loaded: 0 / Dirty serialized files: 0)

Unloading 8 unused Assets to reduce memory usage. Loaded Objects now: 382. Operation took 30.119852 ms.
System memory in use: 4.0 MB.
UnloadTime: 40.808296 ms
Unloading 2 Unused Serialized files (Serialized files now loaded: 0 / Dirty serialized files: 0)

Unloading 63 unused Assets to reduce memory usage. Loaded Objects now: 137. Operation took 56.858814 ms.
System memory in use: 2.0 MB.
UnloadTime: 1.410962 ms
Unloading 8 Unused Serialized files (Serialized files now loaded: 0 / Dirty serialized files: 0)

Unloading 7 unused Assets to reduce memory usage. Loaded Objects now: 382. Operation took 74.344002 ms.
System memory in use: 4.0 MB.
UnloadTime: 5.533925 ms
Unloading 2 Unused Serialized files (Serialized files now loaded: 0 / Dirty serialized files: 0)

Unloading 63 unused Assets to reduce memory usage. Loaded Objects now: 135. Operation took 98.298813 ms.
System memory in use: 2.0 MB.
UnloadTime: 2.971407 ms
Unloading 6 Unused Serialized files (Serialized files now loaded: 0 / Dirty serialized files: 0)

Unloading 6 unused Assets to reduce memory usage. Loaded Objects now: 343. Operation took 25.625925 ms.
System memory in use: 4.0 MB.
UnloadTime: 7.108148 ms
Unloading 2 Unused Serialized files (Serialized files now loaded: 0 / Dirty serialized files: 0)

Unloading 58 unused Assets to reduce memory usage. Loaded Objects now: 135. Operation took 73.494812 ms.
System memory in use: 2.0 MB.
UnloadTime: 1.671703 ms
Unloading 7 Unused Serialized files (Serialized files now loaded: 0 / Dirty serialized files: 0)

Unloading 6 unused Assets to reduce memory usage. Loaded Objects now: 416. Operation took 21.327406 ms.
System memory in use: 4.0 MB.
Exception: External component has thrown an exception.
Type: System.Runtime.InteropServices.SEHException
Module: UnityEngineProxy
InnerException:
AdditionalInfo:Invoking UnityEngine.GUIUtility::BeginGUI method with argument count: 3
at UnityEngineProxy.InternalCalls.RectOffset_Get_Custom_PropLeft(Object self)

at UnityEngine.GUILayoutGroup.ApplyStyleSettings(GUIStyle style)

at UnityEngine.GUILayoutEntry…ctor(Single _minWidth, Single _maxWidth, Single _minHeight, Single _maxHeight, GUIStyle _style)

at UnityEngine.GUILayoutGroup…ctor()

at UnityEngine.GUILayoutUtility.Begin(Int32 instanceID)

at UnityEngine.GUIUtility.BeginGUI(Int32 skinMode, Int32 instanceID, Int32 useGUILayout)

at lambda_method(Closure , Object , Object[ ] , Int32 )

at WinRTBridge.MethodTools.InvokeMethod(Object instance, Int32 methodIndex, Object[ ] args)

(Filename: C:/BuildAgent/work/d3d49558e4d408f4/Runtime/Scripting/WinRTUtility.cpp Line: 65)

UnloadTime: 14.902814 ms
Unloading 2 Unused Serialized files (Serialized files now loaded: 0 / Dirty serialized files: 0)

Unloading 56 unused Assets to reduce memory usage. Loaded Objects now: 139. Operation took 29.829628 ms.
System memory in use: 2.1 MB.
UnloadTime: 1.315703 ms
Unloading 6 Unused Serialized files (Serialized files now loaded: 0 / Dirty serialized files: 0)

Unloading 6 unused Assets to reduce memory usage. Loaded Objects now: 337. Operation took 72.726669 ms.
System memory in use: 4.0 MB.

Hello. This is a known issue and are working at getting a fix out ASAP. Until then, the best you can do it wait…

Hi i have the same problem , do you have any news ?

Hi, this issue was fixed in Unity 4.3.2.

after reading this I updated from 4.3.0 to 4.5.4 but all the same.
I’m testing on Huawei W1 U-34 phone, with Windows Phone 8.0

Hi,

could you go into more details?

the source of error is Input.GetTouch(0). If this helps I found a work-around by Input.simulateMouseWithTouches = true and interact with the game through an imaginary mouse. But when I was using the Input.GetTouch the error was repeated quite a number of times:

Exception: External component has thrown an exception
Type:
System.Runtime.InteropServices.SEHException
Module: UnityEngine
InnerException: <No Data>
AdditionalInfo: <No Data>
at UnityEngine.Internal.$Calli.Invoke28(Int32 arg0, Int32 arg1, IntPtr method)
at UnityEngine.Input.GetTouch(Int32 index)
at Controlls.DetectInputs()
at Controlls.$Invoke7(Int64 instance, Int64* args)
at UnityEngine.Internal.$MethodUtility.InvokeMethod(Int64 instance, Int64* args, IntPtr method)

SEHException: External component has thrown an exception.

I just discovered that even though the error is there, the touches actually do work (yesterday the log was covering the target touch area) but the error is still there

Please check if Input.touchCount bigger than 0, and if it is, only then call Input.GetTouch(0), you’re probably accessing non existant data.

Tomas1856
Thank you, that solved it.

1 Like

Exception: External component has thrown an exception.
Type: System.Runtime.InteropServices.SEHException
Module: UnityEngine
InnerException:
AdditionalInfo:
at UnityEngine.Internal.$Calli.Invoke39(Int32 arg0, IntPtr method) at UnityEngine.Component.InternalGetGameObject() at ProFlareBatch.OnDestroy() at ProFlareBatch.$Invoke7(Int64 instance, Int64* args) at UnityEngine.Internal.$MethodUtility.InvokeMethod(Int64 instance, Int64* args, IntPtr method)

@ProFlares
Facing same SEHException in Proflare as well. Its killing the app on launch itself. how can i resolve this

It seems, you’re calling gameObject property on object which no longer exists in ProFlareBatch.OnDestroy function.

Check if object isn’t null.

And Facing the same issue if following script as well. Checking for null here as well but still same issue pops up and kills the app

public class FlickeringLight : MonoBehaviour
{

    public Material currentShader;
    public float minValue = 0.5f;
    public float maxValue = 1.5f;
    public float interval = 0.5f;

    void Start () {
      //  if (Game.isHD)
        StartCoroutine("FlickerLight");
    }

   private IEnumerator FlickerLight()
    {
        if (currentShader)
        {
            yield return new WaitForSeconds(interval);
            FlickerShaer(currentShader, minValue);
            yield return new WaitForSeconds(interval);
            FlickerShaer(currentShader, maxValue);
            StartCoroutine("FlickerLight");
        }
    }

   private void FlickerShaer(Material shader, float value)
   {
       try
       {
           shader.SetFloat("_Intensity", value);
       }
       catch
       {
       }
   }

This is not ProFlareBatch class?

No this is a different Class. And on level load app crashes with SEHException.
Modified ProFlareBatch Class with null check and so far it looks fine. I will update if same issue repeats.
Can you confirm whether this issue related to following bug report

No, that issue affected only scripts in UnityScript.

oh k. Can you see anything bad in FlickeringLight class ! Which may be the cause for SEHException.

That script looks fine… on which line does the exception happen?

Received the same error while building my game for windows store. I’m using unity 5.

I’m receiving the error at line:

GameObject[ ] allSpheres = GameObject.FindObjectsWithTag(“sphere”);

this function is called many times rapidly in the game, and the VS debugger says at the break point that the allSpheres variable is null. So, I declared the variable outside the function, so that it is initialized just ones.

GameObject[ ] allSpheres;

allSpheres = GameObject.FindObjectsWithTag(“sphere”);

but no luck :frowning:

The details of my error is as follows:

System.Runtime.InteropServices.SEHException was unhandled by user code
HResult=-2147467259
Message=External component has thrown an exception.
Source=UnityEngineProxy
ErrorCode=-2147467259
StackTrace:
at UnityEngineProxy.InternalCalls.GameObject_CUSTOM_FindGameObjectsWithTag(String tag)
at UnityEngine.GameObject.FindGameObjectsWithTag(String tag)
at gameManager.checkWinner()
at gameManager.turnEnds()
at gameManager.Update()
at gameManager.$Invoke14(Int64 instance, Int64* args)
at UnityEngine.Internal.$MethodUtility.InvokeMethod(Int64 instance, Int64* args, IntPtr method)
InnerException:

Let me know if u want any other details regarding this… But please help ASAP :cry:

I’d suggest to wrap it with you own function and make sure allSpheres is never null. Like this:

GameObject[] FindAllSpheres()
{
    var spheres = GameObject.FindObjectsWithTag("sphere");
    return spheres!=null ? spheres : new GameObject[]{};
}

and use this function to get spheres. If that does not help, please report a bug.

1 Like