Getting 'PlayerLoop called recursively!' and WebPlayer Crashes (Works on Standalone)

Getting ‘PlayerLoop called recursively!’ and WebPlayer Crashes (Works on Standalone)

Hey all,

I have an application, it’s like a 3d chat.
It works perfectly in PC and Mac Standalone mode, but as soon as I try the webPlayer, it all works until I walk around, then in about 10 seconds, or less, it crashes with the ‘PlayerLoop called recursively!’ error in the webplayer log.

All the other features work, and if i dont move, it will run without any issues, but after movement, it will crash everytime.
I tried Firefox and IE with my PC, and Safari on my mac, but they all crash the same.

I am using the latest unity version,

Im missing a major opportunity as a huge company wants to use it, and I will be advertise the full pc and mac version from it, and they will send the traffic to it, but I can’t get it working, and they are starting to get impatient and will pass soon if I cant get it working.

I read that someone upgrade the mono version to 2.8, and the problem went away for them, but im not sure how to even do that with unity and override the installed version, of if its possible.

Here is the web player log (I removed duplicate lines as there were 1000s of the loop errors, etc…)

Can anyone help me here?
Paid help, whatever, I’m totally hosed here …

110506 20:28:00 ------------------------------------------------------------
110506 20:28:00 Instance starting, version 3.3.0f4_63135
110506 20:28:00 Datafile file:///C:/Users/tecstar/Desktop/test/WebPlayer/WebPlayer.unity3d
web: player version 3.3.0f4
Direct3D:
    Version:  Direct3D 9.0c [nvd3dum.dll 8.17.12.6099]
    Renderer: NVIDIA GeForce 9800 GT  
    Vendor:   NVIDIA
    VRAM:     1024 MB
    Caps:     Shader=30 DepthRT=1 NativeDepth=1 NativeShadow=1 DF16=0 DF24=0 INTZ=1 RAWZ=0 NULL=1 RESZ=0 SlowINTZ=0
web: load mono
Mono path[0] = 'C:/Users/tecstar/AppData/LocalLow/Unity/WebPlayer/player/3.x.x/Data/lib'
Mono path[1] = 'C:/Users/tecstar/AppData/LocalLow/Unity/WebPlayer/mono/3.x.x/Data/lib'
web: start, src=WebPlayer.unity3d abs=file:///C:/Users/tecstar/Desktop/test/WebPlayer/WebPlayer.unity3d
Player: init engine
Your 64 bit Windows installation is missing an imporant service pack patch. Please apply http://support.microsoft.com/kb/976038 to ensure stability.
 
(Filename: C:/BuildAgent/work/6bc5f79e0a4296d6/PlatformDependent/Win/wow64.cpp Line: 42)

web: sucessfully initialized
110506 20:28:00 loader: start ok
web: parent window change: e5504 1024x768
110506 20:28:04 Times: download 0.6 load 3.7
Platform assembly: C:\Users\tecstar\AppData\LocalLow\Unity\WebPlayer\player\3.x.x\Data\lib\UnityEngine.dll (this message is harmless)
Non platform assembly: data-086157A0 (this message is harmless)
Non platform assembly: data-08631190 (this message is harmless)
Non platform assembly: data-08636C00 (this message is harmless)
Non platform assembly: data-08644648 (this message is harmless)
Non platform assembly: data-0865A290 (this message is harmless)
Non platform assembly: data-0FA40048 (this message is harmless)
Non platform assembly: data-0FC40020 (this message is harmless)
Non platform assembly: data-086820F8 (this message is harmless)
<I> Initializing (RawInput).

<RI> Input initialized.

desktop: 1920x1200 59Hz; virtual: 1920x1200 at 0,0
Platform assembly: C:\Users\tecstar\AppData\LocalLow\Unity\WebPlayer\mono\3.x.x\Data\lib\System.dll (this message is harmless)
Platform assembly: C:\Users\tecstar\AppData\LocalLow\Unity\WebPlayer\player\3.x.x\Data\lib\CrossDomainPolicyParser.dll (this message is harmless)
SocketPolicyClient1: Incoming GetPolicyStreamForIP

SocketPolicyClient1: About to BeginConnect to 74.208.97.71:9339

SocketPolicyClient1: About to WaitOne

SocketPolicyClient1: Socket connected

trevor
UnityEngine.Debug:Internal_Log(Int32, String, Object)
UnityEngine.Debug:Log(Object)
SFSLogin:SFSJoinVFF()
SFSLogin:FixedUpdate()
 
(Filename: C:/BuildAgent/work/6bc5f79e0a4296d6/Runtime/ExportGenerated/WebPlayer/BaseClass.cpp Line: 2505)


