Server crashes accessing the same asset on 2nd instance

I’m at my wit’s end with this problem:

I have a server and a client.
There are 2 maps, called “Nubek” and “Ruins”.
There are 3 “game modes” or server types called “Town”, “Match” and “FFA”.
The server is running on Ubuntu 13.04 x64 with Linux headless mode x64.
Starting the server twice with the same map leads to the following results:

Locally (Windows x64):

  • Town: Working
  • Match: Working
  • FFA: Working

Live server (Ubuntu 13.04 Linux headless mode x64):

  • Town: Working
  • Match: Working
  • FFA: Fail on 2nd instance start, logs stop at Resources.Load(“Maps/Nubek”)

Here’s a screenshot on the live server starting the server with the same map twice:

2x Town works, 2x FFA fails

After this I thought “What are the differences?” and “Why is the instance crashing 1 second after the start?”. So I checked the logs and they stop at Resources.Load(“Maps/Nubek”) on the second FFA instance. It’s a single binary started multiple times on the linux server with the same data folder. This was normally never a problem. Any idea what might be causing it? Anyway, this was the main problem. But here comes something weirder:

One thing that I suspected to be the cause of the Resources.Load() crash was my “DestroyServerAssets” function which is called after map load on the first instance.

	// DO NOT CALL THIS IN THE EDITOR
	private void DestroyServerAssets() {
		LogManager.General.Log("Going to destroy unneeded server assets");
		
		// Remove all textures
		var allTextures = Resources.FindObjectsOfTypeAll(typeof(Texture));
		LogManager.General.Log(allTextures.Length.ToString() + " textures loaded, going to destroy.");
		foreach(var obj in allTextures) {
			Destroy(obj);
		}
		LogManager.General.Log("Textures destroyed.");
		
		// Remove all audio clips
		var allAudioClips = Resources.FindObjectsOfTypeAll(typeof(AudioClip));
		LogManager.General.Log(allAudioClips.Length.ToString() + " audio clips loaded, going to destroy.");
		foreach(var obj in allAudioClips) {
			Destroy(obj);
		}
		LogManager.General.Log("Audio clips destroyed.");
		
		// Remove all materials
		var allMaterials = Resources.FindObjectsOfTypeAll(typeof(Material));
		LogManager.General.Log(allMaterials.Length.ToString() + " materials loaded, going to destroy.");
		foreach(var obj in allMaterials) {
			Destroy(obj);
		}
		LogManager.General.Log("Materials destroyed.");
		
		// DO NOT DELETE THE MESHES, YOU WILL GET PROBLEMS ON THE SERVER
	}

Don’t ask me why the first instance would interfere with the assets of the 2nd instance, it doesn’t even make sense to me, but that was my first idea. So I tried commenting out the call to DestroyServerAssets() and checked it again. The result: Now if I start a 2nd instance with the same map, it’s not the 2nd instance crashing anymore but rather the first instance that crashes. Now the crash happens on all game modes.

I am using Unitypark / uZone for the instance management, however I am 99% sure this is not related to any library problems because the call that fails is Resources.Load() in the first problem I described.

Does Destroy()'ing game objects in a running Unity instance cause any problems for a 2nd instance using the same assets? As far as I know Destroy() is not an “inter-instance” call and should only destroy the loaded asset in RAM only for the calling instance, or am I wrong? What’s going on here?

do you still have the uZone project files? I really need the uZone.zip from muchdifferent :\