Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

Errors: "Matrix Stack Full Depth Reached" and asset preview security exception.

Discussion in 'Editor & General Support' started by Alec-Slayden, Nov 11, 2012.

  1. Alec-Slayden

    Alec-Slayden

    Joined:
    Dec 16, 2008
    Posts:
    94
    Hello, recently I've started to get a series of error messages thrown at random times throughout development. The game will build and play without issues, but these have me concerned, as I have not been able to find any solutions online. I intend to use the bug reporter once I find a reliable way to reproduce the errors, which seem to come sporadically, I suppose when assets are refreshed, though after playing and upon loading the game, the errors do not always appear.

    The errors are multiple iterations of:
    Matrix stack full depth reached
    UnityEditor.AssetPreviewUpdater:GenerateAssetPreview(Object, Int32)


    and the occasional:
    SecurityException: Reading from the screen is not allowed when you have used a downloaded texture without proper crossdomain.xml authorization
    UnityEngine.Texture2D.ReadPixels (Rect source, Int32 destX, Int32 destY)
    UnityEditor.PreviewRenderUtility.EndStaticPreview ()
    UnityEditor.GameObjectInspector.RenderStaticPreview (Int32 width, Int32 height)
    UnityEditor.AssetPreviewUpdater.CreatePreviewForAsset (UnityEngine.Object obj)
    UnityEditor.AssetPreviewUpdater.GenerateAssetPreview (UnityEngine.Object asset, Int32 isMainAsset)


    Note that none of my scripts involve reading pixels from an external source, though one does involve retrieving it via WWW for display only.

    Any assistance with resolving these before they become a problem in development would be greatly appreciated.


    The log details for the errors are as follows ( in code wrapper to prevent super long post):
    Code (csharp):
    1. /*
    2. Updating Assets/#Project/Levels/#Level 4/Art/Wide/FullBG.mat - GUID: d36eeaff2c02541528249f756f5b5a05...
    3. SecurityException: Reading from the screen is not allowed when you have used a downloaded texture without proper crossdomain.xml authorization
    4.   at (wrapper managed-to-native) UnityEngine.Texture2D:INTERNAL_CALL_ReadPixels (UnityEngine.Texture2D,UnityEngine.Rect,int,int,bool)
    5.   at UnityEngine.Texture2D.ReadPixels (Rect source, Int32 destX, Int32 destY) [0x00000] in <filename unknown>:0
    6.   at UnityEditor.PreviewRenderUtility.EndStaticPreview () [0x00000] in <filename unknown>:0
    7.   at UnityEditor.MaterialEditor.RenderStaticPreview (Int32 width, Int32 height) [0x00000] in <filename unknown>:0
    8.   at UnityEditor.AssetPreviewUpdater.CreatePreviewForAsset (UnityEngine.Object obj) [0x00000] in <filename unknown>:0
    9.   at UnityEditor.AssetPreviewUpdater.GenerateAssetPreview (UnityEngine.Object asset, Int32 isMainAsset) [0x00000] in <filename unknown>:0
    10.  
    11. (Filename:  Line: -1)
    12.  
    13.  done. [Time: 23.432560 ms]
    14. Updating Assets/#Project/Levels/#Level 4/Static Cell Setup/Group A.prefab - GUID: e0409feec080cf547b8ca11cdb65f7cd...
    15. Matrix stack full depth reached
    16. UnityEngine.GL:PushMatrix()
    17. UnityEditor.SavedRenderTargetState:.ctor()
    18. UnityEditor.PreviewRenderUtility:InitPreview(Rect)
    19. UnityEditor.PreviewRenderUtility:BeginStaticPreview(Rect)
    20. UnityEditor.GameObjectInspector:RenderStaticPreview(Int32, Int32)
    21. UnityEditor.AssetPreviewUpdater:CreatePreviewForAsset(Object)
    22. UnityEditor.AssetPreviewUpdater:GenerateAssetPreview(Object, Int32)
    23.  
    24. [/Applications/buildAgent/work/14194e8ce88cdf47/Runtime/Graphics/MatrixStack.cpp line 32]
    25. (Filename: /Applications/buildAgent/work/14194e8ce88cdf47/Runtime/Graphics/MatrixStack.cpp Line: 32)
    26.  
    27. Matrix stack full depth reached
    28. UnityEngine.GL:PushMatrix()
    29. UnityEditor.SavedRenderTargetState:.ctor()
    30. UnityEditor.PreviewRenderUtility:InitPreview(Rect)
    31. UnityEditor.PreviewRenderUtility:BeginStaticPreview(Rect)
    32. UnityEditor.GameObjectInspector:RenderStaticPreview(Int32, Int32)
    33. UnityEditor.AssetPreviewUpdater:CreatePreviewForAsset(Object)
    34. UnityEditor.AssetPreviewUpdater:GenerateAssetPreview(Object, Int32)
    35.  
    36. [/Applications/buildAgent/work/14194e8ce88cdf47/Runtime/Graphics/MatrixStack.cpp line 32]
    37. (Filename: /Applications/buildAgent/work/14194e8ce88cdf47/Runtime/Graphics/MatrixStack.cpp Line: 32)
    38.  
    39. Matrix stack full depth reached
    40. UnityEngine.GL:PushMatrix()
    41. UnityEditor.SavedRenderTargetState:.ctor()
    42. UnityEditor.PreviewRenderUtility:InitPreview(Rect)
    43. UnityEditor.PreviewRenderUtility:BeginStaticPreview(Rect)
    44. UnityEditor.GameObjectInspector:RenderStaticPreview(Int32, Int32)
    45. UnityEditor.AssetPreviewUpdater:CreatePreviewForAsset(Object)
    46. UnityEditor.AssetPreviewUpdater:GenerateAssetPreview(Object, Int32)
    47.  
    48. [/Applications/buildAgent/work/14194e8ce88cdf47/Runtime/Graphics/MatrixStack.cpp line 32]
    49. (Filename: /Applications/buildAgent/work/14194e8ce88cdf47/Runtime/Graphics/MatrixStack.cpp Line: 32)
    50.  
    51. SecurityException: Reading from the screen is not allowed when you have used a downloaded texture without proper crossdomain.xml authorization
    52.   at (wrapper managed-to-native) UnityEngine.Texture2D:INTERNAL_CALL_ReadPixels (UnityEngine.Texture2D,UnityEngine.Rect,int,int,bool)
    53.   at UnityEngine.Texture2D.ReadPixels (Rect source, Int32 destX, Int32 destY) [0x00000] in <filename unknown>:0
    54.   at UnityEditor.PreviewRenderUtility.EndStaticPreview () [0x00000] in <filename unknown>:0
    55.   at UnityEditor.GameObjectInspector.RenderStaticPreview (Int32 width, Int32 height) [0x00000] in <filename unknown>:0
    56.   at UnityEditor.AssetPreviewUpdater.CreatePreviewForAsset (UnityEngine.Object obj) [0x00000] in <filename unknown>:0
    57.   at UnityEditor.AssetPreviewUpdater.GenerateAssetPreview (UnityEngine.Object asset, Int32 isMainAsset) [0x00000] in <filename unknown>:0
    58.  
    59. (Filename:  Line: -1)
    60.  
    61. Matrix stack full depth reached
    62. UnityEngine.GL:PushMatrix()
    63. UnityEditor.SavedRenderTargetState:.ctor()
    64. UnityEditor.PreviewRenderUtility:InitPreview(Rect)
    65. UnityEditor.PreviewRenderUtility:BeginStaticPreview(Rect)
    66. UnityEditor.GameObjectInspector:RenderStaticPreview(Int32, Int32)
    67. UnityEditor.AssetPreviewUpdater:CreatePreviewForAsset(Object)
    68. UnityEditor.AssetPreviewUpdater:GenerateAssetPreview(Object, Int32)
    69.  
    70. [/Applications/buildAgent/work/14194e8ce88cdf47/Runtime/Graphics/MatrixStack.cpp line 32]
    71. (Filename: /Applications/buildAgent/work/14194e8ce88cdf47/Runtime/Graphics/MatrixStack.cpp Line: 32)
    72.  
    73. Matrix stack full depth reached
    74. UnityEngine.GL:PushMatrix()
    75. UnityEditor.SavedRenderTargetState:.ctor()
    76. UnityEditor.PreviewRenderUtility:InitPreview(Rect)
    77. UnityEditor.PreviewRenderUtility:BeginStaticPreview(Rect)
    78. UnityEditor.GameObjectInspector:RenderStaticPreview(Int32, Int32)
    79. UnityEditor.AssetPreviewUpdater:CreatePreviewForAsset(Object)
    80. UnityEditor.AssetPreviewUpdater:GenerateAssetPreview(Object, Int32)
    81.  
    82. [/Applications/buildAgent/work/14194e8ce88cdf47/Runtime/Graphics/MatrixStack.cpp line 32]
    83. (Filename: /Applications/buildAgent/work/14194e8ce88cdf47/Runtime/Graphics/MatrixStack.cpp Line: 32)
    84.  
    85. Matrix stack full depth reached
    86. UnityEngine.GL:PushMatrix()
    87. UnityEditor.SavedRenderTargetState:.ctor()
    88. UnityEditor.PreviewRenderUtility:InitPreview(Rect)
    89. UnityEditor.PreviewRenderUtility:BeginStaticPreview(Rect)
    90. UnityEditor.GameObjectInspector:RenderStaticPreview(Int32, Int32)
    91. UnityEditor.AssetPreviewUpdater:CreatePreviewForAsset(Object)
    92. UnityEditor.AssetPreviewUpdater:GenerateAssetPreview(Object, Int32)
    93.  
    94. [/Applications/buildAgent/work/14194e8ce88cdf47/Runtime/Graphics/MatrixStack.cpp line 32]
    95. (Filename: /Applications/buildAgent/work/14194e8ce88cdf47/Runtime/Graphics/MatrixStack.cpp Line: 32)
    96.  
    97. SecurityException: Reading from the screen is not allowed when you have used a downloaded texture without proper crossdomain.xml authorization
    98.   at (wrapper managed-to-native) UnityEngine.Texture2D:INTERNAL_CALL_ReadPixels (UnityEngine.Texture2D,UnityEngine.Rect,int,int,bool)
    99.   at UnityEngine.Texture2D.ReadPixels (Rect source, Int32 destX, Int32 destY) [0x00000] in <filename unknown>:0
    100.   at UnityEditor.PreviewRenderUtility.EndStaticPreview () [0x00000] in <filename unknown>:0
    101.   at UnityEditor.GameObjectInspector.RenderStaticPreview (Int32 width, Int32 height) [0x00000] in <filename unknown>:0
    102.   at UnityEditor.AssetPreviewUpdater.CreatePreviewForAsset (UnityEngine.Object obj) [0x00000] in <filename unknown>:0
    103.   at UnityEditor.AssetPreviewUpdater.GenerateAssetPreview (UnityEngine.Object asset, Int32 isMainAsset) [0x00000] in <filename unknown>:0
    104.  
    105. (Filename:  Line: -1)
    106.  
    107. Matrix stack full depth reached
    108. UnityEngine.GL:PushMatrix()
    109. UnityEditor.SavedRenderTargetState:.ctor()
    110. UnityEditor.PreviewRenderUtility:InitPreview(Rect)
    111. UnityEditor.PreviewRenderUtility:BeginStaticPreview(Rect)
    112. UnityEditor.GameObjectInspector:RenderStaticPreview(Int32, Int32)
    113. UnityEditor.AssetPreviewUpdater:CreatePreviewForAsset(Object)
    114. UnityEditor.AssetPreviewUpdater:GenerateAssetPreview(Object, Int32)
    115.  
    116. [/Applications/buildAgent/work/14194e8ce88cdf47/Runtime/Graphics/MatrixStack.cpp line 32]
    117. (Filename: /Applications/buildAgent/work/14194e8ce88cdf47/Runtime/Graphics/MatrixStack.cpp Line: 32)
    118.  
    119. Matrix stack full depth reached
    120. UnityEngine.GL:PushMatrix()
    121. UnityEditor.SavedRenderTargetState:.ctor()
    122. UnityEditor.PreviewRenderUtility:InitPreview(Rect)
    123. UnityEditor.PreviewRenderUtility:BeginStaticPreview(Rect)
    124. UnityEditor.GameObjectInspector:RenderStaticPreview(Int32, Int32)
    125. UnityEditor.AssetPreviewUpdater:CreatePreviewForAsset(Object)
    126. UnityEditor.AssetPreviewUpdater:GenerateAssetPreview(Object, Int32)
    127.  
    128. [/Applications/buildAgent/work/14194e8ce88cdf47/Runtime/Graphics/MatrixStack.cpp line 32]
    129. (Filename: /Applications/buildAgent/work/14194e8ce88cdf47/Runtime/Graphics/MatrixStack.cpp Line: 32)
    130.  
    131. Matrix stack full depth reached
    132. UnityEngine.GL:PushMatrix()
    133. UnityEditor.SavedRenderTargetState:.ctor()
    134. UnityEditor.PreviewRenderUtility:InitPreview(Rect)
    135. UnityEditor.PreviewRenderUtility:BeginStaticPreview(Rect)
    136. UnityEditor.GameObjectInspector:RenderStaticPreview(Int32, Int32)
    137. UnityEditor.AssetPreviewUpdater:CreatePreviewForAsset(Object)
    138. UnityEditor.AssetPreviewUpdater:GenerateAssetPreview(Object, Int32)
    139.  
    140. [/Applications/buildAgent/work/14194e8ce88cdf47/Runtime/Graphics/MatrixStack.cpp line 32]
    141. (Filename: /Applications/buildAgent/work/14194e8ce88cdf47/Runtime/Graphics/MatrixStack.cpp Line: 32)
    142.  
    143. SecurityException: Reading from the screen is not allowed when you have used a downloaded texture without proper crossdomain.xml authorization
    144.   at (wrapper managed-to-native) UnityEngine.Texture2D:INTERNAL_CALL_ReadPixels (UnityEngine.Texture2D,UnityEngine.Rect,int,int,bool)
    145.   at UnityEngine.Texture2D.ReadPixels (Rect source, Int32 destX, Int32 destY) [0x00000] in <filename unknown>:0
    146.   at UnityEditor.PreviewRenderUtility.EndStaticPreview () [0x00000] in <filename unknown>:0
    147.   at UnityEditor.GameObjectInspector.RenderStaticPreview (Int32 width, Int32 height) [0x00000] in <filename unknown>:0
    148.   at UnityEditor.AssetPreviewUpdater.CreatePreviewForAsset (UnityEngine.Object obj) [0x00000] in <filename unknown>:0
    149.   at UnityEditor.AssetPreviewUpdater.GenerateAssetPreview (UnityEngine.Object asset, Int32 isMainAsset) [0x00000] in <filename unknown>:0
    150.  
    151. (Filename:  Line: -1)
    152.  
    153. Matrix stack full depth reached
    154. UnityEngine.GL:PushMatrix()
    155. UnityEditor.SavedRenderTargetState:.ctor()
    156. UnityEditor.PreviewRenderUtility:InitPreview(Rect)
    157. UnityEditor.PreviewRenderUtility:BeginStaticPreview(Rect)
    158. UnityEditor.GameObjectInspector:RenderStaticPreview(Int32, Int32)
    159. UnityEditor.AssetPreviewUpdater:CreatePreviewForAsset(Object)
    160. UnityEditor.AssetPreviewUpdater:GenerateAssetPreview(Object, Int32)
    161.  
    162. [/Applications/buildAgent/work/14194e8ce88cdf47/Runtime/Graphics/MatrixStack.cpp line 32]
    163. (Filename: /Applications/buildAgent/work/14194e8ce88cdf47/Runtime/Graphics/MatrixStack.cpp Line: 32)
    164.  
    165. Matrix stack full depth reached
    166. UnityEngine.GL:PushMatrix()
    167. UnityEditor.SavedRenderTargetState:.ctor()
    168. UnityEditor.PreviewRenderUtility:InitPreview(Rect)
    169. UnityEditor.PreviewRenderUtility:BeginStaticPreview(Rect)
    170. UnityEditor.GameObjectInspector:RenderStaticPreview(Int32, Int32)
    171. UnityEditor.AssetPreviewUpdater:CreatePreviewForAsset(Object)
    172. UnityEditor.AssetPreviewUpdater:GenerateAssetPreview(Object, Int32)
    173.  
    174. [/Applications/buildAgent/work/14194e8ce88cdf47/Runtime/Graphics/MatrixStack.cpp line 32]
    175. (Filename: /Applications/buildAgent/work/14194e8ce88cdf47/Runtime/Graphics/MatrixStack.cpp Line: 32)
    176.  
    177. Matrix stack full depth reached
    178. UnityEngine.GL:PushMatrix()
    179. UnityEditor.SavedRenderTargetState:.ctor()
    180. UnityEditor.PreviewRenderUtility:InitPreview(Rect)
    181. UnityEditor.PreviewRenderUtility:BeginStaticPreview(Rect)
    182. UnityEditor.GameObjectInspector:RenderStaticPreview(Int32, Int32)
    183. UnityEditor.AssetPreviewUpdater:CreatePreviewForAsset(Object)
    184. UnityEditor.AssetPreviewUpdater:GenerateAssetPreview(Object, Int32)
    185.  
    186. [/Applications/buildAgent/work/14194e8ce88cdf47/Runtime/Graphics/MatrixStack.cpp line 32]
    187. (Filename: /Applications/buildAgent/work/14194e8ce88cdf47/Runtime/Graphics/MatrixStack.cpp Line: 32)
    188.  
    189. SecurityException: Reading from the screen is not allowed when you have used a downloaded texture without proper crossdomain.xml authorization
    190.   at (wrapper managed-to-native) UnityEngine.Texture2D:INTERNAL_CALL_ReadPixels (UnityEngine.Texture2D,UnityEngine.Rect,int,int,bool)
    191.   at UnityEngine.Texture2D.ReadPixels (Rect source, Int32 destX, Int32 destY) [0x00000] in <filename unknown>:0
    192.   at UnityEditor.PreviewRenderUtility.EndStaticPreview () [0x00000] in <filename unknown>:0
    193.   at UnityEditor.GameObjectInspector.RenderStaticPreview (Int32 width, Int32 height) [0x00000] in <filename unknown>:0
    194.   at UnityEditor.AssetPreviewUpdater.CreatePreviewForAsset (UnityEngine.Object obj) [0x00000] in <filename unknown>:0
    195.   at UnityEditor.AssetPreviewUpdater.GenerateAssetPreview (UnityEngine.Object asset, Int32 isMainAsset) [0x00000] in <filename unknown>:0
    196.  
    197. (Filename:  Line: -1)
    198.  
    199. Matrix stack full depth reached
    200. UnityEngine.GL:PushMatrix()
    201. UnityEditor.SavedRenderTargetState:.ctor()
    202. UnityEditor.PreviewRenderUtility:InitPreview(Rect)
    203. UnityEditor.PreviewRenderUtility:BeginStaticPreview(Rect)
    204. UnityEditor.GameObjectInspector:RenderStaticPreview(Int32, Int32)
    205. UnityEditor.AssetPreviewUpdater:CreatePreviewForAsset(Object)
    206. UnityEditor.AssetPreviewUpdater:GenerateAssetPreview(Object, Int32)
    207.  
    208. [/Applications/buildAgent/work/14194e8ce88cdf47/Runtime/Graphics/MatrixStack.cpp line 32]
    209. (Filename: /Applications/buildAgent/work/14194e8ce88cdf47/Runtime/Graphics/MatrixStack.cpp Line: 32)
    210.  
    211. Matrix stack full depth reached
    212. UnityEngine.GL:PushMatrix()
    213. UnityEditor.SavedRenderTargetState:.ctor()
    214. UnityEditor.PreviewRenderUtility:InitPreview(Rect)
    215. UnityEditor.PreviewRenderUtility:BeginStaticPreview(Rect)
    216. UnityEditor.GameObjectInspector:RenderStaticPreview(Int32, Int32)
    217. UnityEditor.AssetPreviewUpdater:CreatePreviewForAsset(Object)
    218. UnityEditor.AssetPreviewUpdater:GenerateAssetPreview(Object, Int32)
    219.  
    220. [/Applications/buildAgent/work/14194e8ce88cdf47/Runtime/Graphics/MatrixStack.cpp line 32]
    221. (Filename: /Applications/buildAgent/work/14194e8ce88cdf47/Runtime/Graphics/MatrixStack.cpp Line: 32)
    222.  
    223. Matrix stack full depth reached
    224. UnityEngine.GL:PushMatrix()
    225. UnityEditor.SavedRenderTargetState:.ctor()
    226. UnityEditor.PreviewRenderUtility:InitPreview(Rect)
    227. UnityEditor.PreviewRenderUtility:BeginStaticPreview(Rect)
    228. UnityEditor.GameObjectInspector:RenderStaticPreview(Int32, Int32)
    229. UnityEditor.AssetPreviewUpdater:CreatePreviewForAsset(Object)
    230. UnityEditor.AssetPreviewUpdater:GenerateAssetPreview(Object, Int32)
    231.  
    232. [/Applications/buildAgent/work/14194e8ce88cdf47/Runtime/Graphics/MatrixStack.cpp line 32]
    233. (Filename: /Applications/buildAgent/work/14194e8ce88cdf47/Runtime/Graphics/MatrixStack.cpp Line: 32)
    234.  
    235. SecurityException: Reading from the screen is not allowed when you have used a downloaded texture without proper crossdomain.xml authorization
    236.   at (wrapper managed-to-native) UnityEngine.Texture2D:INTERNAL_CALL_ReadPixels (UnityEngine.Texture2D,UnityEngine.Rect,int,int,bool)
    237.   at UnityEngine.Texture2D.ReadPixels (Rect source, Int32 destX, Int32 destY) [0x00000] in <filename unknown>:0
    238.   at UnityEditor.PreviewRenderUtility.EndStaticPreview () [0x00000] in <filename unknown>:0
    239.   at UnityEditor.GameObjectInspector.RenderStaticPreview (Int32 width, Int32 height) [0x00000] in <filename unknown>:0
    240.   at UnityEditor.AssetPreviewUpdater.CreatePreviewForAsset (UnityEngine.Object obj) [0x00000] in <filename unknown>:0
    241.   at UnityEditor.AssetPreviewUpdater.GenerateAssetPreview (UnityEngine.Object asset, Int32 isMainAsset) [0x00000] in <filename unknown>:0
    242.  
    243. (Filename:  Line: -1)
    244.  
    245. Matrix stack full depth reached
    246. UnityEngine.GL:PushMatrix()
    247. UnityEditor.SavedRenderTargetState:.ctor()
    248. UnityEditor.PreviewRenderUtility:InitPreview(Rect)
    249. UnityEditor.PreviewRenderUtility:BeginStaticPreview(Rect)
    250. UnityEditor.GameObjectInspector:RenderStaticPreview(Int32, Int32)
    251. UnityEditor.AssetPreviewUpdater:CreatePreviewForAsset(Object)
    252. UnityEditor.AssetPreviewUpdater:GenerateAssetPreview(Object, Int32)
    253.  
    254. [/Applications/buildAgent/work/14194e8ce88cdf47/Runtime/Graphics/MatrixStack.cpp line 32]
    255. (Filename: /Applications/buildAgent/work/14194e8ce88cdf47/Runtime/Graphics/MatrixStack.cpp Line: 32)
    256.  
    257. Matrix stack full depth reached
    258. UnityEngine.GL:PushMatrix()
    259. UnityEditor.SavedRenderTargetState:.ctor()
    260. UnityEditor.PreviewRenderUtility:InitPreview(Rect)
    261. UnityEditor.PreviewRenderUtility:BeginStaticPreview(Rect)
    262. UnityEditor.GameObjectInspector:RenderStaticPreview(Int32, Int32)
    263. UnityEditor.AssetPreviewUpdater:CreatePreviewForAsset(Object)
    264. UnityEditor.AssetPreviewUpdater:GenerateAssetPreview(Object, Int32)
    265.  
    266. [/Applications/buildAgent/work/14194e8ce88cdf47/Runtime/Graphics/MatrixStack.cpp line 32]
    267. (Filename: /Applications/buildAgent/work/14194e8ce88cdf47/Runtime/Graphics/MatrixStack.cpp Line: 32)
    268.  
    269. Matrix stack full depth reached
    270. UnityEngine.GL:PushMatrix()
    271. UnityEditor.SavedRenderTargetState:.ctor()
    272. UnityEditor.PreviewRenderUtility:InitPreview(Rect)
    273. UnityEditor.PreviewRenderUtility:BeginStaticPreview(Rect)
    274. UnityEditor.GameObjectInspector:RenderStaticPreview(Int32, Int32)
    275. UnityEditor.AssetPreviewUpdater:CreatePreviewForAsset(Object)
    276. UnityEditor.AssetPreviewUpdater:GenerateAssetPreview(Object, Int32)
    277.  
    278. [/Applications/buildAgent/work/14194e8ce88cdf47/Runtime/Graphics/MatrixStack.cpp line 32]
    279. (Filename: /Applications/buildAgent/work/14194e8ce88cdf47/Runtime/Graphics/MatrixStack.cpp Line: 32)
    280.  
    281. SecurityException: Reading from the screen is not allowed when you have used a downloaded texture without proper crossdomain.xml authorization
    282.   at (wrapper managed-to-native) UnityEngine.Texture2D:INTERNAL_CALL_ReadPixels (UnityEngine.Texture2D,UnityEngine.Rect,int,int,bool)
    283.   at UnityEngine.Texture2D.ReadPixels (Rect source, Int32 destX, Int32 destY) [0x00000] in <filename unknown>:0
    284.   at UnityEditor.PreviewRenderUtility.EndStaticPreview () [0x00000] in <filename unknown>:0
    285.   at UnityEditor.GameObjectInspector.RenderStaticPreview (Int32 width, Int32 height) [0x00000] in <filename unknown>:0
    286.   at UnityEditor.AssetPreviewUpdater.CreatePreviewForAsset (UnityEngine.Object obj) [0x00000] in <filename unknown>:0
    287.   at UnityEditor.AssetPreviewUpdater.GenerateAssetPreview (UnityEngine.Object asset, Int32 isMainAsset) [0x00000] in <filename unknown>:0
    288.  
    289. (Filename:  Line: -1)
    290.  
    291. Matrix stack full depth reached
    292. UnityEngine.GL:PushMatrix()
    293. UnityEditor.SavedRenderTargetState:.ctor()
    294. UnityEditor.PreviewRenderUtility:InitPreview(Rect)
    295. UnityEditor.PreviewRenderUtility:BeginStaticPreview(Rect)
    296. UnityEditor.GameObjectInspector:RenderStaticPreview(Int32, Int32)
    297. UnityEditor.AssetPreviewUpdater:CreatePreviewForAsset(Object)
    298. UnityEditor.AssetPreviewUpdater:GenerateAssetPreview(Object, Int32)
    299.  
    300. [/Applications/buildAgent/work/14194e8ce88cdf47/Runtime/Graphics/MatrixStack.cpp line 32]
    301. (Filename: /Applications/buildAgent/work/14194e8ce88cdf47/Runtime/Graphics/MatrixStack.cpp Line: 32)
    302.  
    303. Matrix stack full depth reached
    304. UnityEngine.GL:PushMatrix()
    305. UnityEditor.SavedRenderTargetState:.ctor()
    306. UnityEditor.PreviewRenderUtility:InitPreview(Rect)
    307. UnityEditor.PreviewRenderUtility:BeginStaticPreview(Rect)
    308. UnityEditor.GameObjectInspector:RenderStaticPreview(Int32, Int32)
    309. UnityEditor.AssetPreviewUpdater:CreatePreviewForAsset(Object)
    310. UnityEditor.AssetPreviewUpdater:GenerateAssetPreview(Object, Int32)
    311.  
    312. [/Applications/buildAgent/work/14194e8ce88cdf47/Runtime/Graphics/MatrixStack.cpp line 32]
    313. (Filename: /Applications/buildAgent/work/14194e8ce88cdf47/Runtime/Graphics/MatrixStack.cpp Line: 32)
    314.  
    315. Matrix stack full depth reached
    316. UnityEngine.GL:PushMatrix()
    317. UnityEditor.SavedRenderTargetState:.ctor()
    318. UnityEditor.PreviewRenderUtility:InitPreview(Rect)
    319. UnityEditor.PreviewRenderUtility:BeginStaticPreview(Rect)
    320. UnityEditor.GameObjectInspector:RenderStaticPreview(Int32, Int32)
    321. UnityEditor.AssetPreviewUpdater:CreatePreviewForAsset(Object)
    322. UnityEditor.AssetPreviewUpdater:GenerateAssetPreview(Object, Int32)
    323.  
    324. [/Applications/buildAgent/work/14194e8ce88cdf47/Runtime/Graphics/MatrixStack.cpp line 32]
    325. (Filename: /Applications/buildAgent/work/14194e8ce88cdf47/Runtime/Graphics/MatrixStack.cpp Line: 32)
    326.  
    327. SecurityException: Reading from the screen is not allowed when you have used a downloaded texture without proper crossdomain.xml authorization
    328.   at (wrapper managed-to-native) UnityEngine.Texture2D:INTERNAL_CALL_ReadPixels (UnityEngine.Texture2D,UnityEngine.Rect,int,int,bool)
    329.   at UnityEngine.Texture2D.ReadPixels (Rect source, Int32 destX, Int32 destY) [0x00000] in <filename unknown>:0
    330.   at UnityEditor.PreviewRenderUtility.EndStaticPreview () [0x00000] in <filename unknown>:0
    331.   at UnityEditor.GameObjectInspector.RenderStaticPreview (Int32 width, Int32 height) [0x00000] in <filename unknown>:0
    332.   at UnityEditor.AssetPreviewUpdater.CreatePreviewForAsset (UnityEngine.Object obj) [0x00000] in <filename unknown>:0
    333.   at UnityEditor.AssetPreviewUpdater.GenerateAssetPreview (UnityEngine.Object asset, Int32 isMainAsset) [0x00000] in <filename unknown>:0
    334.  
    335. (Filename:  Line: -1)
    336.  
    337.  done. [Time: 207.419800 ms]
    338. Updating Assets/#Project/OLDGUI/HUD Objects/CursorObject/Materials/CursorMat.mat - GUID: 20d1028baaf46474a8140029d396785f...
    339. Matrix stack full depth reached
    340. UnityEngine.GL:PushMatrix()
    341. UnityEditor.SavedRenderTargetState:.ctor()
    342. UnityEditor.PreviewRenderUtility:InitPreview(Rect)
    343. UnityEditor.PreviewRenderUtility:BeginStaticPreview(Rect)
    344. UnityEditor.MaterialEditor:RenderStaticPreview(Int32, Int32)
    345. UnityEditor.AssetPreviewUpdater:CreatePreviewForAsset(Object)
    346. UnityEditor.AssetPreviewUpdater:GenerateAssetPreview(Object, Int32)
    347.  
    348. [/Applications/buildAgent/work/14194e8ce88cdf47/Runtime/Graphics/MatrixStack.cpp line 32]
    349. (Filename: /Applications/buildAgent/work/14194e8ce88cdf47/Runtime/Graphics/MatrixStack.cpp Line: 32)
    350.  
    351. Matrix stack full depth reached
    352. UnityEngine.GL:PushMatrix()
    353. UnityEditor.SavedRenderTargetState:.ctor()
    354. UnityEditor.PreviewRenderUtility:InitPreview(Rect)
    355. UnityEditor.PreviewRenderUtility:BeginStaticPreview(Rect)
    356. UnityEditor.MaterialEditor:RenderStaticPreview(Int32, Int32)
    357. UnityEditor.AssetPreviewUpdater:CreatePreviewForAsset(Object)
    358. UnityEditor.AssetPreviewUpdater:GenerateAssetPreview(Object, Int32)
    359.  
    360. [/Applications/buildAgent/work/14194e8ce88cdf47/Runtime/Graphics/MatrixStack.cpp line 32]
    361. (Filename: /Applications/buildAgent/work/14194e8ce88cdf47/Runtime/Graphics/MatrixStack.cpp Line: 32)
    362.  
    363. Matrix stack full depth reached
    364. UnityEngine.GL:PushMatrix()
    365. UnityEditor.SavedRenderTargetState:.ctor()
    366. UnityEditor.PreviewRenderUtility:InitPreview(Rect)
    367. UnityEditor.PreviewRenderUtility:BeginStaticPreview(Rect)
    368. UnityEditor.MaterialEditor:RenderStaticPreview(Int32, Int32)
    369. UnityEditor.AssetPreviewUpdater:CreatePreviewForAsset(Object)
    370. UnityEditor.AssetPreviewUpdater:GenerateAssetPreview(Object, Int32)
    371.  
    372. [/Applications/buildAgent/work/14194e8ce88cdf47/Runtime/Graphics/MatrixStack.cpp line 32]
    373. (Filename: /Applications/buildAgent/work/14194e8ce88cdf47/Runtime/Graphics/MatrixStack.cpp Line: 32)
    374.  
    375. SecurityException: Reading from the screen is not allowed when you have used a downloaded texture without proper crossdomain.xml authorization
    376.   at (wrapper managed-to-native) UnityEngine.Texture2D:INTERNAL_CALL_ReadPixels (UnityEngine.Texture2D,UnityEngine.Rect,int,int,bool)
    377.   at UnityEngine.Texture2D.ReadPixels (Rect source, Int32 destX, Int32 destY) [0x00000] in <filename unknown>:0
    378.   at UnityEditor.PreviewRenderUtility.EndStaticPreview () [0x00000] in <filename unknown>:0
    379.   at UnityEditor.MaterialEditor.RenderStaticPreview (Int32 width, Int32 height) [0x00000] in <filename unknown>:0
    380.   at UnityEditor.AssetPreviewUpdater.CreatePreviewForAsset (UnityEngine.Object obj) [0x00000] in <filename unknown>:0
    381.   at UnityEditor.AssetPreviewUpdater.GenerateAssetPreview (UnityEngine.Object asset, Int32 isMainAsset) [0x00000] in <filename unknown>:0
    382.  
    383. (Filename:  Line: -1)
    384.  
    385.  done. [Time: 3.364088 ms]
    386. ----- Total AssetImport time: 0.463212s, Asset Import only: 0.255861s, CacheServerIntegrate only: 0.000000s, CacheMove: 0.000000s, CacheDelete: 0.000000s, CacheServer Download: 0.000000s [0 B, nan mb/s], CacheServer Hashing: 0.000000s [0 B, nan mb/s]
    387. Cleaning up leaked objects in scene since no game object, component or manager is referencing them
    388.  Texture2D has been leaked 9 times.
    389.  
    390. (Filename: /Applications/buildAgent/work/14194e8ce88cdf47/Editor/Src/BuildPipeline/BuildSerialization.cpp Line: 361)
    391.  
    392. Updating Assets/Scenes/Level 4.unity - GUID: cebbec0a25e784d05b57da40d024835e...
    393.  done. [Time: 2.214954 ms]
    394. ----- Total AssetImport time: 0.077380s, Asset Import only: 0.060302s, CacheServerIntegrate only: 0.000000s, CacheMove: 0.000000s, CacheDelete: 0.000000s, CacheServer Download: 0.000000s [0 B, nan mb/s], CacheServer Hashing: 0.000000s [0 B, nan mb/s]
    395. Matrix stack full depth reached
    396. UnityEngine.GL:PushMatrix()
    397. UnityEditor.Handles:DrawPolyLine(Vector3[])
    398. UnityEditor.Handles:DrawWireArc(Vector3, Vector3, Vector3, Single, Single)
    399. UnityEditorInternal.Disc:Do(Int32, Quaternion, Vector3, Vector3, Single, Boolean, Single)
    400. UnityEditor.Handles:Disc(Quaternion, Vector3, Vector3, Single, Boolean, Single)
    401. UnityEditor.Handles:DoRotationHandle(Quaternion, Vector3)
    402. UnityEditor.Handles:RotationHandle(Quaternion, Vector3)
    403. UnityEditor.RotateTool:OnGUI()
    404. UnityEditor.SceneView:DefaultHandles()
    405. UnityEditor.SceneView:OnGUI()
    406. System.Reflection.MonoMethod:InternalInvoke(Object, Object[], Exception)
    407. System.Reflection.MonoMethod:Invoke(Object, BindingFlags, Binder, Object[], CultureInfo)
    408. System.Reflection.MethodBase:Invoke(Object, Object[])
    409. UnityEditor.HostView:Invoke(String, Object)
    410. UnityEditor.HostView:Invoke(String)
    411. UnityEditor.DockArea:OnGUI()
    412.  
    413. [/Applications/buildAgent/work/14194e8ce88cdf47/Runtime/Graphics/MatrixStack.cpp line 32]
    414. (Filename: /Applications/buildAgent/work/14194e8ce88cdf47/Runtime/Graphics/MatrixStack.cpp Line: 32)
    415.  
    416. Matrix stack full depth reached
    417. UnityEngine.GL:PushMatrix()
    418. UnityEditor.Handles:DrawPolyLine(Vector3[])
    419. UnityEditor.Handles:DrawWireArc(Vector3, Vector3, Vector3, Single, Single)
    420. UnityEditorInternal.Disc:Do(Int32, Quaternion, Vector3, Vector3, Single, Boolean, Single)
    421. UnityEditor.Handles:Disc(Quaternion, Vector3, Vector3, Single, Boolean, Single)
    422. UnityEditor.Handles:DoRotationHandle(Quaternion, Vector3)
    423. UnityEditor.Handles:RotationHandle(Quaternion, Vector3)
    424. UnityEditor.RotateTool:OnGUI()
    425. UnityEditor.SceneView:DefaultHandles()
    426. UnityEditor.SceneView:OnGUI()
    427. System.Reflection.MonoMethod:InternalInvoke(Object, Object[], Exception)
    428. System.Reflection.MonoMethod:Invoke(Object, BindingFlags, Binder, Object[], CultureInfo)
    429. System.Reflection.MethodBase:Invoke(Object, Object[])
    430. UnityEditor.HostView:Invoke(String, Object)
    431. UnityEditor.HostView:Invoke(String)
    432. UnityEditor.DockArea:OnGUI()
    433.  
    434. [/Applications/buildAgent/work/14194e8ce88cdf47/Runtime/Graphics/MatrixStack.cpp line 32]
    435. (Filename: /Applications/buildAgent/work/14194e8ce88cdf47/Runtime/Graphics/MatrixStack.cpp Line: 32)
    436.  
    437. Matrix stack full depth reached
    438. UnityEngine.GL:PushMatrix()
    439. UnityEditor.Handles:DrawPolyLine(Vector3[])
    440. UnityEditor.Handles:DrawWireArc(Vector3, Vector3, Vector3, Single, Single)
    441. UnityEditorInternal.Disc:Do(Int32, Quaternion, Vector3, Vector3, Single, Boolean, Single)
    442. UnityEditor.Handles:Disc(Quaternion, Vector3, Vector3, Single, Boolean, Single)
    443. UnityEditor.Handles:DoRotationHandle(Quaternion, Vector3)
    444. UnityEditor.Handles:RotationHandle(Quaternion, Vector3)
    445. UnityEditor.RotateTool:OnGUI()
    446. UnityEditor.SceneView:DefaultHandles()
    447. UnityEditor.SceneView:OnGUI()
    448. System.Reflection.MonoMethod:InternalInvoke(Object, Object[], Exception)
    449. System.Reflection.MonoMethod:Invoke(Object, BindingFlags, Binder, Object[], CultureInfo)
    450. System.Reflection.MethodBase:Invoke(Object, Object[])
    451. UnityEditor.HostView:Invoke(String, Object)
    452. UnityEditor.HostView:Invoke(String)
    453. UnityEditor.DockArea:OnGUI()
    454.  
    455. [/Applications/buildAgent/work/14194e8ce88cdf47/Runtime/Graphics/MatrixStack.cpp line 32]
    456. (Filename: /Applications/buildAgent/work/14194e8ce88cdf47/Runtime/Graphics/MatrixStack.cpp Line: 32)
    457. */
     
    Last edited: Nov 11, 2012
  2. Alec-Slayden

    Alec-Slayden

    Joined:
    Dec 16, 2008
    Posts:
    94
    As an update, These errors are getting thrown more often, and I've found that I can reproduce them every time I apply changes to a certain prefab. This prefab is used 40 times in the scene, and uses several icons for objects. It also has 100 planes with alpha textures per prefab.

    When I hit apply, the errors are thrown, there is a brief period of unity hanging, and then the inspector hangs indefinitely, with a chance of working again each time I select a different object. This is now starting to disrupt my development. I plan to swap out the 100 planes with alphas with low-poly geometry instead, and hope that helps.
     
  3. KarolD

    KarolD

    Joined:
    Oct 23, 2012
    Posts:
    12
    Hello,
    Have you solved it ? I'm getting the same thing..
     
  4. Loius

    Loius

    Joined:
    Aug 16, 2012
    Posts:
    546
    How deep is your hierarchy? This sounds like you've got hundreds of levels or something. Spread it out more, see if that helps.

    We can help more if we see the WWW code snippet and exactly how the texture is being used. Unity might be getting confused about some weird thing.
     
  5. Alec-Slayden

    Alec-Slayden

    Joined:
    Dec 16, 2008
    Posts:
    94
    Unfortunately no, I haven't found a solution yet. I submitted the project a long with a report to support, but the project is over 1 GB in size, so it is too big for them to help with. Until I find the time to cut it down and search it out myself, I suspect a solution will elude me.

    The deepest the hierarchy goes is maybe 7 children deep. Most of the 'deep' hierarchies I have in the scene are 4 or 5, the same with the project folders.

    Here's the WWW code snippet. It's very basic, and the error seems to be from the UnityEditor, so unless something is accessing this in edit mode I would be very surprised if this is the source of the problem. I've received the error while my custom editors were commented out (none of which access this method), and I checked to ensure it wasn't attributed "ExecuteInEditMode".

    Code (csharp):
    1. public IEnumerator LoadURLImageIntoTex(string url, GameObject thisObj) {
    2.        
    3.         thisObj.guiTexture.texture = loadingPlaceholder;
    4.        
    5.         if ( !VerifyURL( url ) ) yield break;   // make sure it's a valid url string
    6.        
    7.         WWW www = new WWW(url);
    8.         yield return www;      
    9.  
    10.         if (www.error == null) {
    11.             thisObj.gameObject.guiTexture.texture = www.texture;
    12.         }
    13.  
    14.     }
    Thats the only place the project is accessing the web in our code. The VerifyURL method is just a quick check for url elements as such:

    Code (csharp):
    1. bool VerifyURL(string imageURL){
    2.         if (imageURL == null || !imageURL.Contains ("http") || !imageURL.Contains ("www") || !imageURL.Contains ("/") ) {
    3.             return false;
    4.         }  
    5.        
    6.         return true;
    7.     }
    (sorry the if condition is a little spaghetti)
    Thanks for the response!
     
    Last edited: Dec 17, 2012
  6. Alec-Slayden

    Alec-Slayden

    Joined:
    Dec 16, 2008
    Posts:
    94
    Recently the error has been a bit more sparse, but seems to reliably occur when I enable guiTextures that load images from the web using the previously posted code. Maybe the asset preview doesn't 'forget' the loaded images. I've tried resetting them on application quit to a placeholder, but this doesn't seem to help.

    Specifically the error frequently pops up after viewing the guiTextures in-game, stopping play, and then saving the scene / project.
     
  7. MichiealO

    MichiealO

    Joined:
    Jul 7, 2013
    Posts:
    61
    I am getting this same error... I don't have too deep (child layers), but I am getting both the "Matrix stack full depth reached" and the "SecurityException: Reading from the screen is not allowed when you have used a downloaded texture without proper crossdomain.xml authorization" issue. The game builds runs fine, but.... ???
    To my, I get them mostly in the UnityEditor, and I have the latest version (at the time of writing) 4.2.1f something.
    The security error only started right after I added in the Security check, because I am making a WebPlayer version of my game.
    They always show up together, and they are most puzzling.

    If anyone has a clue, please... Post the answer.
    Thank you in advance for any help that you might give.
     
  8. frogsbo

    frogsbo

    Joined:
    Jan 16, 2014
    Posts:
    79
    I have the same error, it is related to OnGUI, and i was curious as to what it means. It happens when i edit OnGUI code with various dependency levels of variables being parsed from a string and being used to position etc gui textfields etc, while in play mode. I wrote some random noob parsing code for ongui settings variables, and have various variables initialised at startup... i know that when it recompiles the code while playine, the initial variables can become null even though the gui is running. It could be also either the parse command receiving a null value, and returning a .net framework error message, or a ongui call error. gl:pushmatrix sounds like gui info?

    Matrix stack full depth reached
    UnityEngine.GL:pushMatrix()

    and this error:

    Matrix stack full depth reached
    UnityEditor.DockArea:OnGUI()

    both from updating code while parsed string complex gui is running.

    http://docs.unity3d.com/ScriptReference/GL.PushMatrix.html
     
    Last edited: Aug 6, 2014
  9. mstar_jwoodall

    mstar_jwoodall

    Joined:
    Sep 17, 2015
    Posts:
    2
    I am also having this issue, I don't know how to fix it, but I can better explain where it happens:

    In one of our scenes I call:
    takenImg.sprite = questionSprite;

    questionSprite is a Sprite2D set in the editor.

    When this scene quits, Unity appears to destroy the actual sprite (or at least all references to it), so in the Editor if you click on the sprite object in Project View you will see the "Matrix stack full depth reached" error in console.

    I have also had this issue when using a sprite loaded from an atlas, and in that case it actually corrupts the entire atlas.

    no idea how to fix, and only occurs in this one scene, and no other place in the code.