Unloading 1 unused Assets to reduce memory usage. Loaded Objects now: 1457.
Unloading 1 Unused Serialized files (Serialized files now loaded: 9 / Dirty serialized files: 0)
Male/Clothing/Jacket/Jacket000
UnityEngine.Debug:Internal_Log(Int32, String, Object)
UnityEngine.Debug:Log(Object)
Look:Setup()
Look:CallSetup(Int32, Int32, Int32, Int32)
AvatarLogic:SetupAvatar(Array)
UnityEngine.GameObject:SendMessage(String, Object, SendMessageOptions)
UnityEngine.GameObject:SendMessage(String, Object)
MainMenu:SetUpAvatar(Boolean)
MainMenu:Start()

 
(Filename: C:/BuildAgent/work/6bc5f79e0a4296d6/Runtime/ExportGenerated/WebPlayer/BaseClass.cpp Line: 2505)


Unloading 180 unused Assets to reduce memory usage. Loaded Objects now: 3139.
Unloading 1 Unused Serialized files (Serialized files now loaded: 9 / Dirty serialized files: 0)
Connected !
UnityEngine.Debug:Internal_Log(Int32, String, Object)
UnityEngine.Debug:Log(Object)
NetworkController:OnJoinRoom(Room)
SmartFoxClientAPI.SmartFoxClient:_DispatchEvent(SFSEvent)
SmartFoxClientAPI.SmartFoxClient:ProcessEventQueue()
NetworkController:FixedUpdate()
 
(Filename: C:/BuildAgent/work/6bc5f79e0a4296d6/Runtime/ExportGenerated/WebPlayer/BaseClass.cpp Line: 2505)

MethodAccessException: Attempt to access a private/protected method failed.
  at System.Security.SecurityManager.ThrowException (System.Exception ex) [0x00000] in <filename unknown>:0 

  at SmartFoxClientAPI.Util.SFSObjectSerializer.Obj2xml (SmartFoxClientAPI.Data.SFSObject ao, Int32 depth, System.String nodeName, System.Text.StringBuilder xmlData) [0x00000] in <filename unknown>:0 

  at SmartFoxClientAPI.Util.SFSObjectSerializer.Serialize (SmartFoxClientAPI.Data.SFSObject ao) [0x00000] in <filename unknown>:0 

  at SmartFoxClientAPI.SmartFoxClient.SendObject (SmartFoxClientAPI.Data.SFSObject obj, Int32 roomId) [0x00000] in <filename unknown>:0 

  at SmartFoxClientAPI.SmartFoxClient.SendObject (SmartFoxClientAPI.Data.SFSObject obj) [0x00000] in <filename unknown>:0 

  at NetworkTransform.DoSend () [0x00000] in <filename unknown>:0 

  at NetworkTransformSender.SendMyTransform () [0x00000] in <filename unknown>:0 
UnityEngine.GameObject:SendMessage(String, Object, SendMessageOptions)
UnityEngine.GameObject:SendMessage(String)
NetworkController:sendAll()
NetworkController:OnJoinRoom(Room)
SmartFoxClientAPI.SmartFoxClient:_DispatchEvent(SFSEvent)
SmartFoxClientAPI.SmartFoxClient:ProcessEventQueue()
NetworkController:FixedUpdate()
 
(Filename:  Line: -1)


(Filename: C:/BuildAgent/work/6bc5f79e0a4296d6/Runtime/Mono/MonoUtility.cpp Line: 350)

Couldn't extract exception string from exception (another exception of class 'ArgumentException' was thrown while processing the stack trace)


 
(Filename: C:/BuildAgent/work/6bc5f79e0a4296d6/Runtime/Misc/Player.cpp Line: 1201)

PlayerLoop called recursively!


110506 20:31:09 Closing plugin window
web: shutdown player

Thanks for looking,

Hi Trevor, did you ever figure out what was wrong? We have en project that crashes with the same message in like 1 in every 20 tests (seems to only be on Explorer 8 but that might just be a coincident of testing)

Hey all,

If you are having the same issue as I am then …

This is a problem with Unity not working with the SFS plugin code.
If you have Unity v3.x and are using any SFS version, you will have the SFS 1.2.6 code or earlier (not SFS version, just the version of their plugin code, its versioned differently)

This does not work, and Unity Support couldn’t help me (or Wouldn’t) until I missed my deadline and my opportunity.
At any rate, after I missed my deadline, they did offer to help me, but by then, I already figured it out.

Here’s what you will need to do …

Option 1

  • Go back to unity 2.6

Option 2

  • Search for posts from Thomas Lund, he has posted a SFS plugin script that is 1.2.7 I believe, its not available on SFS site (as far as I can tell). Replace that code instead of the current plugin code from SFS in your project, and you should be fine. Thomas is basically awesome, and a total pro and helpful with all SFS related stuff, etc…

