Another crash on refreshing the webplayer page

So, I’ve been searching for weeks about this crash I get on refreshing the browser. I’ve come across some posts on the forums and most of the people talk about the log. The thing is that some times the log disappears, but the times I get to find the log it gets stuck in three points. Either here:

150713 09:22:35 Instance starting, version 5.1.0f3_ec70b008569d, UNITY_WEB_ENABLE_AUTODOWNLOAD: 1, GetDisableAutoUpdates(): 0

here:

150713 09:10:56 Instance starting, version 5.1.0f3_ec70b008569d, UNITY_WEB_ENABLE_AUTODOWNLOAD: 1, GetDisableAutoUpdates(): 0
150713 09:11:02 Datafile ServerDataPath.unity3d

or here:

150713 09:08:34 Instance starting, version 5.1.0f3_ec70b008569d, UNITY_WEB_ENABLE_AUTODOWNLOAD: 1, GetDisableAutoUpdates(): 0
150713 09:08:34 Datafile ServerDataPath.unity3d
150713 09:08:41 Timed out on global version info

Most of the times is just the first case. I hit the refresh button of the browser (chrome or firefox), the plugin starts loading, then stops and shows the error page (failed to load) and the only thing I find in the log is this single line. There’s no threading iside the app, just loads some FBX from the server.

Any ideas of why can this be happening?

So, just as I wrote the “just loads some FBX from the server” line I thought it may had to do something with the asset loaded (it’s just one FBX with one mesh and one object instantiated) and I tried unloading the assets before quitting:

void OnApplicationQuit()
    {
        Resources.UnloadAsset(loadedObject);
        loadedObject = null;
        Resources.UnloadUnusedAssets();
    }

I might be close to it, since now It reloads the unity player, but just after getting the error:

Instruction xxxxxx references memory xxxxxx. Memory could not be written.

Another question would be: Why do log files get deleted after I close the browser? The only exception is whenever the plugin crashes, but, since the log file doesn’t get updated, there’s no way of checking what happened…

I’ve been testing and confirmed that (unless you can perform some magic I don’t know about yet) log gets deleted unless someting went wrong. The thing is that whenever something goes wrong I don’t get a crash, but just an incomplete log. Any ideas?

I did more testing… and I think it may be something related to the memory being freed by the player. If the player loads an assetbundle with a light prefab (just a few meshes) then I don’t get a crash when refreshing the browser, but if I load a somewhat large assetbundle (somewhere around 4 thousand meshes) then I get the crash on refreshing.

I’ve searched all the references to the assets loaded and made sure they are cleaned

Destroy(loadedObject);
Resources.UnloadUnusedAssets();

Still no luck. Whenever I load the large assetbundle I get the crash.

So I thought I was onto something until I tested in Firefox and I got crash on refresh page even without any asset bundle loaded or any prefab instantiated. It seems Chrome can handle refreshes a bit better than Firefox.

2215718--147440--TestRefreshFirefox.png

I reinstalled the plugin, just in case. Same result. I’m a bit lost right now (although I keep thinking it has something to do with memory).

I fount out that there are 2 scripts that are causing the problems (still don’t know how they’re causing the crash, but I know it’s them). It’s the Antialiasing effect script and the Screen Space Ambient Occlusion effect script. Deleted them and crash disappeared. Now I have to find out why they’re malfunctioning when loading large assetbundles.

Good work. DId you get any closer to fixing it?

I have the same issue. When refreshing the page, sometimes the Unity webplayer crashes. In my case, it seems to happen pretty much all the time when I toggle to fullscreen and back to windowed mode before refreshing the page. I’m using Firefox.

Today the fullscreen toggling doesn’t seem to cause the issue consistently. The weplayer crashes after I’ve refreshed a few times. I’ll keep investigating, meanwhile if anyone runs into this issue please share your findings. I have an Anti-aliasing post-effect script too but removing it did not solve the problem.

I made an empty project in which I a scene with a simple rotating cube. I attached a script to a gameobject to toggle to fullscreen. The webplayer usually crashes if I refresh the page after I’ve toggled to fullscreen and back to windowed mode with the Escape button.

I guess it’s an issue with the webplayer, I have literally 3 lines of code in my project, the transform.Rotate of the cube and these 2 lines in the Update method.

if (Input.GetKeyDown(KeyCode.Space))
            Screen.SetResolution(Screen.width, Screen.height, true);

Hey there, been on holidays, so couldn’t answer. It seems to me that it’s some kind of issue with the post-effects scripts.

At first I thought it had to do with the amount of geometry in the scene (I had several thousands of gameobjects, each with its own mesh) but after testing without any geometry at all (just some UI elements) I found that the crash kept happening. I had some scripts to apply some nice effects (outline and stuff) but it turns out that it’s just the antialiasing and the SSAO scripts that are cousing the trouble. As I said, I haven’t had time to check what exactly is causing trouble within those scripts, but deleting them from the scene seems to fix the problem for me.

I don’t have much time to check those scripts, so if anyone finds out why this happens, please share.