Unity Windows Phone Bug Blues

edited in General
So I've got one of those bugs that just makes you excited about life in all the wrong ways!

Compiling for window phone 8 either through Unity or Visual Studio, on Application.Load() of our main level the app crashes. The super annoying part is that this doesn't happen in debug mode. I've created a stripped down level, which works - but then the weird begins: If you load the stripped down level before the buggy level then the buggy level works just fine.

I'm fairly happy I've eliminated memory as a source of the crash, so now I'm investigating runtime weirdness with the flavour of CLR that win phone uses. Anyone else have an intuition as to what might be happening? Still trying to isolate exactly what triggers a crash but mostly clutching at straws right now.

Comments

  • edited
    Do you have any heap allocated elements? That crash that was nuking the DD web build was all about a Dictionary that was getting too large. If you have any recursive code that's getting really deep that might be causing similar heap/stack collision issues if the Win Phone heap is small enough...

    Maybe that's an idea? I'll trade you a crazy Unity bug later if this helps ;)
  • Hmm, I don't think it's that. Not really making use of anything in that way.

    Though I feel like it's definitely something behind the curtain going crazy. I've heard that some JS features are unsupported, like Array(). But I'm struggling to find anything deterministic about when it decides to work and not work. Literally just had and instance where a scene worked, recreate another scene that's identical - dies. Funzies!
  • Managed to track it down to a single line of code.

    Had a cached transform lookup I created in the start function:
    trans = this.transform;


    Then in the update loop this line killed it:
    trans.rotation = rot; //rot is a quaternion.


    Totally benign code. If I replace trans with a dynamic lookup ( transform.rotation = rot;) it works. Bug report submitted to Unity. Le sigh. And this kids is why I don't like living on the bleeding edge. Also screw bugs that only present in the release version!
  • Whoa. At least you found it!

    What happened if you put the initial line in Awake instead, still crashed?
  • @dislekcia good question: Yup, still crashes. It's as if there is some kind of win phone mem lookup bug or something. Still nervous for any other kind of nasties we might find, but at least this one is done for now ;)
Sign In or Register to comment.