HI there,
I’m in the process of submitting a bug report, the file is taking a while to upload. In the meantime I thought I’d post a similar message to the forums and see if anyone else has any ideas:
1) What happened
We continually receive an exception: Receiving unhandled NULL exception, which can only be read in the Console log (Mac OSX), we’ve been able to narrow it down to either calling destroy on our character that uses mecanim, or it is in instantiating a second (or subsequent) instance of our character prefab that uses mecanim. It’s just impossible to know where the bug is occurring exactly because Unity crashes and we get no useful error being reported. We would have thought that Unity would have given us a proper null exception in the console, not crashing the player/editor. It’s incredibly frustrating and is stifling a major production, we need some help on this asap!!
2) How can we reproduce it using the example you attached.
(I’ve modified the description of how to produce the bug so it will make sense to someone without access to the project/application)
Basically, I’m instantiating a character from a prefab that uses mecanim into a game scene. If I destroy the character and then re-instantiate a new instance, even after delays to make sure the old one is fully gone, the Unity editor will crash. If I remove the character from being created, the rest of my scene can be cleaned up and recreated and doesn’t crash, add the character back in and it crashes once again.
This crash also affects the web player, however the bug becomes much more erratic, we are usually able to cycle through the steps and create and destroy the character up to 5-6 times before the crash occurs. Sometime it will happen after a couple of times, sometimes as much as 20 cycles before it will occur. Again, if we remove the character from being spawned, the web player will cycle through without a crash, I’ve made it through 60 times without a crash without the character.
I’ve also tried removing our script character controller component called TheBoyController.cs from the character prefab, so that none of our code is running after the character is instantiated, this seems to help the editor to stop from crashing, but doesn’t change the outcome for the web player which still crashes erratically. Then I tried to narrow down our code by removing bit by bit, but all this achieved was an erratic crashing behaviour in the editor, it still crashed but become erratic like the web player. My gut feeling is that the unhanded exception is coming from mechanim internal runtime classes.
I’m using the latest version of Unity 4.1.2 with a pro license, on a mac pro with 10.8.3. As I mentioned we need a solution to this asap!! In the meantime the only course of action I have is to only create this character once and to never destroy it… seems ridiculous though, I’m going to run into this problem again very soon when I go to instantiate multiple npc instances from a single prefab source.
PS: ironically the crash reporter is also generating it’s stack trace because it doesn’t have access to my address book, I’m not sure if this is an exception or not…
Receiving unhandled NULL exception
Launching bug reporter
*** Launching bug reporter due to crashbug.
Obtained 0 stack frames.
2013-04-15 12:30:14.189 Unity Bug Reporter[3365:1203] Address book access is denied for executable at path: /Applications/Unity/Unity Bug Reporter.app/Contents/MacOS/Unity Bug Reporter
(
0 AddressBook 0x90f852da __ABIsAccessGranted_block_invoke_0 + 39
1 libdispatch.dylib 0x96d0ac82 _dispatch_client_callout + 46
2 libdispatch.dylib 0x96d0abf1 dispatch_once_f + 57
3 libdispatch.dylib 0x96d0b831 dispatch_once + 31
4 AddressBook 0x90f85222 ABIsAccessGranted + 50
5 AddressBook 0x90f85116 +[ABAddressBook sharedAddressBook] + 35
6 Unity Bug Reporter 0x00004c89 -[BugReporter finishLaunching] + 341
7 AppKit 0x979323a9 -[NSApplication run] + 196
8 AppKit 0x978d5666 NSApplicationMain + 1053
9 Unity Bug Reporter 0x000031cc main + 482
10 Unity Bug Reporter 0x00002972 _start + 216
11 Unity Bug Reporter 0x00002899 start + 41
12 ??? 0x00000006 0x0 + 6
):
Jason Rawlings
Millipede Creative Development