Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Very simple app crashes

Discussion in 'Windows' started by David Farbaniec, Apr 18, 2014.

  1. David Farbaniec

    David Farbaniec

    Joined:
    Apr 18, 2014
    Posts:
    5
    I have written very simple application in Unity for Windows Phone.

    Aquarium background, bubbles (particle system) and fishes moving from left to right and right to left.

    I published app to Windows Phone Store for free and in reports there are many crashes.

    Stack trace which can I export:

    Code (csharp):
    1. App: AquariumInPhone
    2. OS version: 8.0
    3. Problem function: Unknown
    4. Exception type: c0000005
    5. 30-day crash count: 23
    6. Stack trace:
    7.  
    8. Frame    Image          Function                             Offset        
    9. 0        ntdll          RtlpWaitOnCriticalSection            0x0000007e    
    10. 1        ntdll          RtlpEnterCriticalSectionContended    0x00000060    
    11. 2        unityplayer                                         0x002ef5ac
    This is very simple application, but crashes :(

    Fishes moving left have code:
    Code (csharp):
    1. using UnityEngine;
    2.  
    3. public class Fish1 : MonoBehaviour {
    4.  
    5.     float speed = 0.0032f;
    6.     Vector3 startPoint;
    7.     Vector3 currentPosition;
    8.     System.Random r = new System.Random ();
    9.  
    10.     void Start()
    11.     {    
    12.         startPoint = transform.position;
    13.         currentPosition = transform.position;
    14.     }
    15.  
    16.     void Update ()
    17.     {
    18.         if (Camera.main.WorldToViewportPoint(transform.position).x < -0.2f)
    19.         {
    20.             int newY = r.Next(0, 5);
    21.  
    22.             if(r.Next(0, 2) == 0)
    23.                 newY = -newY;
    24.  
    25.             Vector3 pos = new Vector3(12.0f, (float)newY, 0.0f);
    26.             currentPosition = pos;
    27.             transform.position = currentPosition;
    28.         }
    29.         else
    30.         {
    31.             currentPosition.x--;
    32.             transform.position += (currentPosition + startPoint) * speed * Time.deltaTime;
    33.         }
    34.     }
    35. }
    Fishes moving right have code:
    Code (csharp):
    1. using UnityEngine;
    2.  
    3. public class Fish2 : MonoBehaviour {
    4.  
    5. float speed = 0.005f;
    6. Vector3 startPoint;
    7. Vector3 currentPosition;
    8. System.Random r = new System.Random ();
    9.  
    10. void Start()
    11. {    
    12.     startPoint = transform.position;
    13.     currentPosition = transform.position;
    14. }
    15.  
    16. void Update ()
    17. {
    18.     if (Camera.main.WorldToViewportPoint(transform.position).x > 1.2f)
    19.     {
    20.         int newY = r.Next(0, 5);
    21.  
    22.         if(r.Next(0, 2) == 0)
    23.             newY = -newY;
    24.  
    25.         Vector3 pos = new Vector3(-12.0f, (float)newY, 0.0f);
    26.         currentPosition = pos;
    27.         transform.position = currentPosition;
    28.     }
    29.     else
    30.     {
    31.         currentPosition.x++;
    32.         transform.position += (currentPosition + startPoint) * speed * Time.deltaTime;
    33.     }
    34. }
    35. }
    What can be the reason of crash? How can I fix this?

    On stackoverflow somebody told me to post my problem here.

    Regards, David
     
  2. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,491
    Hi,

    I don't think you can do anything on your own. Which Unity version are you using? Is there anything else in the stack trace, or have you posted it fully? How many downloads do you have (might help estimate how common this crash really is)?
     
  3. David Farbaniec

    David Farbaniec

    Joined:
    Apr 18, 2014
    Posts:
    5
    Unity 4.3.4f1

    This is all that I can export from Windows Phone Store.

    1103 downloads. 23 crashes.
     
  4. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,491
    Have you been able to repro any of said crashes yourself?
     
  5. David Farbaniec

    David Farbaniec

    Joined:
    Apr 18, 2014
    Posts:
    5
    I am beginner with Unity. This was my first app. I have run my app multiple times for long time on my smartphone and no crash. I can send .cab dump file.
     
    Last edited: Apr 18, 2014
  6. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,491
    That would be helpful. Could you do it through our bug reporter? It's under Help -> Report a Bug in Unity Editor.
     
  7. David Farbaniec

    David Farbaniec

    Joined:
    Apr 18, 2014
    Posts:
    5
    Done.
     
  8. David Farbaniec

    David Farbaniec

    Joined:
    Apr 18, 2014
    Posts:
    5
    What can I do next? I will be informed about bug fix? I should wait for new Unity release? 280 crashes on 1800 downloads. I have hidden my app from Windows Phone Store. I am planning to write commercial application - in this type of app there can not be any crashes, because crash equals to negative review in Store.
     
  9. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,491
    I believe the only thing you can do is wait for a new Unity release - 4.5 is just around the corner.

    As for tracking the bug - we list all of them here once they're processed:

    http://issuetracker.unity3d.com/