My game runs fine in the Editor but only gives SIGABRT when beginning to run – no graphics are displayed, past the Unity logo. I originally reported this on September 26, but although someone at UT said they were forwarding the project to someone else who could possibly help, I have heard nothing since November 5, despite a request for any sort of update on November 30th.
I have been given several suggestions about what might not work, in my code, but I tested all of those cases, and the problem only seems to arise when enough code exists to form the backbone of some kind of real system. Do any of you have any advice on how I should proceed? For two and a half months, I have had very little faith in Unity; how can I expect to be able to get any larger projects done, when the developers can’t even get me information about what is going to break?
If you care to have a look, this is just a GUI, but a problem is in here somewhere, and I at least was able to narrow it down that far. I’m thinking I might just start some new game, and keep building every few minutes, knowing that the whole thing is eventually going to break. But I don’t know that I even see a point in that, as reporting the problem might not do anything for me. Plus, my motivation level is (hopefully understandably) very low right now.
(I realize there are a ton of warnings in this, but I don’t agree with them, and have reported bugs for anything you see there.) A lot of my code doesn’t resemble anything I’ve seen in my limited experience, but I’ve tried to the best of my current knowledge level to make something that is easy to build upon.
Jessy, I’ve gotten quite a few SIG—'s when developing my iOS application (using iOS Advanced 1.7):
Avoidance: sometimes a re-build or disconnecting the link between the iDevice PC makes 'em go away.
Debugging: If they persist, or I need it to work with the link, I usually use GDB to debug them. Have you tried “thread apply all bt” as per the below thread? That should at least give you a more helpful error message. http://forum.unity3d.com/threads/56669-Help-with-SIGBUS-error
You wrote the book on iOS ShaderLab, so I imagine you already tried these, but just in case.
I’m not that experienced with C#, what does stuff like this do:
Press += () => Held = true;
In my experience, iOS devices tend to have problems with code that is too ‘clever’. I’ve had code that works fine in the editor or in desktop apps fail miserably on the iPhone (even with strong typing).
Warning: I don’t have Unity on this computer so these observations are all just from skimming the code. One thing I see is that you arent checking your event handlers for null before calling them. For example, in Button.cs line 108:
if (Held) Press();
to be safe should be:
if (Held Press != null) Press();
Using closures for event handlers means that you cannot ever remove the handler (from ButtonSounds.cs):
If the ButtonSounds object is destroyed and that event handler is called (Press) you will get a crash. Overall, I see a lot of anonymous event handlers added which scares me a bit. Perhaps it is because you know for a fact the object with the event will not outlive the object listening to the event. I would personally still setup event listeners in OnEnable and remove them in OnDisable to be safe.
Hah! Just because I know that that one small subject pretty well doesn’t mean I have any clue about anything else! This problem is not one that goes away with any sort of reconnection or reboot of anything, and I tried out that GDB line, but it either doesn’t have anything to tell me, or I don’t know how to read it.
Exactly. I’ve been away from this code for several weeks, so it’s possible I missed some possibility, and can’t think of it, but the GUI exists as-is throughout the game, so I don’t see a reason to account for what you’re talking about. I haven’t been able to crash the Editor with the Quit button yet, nor had I been able to crash my iOS devices, when this project could actually be built. (I don’t recall at what point it failed to be able to be built, which is why I think I’m just going to abandon this and start on something else, until I find the one line of code that is the straw that breaks Unity’s back.)