I pretty much love unity, this is the first poor experience I’ve had with them (other than buying stuff and then it being given away for free … but that didn’t bother me to much)

They basically tried to blame it on SFS, but the fact is, if it works in standalone currently, and it works with their previous version (web and standalone), seems to me it should work in the current web player.

No offense Unity people, just my opinion.

Of course, it could be Unity was just being over generous with it’s support at the code level and still is with everything except the newest web deploys and finally locked down.

At any rate, major bummer,

As far as the support person I talked to (via emails), i’m not even going to mention the details or any names.
Let’s just say, if the forum can help you instead, it’s a much kinder way to get your problem solved compared to my support interaction.

I hope this helps you and others,

Thanks,

My web player doesn’t crash it just doesn’t work the same as stand alone or editor.

I did notice that every function that is called I get this line in the log file. even the functions that seam to be working correctly.

(Filename: C:/BuildAgent/work/6bc5f79e0a4296d6/Runtime/ExportGenerated/WebPlayer/BaseClass.cpp Line: 2505)

Here is a function that isn’t working.

FieldAccessException: Attempt to access a private/protected field failed.
  at (wrapper managed-to-native) System.Reflection.Emit.DynamicMethod:create_dynamic_method (System.Reflection.Emit.DynamicMethod)

  at System.Reflection.Emit.DynamicMethod.CreateDynMethod () [0x00000] in <filename unknown>:0 

  at System.Reflection.Emit.DynamicMethod.CreateDelegate (System.Type delegateType) [0x00000] in <filename unknown>:0 

  at Boo.Lang.Runtime.DynamicDispatching.Emitters.DispatcherEmitter.CreateMethodDispatcher () [0x00000] in <filename unknown>:0 

  at Boo.Lang.Runtime.DynamicDispatching.Emitters.DispatcherEmitter.Emit () [0x00000] in <filename unknown>:0 

  at Boo.Lang.Runtime.DynamicDispatching.PropertyDispatcherFactory.EmitFieldDispatcher (System.Reflection.FieldInfo field, SetOrGet gos) [0x00000] in <filename unknown>:0 

  at Boo.Lang.Runtime.DynamicDispatching.PropertyDispatcherFactory.EmitDispatcherFor (System.Reflection.MemberInfo info, SetOrGet gos) [0x00000] in <filename unknown>:0 

  at Boo.Lang.Runtime.DynamicDispatching.PropertyDispatcherFactory.Create (SetOrGet gos) [0x00000] in <filename unknown>:0 

  at Boo.Lang.Runtime.DynamicDispatching.PropertyDispatcherFactory.CreateGetter () [0x00000] in <filename unknown>:0 

  at Boo.Lang.Runtime.RuntimeServices.DoCreatePropGetDispatcher (System.Object target, System.Type type, System.String name) [0x00000] in <filename unknown>:0 

  at Boo.Lang.Runtime.RuntimeServices.CreatePropGetDispatcher (System.Object target, System.String name) [0x00000] in <filename unknown>:0 

  at Boo.Lang.Runtime.RuntimeServices+<GetProperty>c__AnonStorey14.<>m__9 () [0x00000] in <filename unknown>:0 

  at Boo.Lang.Runtime.DynamicDispatching.DispatcherCache.Get (Boo.Lang.Runtime.DynamicDispatching.DispatcherKey key, Boo.Lang.Runtime.DynamicDispatching.DispatcherFactory factory) [0x00000] in <filename unknown>:0 

  at Boo.Lang.Runtime.RuntimeServices.Dispatch (System.Object target, System.String cacheKeyName, System.Type[] cacheKeyTypes, System.Object[] args, Boo.Lang.Runtime.DynamicDispatching.DispatcherFactory factory) [0x00000] in <filename unknown>:0 

  at Boo.Lang.Runtime.RuntimeServices.Dispatch (System.Object target, System.String cacheKeyName, System.Object[] args, Boo.Lang.Runtime.DynamicDispatching.DispatcherFactory factory) [0x00000] in <filename unknown>:0 

  at Boo.Lang.Runtime.RuntimeServices.GetProperty (System.Object target, System.String name) [0x00000] in <filename unknown>:0 

  at UnityScript.Lang.UnityRuntimeServices.GetProperty (System.Object target, System.String name) [0x00000] in <filename unknown>:0 

  at CameraAddNode.DeletNode () [0x00000] in <filename unknown>:0 

  at CameraAddNode.Update () [0x00000] in <filename unknown>:0 
 
(Filename:  Line: -1)

This is the same function that is working only after a particular function is called.

01=1000110002 (UnityEngine.GameObject) 02=
UnityEngine.Debug:Internal_Log(Int32, String, Object)
UnityEngine.Debug:Log(Object)
UnityEngine.MonoBehaviour:print(Object)
CameraAddNode:smile:eletNode()
CameraAddNode:Update()
 
(Filename: C:/BuildAgent/work/6bc5f79e0a4296d6/Runtime/ExportGenerated/WebPlayer/BaseClass.cpp Line: 2505)

I can’t make any senses of any of this and at a loss.

I know my Debug.Log stuff is no help to any one that looks at it but posted it just to show the differences that happen only after that particular function is ran.

Note that as soon as the game progresses it will break again until the function is called again and all works again.

NOTE: SFS not using just working from desktop

madWilson > seems like you are accesseing your file directly. something like getfilefrom( “c:\folder1\folder2”) this would work on editor or standalones but u can’t access or write into a file in webplayers.
You should do something like this
if ( not running on webplayer ) getfilefrom( “c:\folder1\folder2”)

YoungJaeChoi

accessing my webplayer.unity3D file directly?

I am not accessing or writing to a file in web player all my script does is add objects (Instantiate) using a ray cast from mouse position. are you talking about accessing prefabs directly from a folder (prefab)

I am using arrays like this?

static var NodeArray : Array [];
NodeArray = new Array (7);
// NAME
NodeArray[0] = new Array ();
// ID
NodeArray[1] = new Array ();
//X Position
NodeArray[2] = new Array ();
// Y Position
NodeArray[3] = new Array ();
//Z Position
NodeArray[4] = new Array ();
//NodeType
NodeArray[5] = new Array ();
// Node Children
NodeArray[6] = new Array ();

Thanks for the help?

One last thing is this trying to use my JS as a Boo ? or is this just a web player debug using Boo ?

FieldAccessException: Attempt to access a private/protected field failed

I got it in a webplayer too, and I am using the Photon SDK for multiplayer.

I have an http warpper to go through firewalls and it happens at some point when deserializing the www.bytes received after a POST request.

I do seomthing like this:

List<Hashtable> dataList;
BinaryFormatter bf = new BinaryFormatter();
MemoryStream stream = new MemoryStream(www.bytes);
dataList = (List<Hashtable>)bf.Deserialize(stream);

(I get the exception sometimes at the last line above);

608826–21668–$unityError.txt (3.15 KB)

I had to give up… or start over unless some one could bring a were to go and get it fixed. like I said before I don’t try to write anything to any file just an array that hold info for the rest of the web player to function the way I want.

We have found the cause for this problem. At least on our case.
We were assigning a List and ArrayList to a hashtable which was given to photon to handle the send and receive.

Once I went to webplayer, each message that was built like that failed when we called binaryFormatter.Deserialize(stream); hence dataList = (List)binaryFormatter.Deserialize(stream); gave us the FieldAccessException.

What I did is use a simple array of the objects in need instead. In this case:
Hastable[ ] instead of List.
Then I assigned into the hash and voila! All is good.

Hope this helps someone in the future at least.

I’m getting the same thing on 3.3.0 with a project that worked fine on web player 2.6 and works fine in the 3.3.0 editor. The piece of code that causes this for me is when I loop through a container to grab all the object names and rename them.

I still haven’t figured out a work around, but here is my code for anyone that needs more information and possible cause of the problem:

for (var child : Transform in copy.transform) {
	if (debug == 1){ print("Renaiming "+child.name); } // Crashes after this point.
	newname = child.name.Replace(model+"_",prefix);
	endlength = child.name.length - prefix.length + 1;
	newname = newname.Substring(0, prefix.length)+""+child.name.Substring(prefix.length-1, endlength);
	child.name = newname;
	if (debug == 1){ print("Turning renderer on "+child.name); }
	if (child.renderer) { child.renderer.enabled = true; }
	if (debug == 1){ print("Going into second loop "+child.name); }
	for (var child2 : Transform in child.transform) {
		child2.name = child2.name.Replace(model+"_",prefix); 
		if (child2.renderer) { child2.renderer.enabled = true; }
	}
}
FieldAccessException: Attempt to access a private/protected field failed.

prefix.ToString() solved it for me.

Also getting “PlayerLoop called recursively!”, although I’m not using webplayer nor SFS. And I’m getting this error in the editor too!

Appears that Unity Web Export Module is not “trained” to allow builds that can do direct accessing of files from hard disk,
or it does not do that too well in conjuction with the many web browsers, which causes security violations. So, this is mainly security violation problem, and now we know that, at least, by now … As you can see (with my projects too): this does NOT happen in Windows, or Android builds, as - such builds ARE allowed to have direct access of files from disk …