Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by colinday · Mar 20, 2013 at 07:36 AM · crashloopenumtostring

Infinite loop crash System.Enum.ToString()

Occasionally my game will freeze, and finally I got it to occur on the desktop where I had the debugger instead of out in the wild on the iPad. When I attached the MonoDevelop debugger I was shocked to see the following callstack.

 System.Array.DoBinarySearch (array={Locomotor.AnimType[2]}, index=0, length=2, value=0, comparer={System.MonoEnumInfo.IntComparer}) in /Applications/buildAgent/work/3df08680c6f85295/mcs/class/corlib/System/Array.cs:872
 System.Array.BinarySearch (array={Locomotor.AnimType[2]}, value=0, comparer={System.MonoEnumInfo.IntComparer}) in /Applications/buildAgent/work/3df08680c6f85295/mcs/class/corlib/System/Array.cs:789
 System.Enum.FindPosition (value=Locomotor+AnimType.Idle, values={Locomotor.AnimType[2]}) in /Applications/buildAgent/work/3df08680c6f85295/mcs/class/corlib/System/Enum.cs:401
 System.Enum.GetName (enumType={Locomotor+AnimType}, value=Locomotor+AnimType.Idle) in /Applications/buildAgent/work/3df08680c6f85295/mcs/class/corlib/System/Enum.cs:470
 System.Enum.Format (enumType={Locomotor+AnimType}, value=0, format="G") in /Applications/buildAgent/work/3df08680c6f85295/mcs/class/corlib/System/Enum.cs:1036
 System.Enum.ToString (format="G") in /Applications/buildAgent/work/3df08680c6f85295/mcs/class/corlib/System/Enum.cs:720
 System.Enum.ToString () in /Applications/buildAgent/work/3df08680c6f85295/mcs/class/corlib/System/Enum.cs:704
 Locomotor.playAnimation (animType=Locomotor+AnimType.Idle, direction=Map+Direction.North) in /Users/colinday/Documents/Development/Wizard/Dev/Unity/Assets/Scripts/Actor/Locomotor.cs:433
 Locomotor.Orient (direction=Map+Direction.North) in /Users/colinday/Documents/Development/Wizard/Dev/Unity/Assets/Scripts/Actor/Locomotor.cs:85
 Actor.ChangeOrientation (direction=Map+Direction.North) in /Users/colinday/Documents/Development/Wizard/Dev/Unity/Assets/Scripts/Actor/Actor.cs:572
 Actor.OrientTo (coord={(6, 8)}) in /Users/colinday/Documents/Development/Wizard/Dev/Unity/Assets/Scripts/Actor/Actor.cs:591
 AssemblyCSharp.ActionUse.Start (actionManager={AssemblyCSharp.ActionManager}) in /Users/colinday/Documents/Development/Wizard/Dev/Unity/Assets/Scripts/Actor/Action/ActionUse.cs:45
 AssemblyCSharp.ActionManager.updateTurn () in /Users/colinday/Documents/Development/Wizard/Dev/Unity/Assets/Scripts/Actor/Action/ActionManager.cs:222
 AssemblyCSharp.ActionManager.Update () in /Users/colinday/Documents/Development/Wizard/Dev/Unity/Assets/Scripts/Actor/Action/ActionManager.cs:171
 Map.Update () in /Users/colinday/Documents/Development/Wizard/Dev/Unity/Assets/Scripts/Map/Map.cs:606
 MapManager.Update () in /Users/colinday/Documents/Development/Wizard/Dev/Unity/Assets/Scripts/Map/MapManager.cs:386

It appears that the following line of code is causing an infinite loop inside the system conversion of an enum to a string.

 m_actor.PlayDirectionalAnimation( animType.ToString(), side, facing );

In the above code, animType is an enum that is defined as follows:

     public enum AnimType
     {
         Idle,
         Walk
     }

When I put breakpoints it never comes out of that line of code that is converting animType to a string. It's difficult to believe that there is really an issue with the Enum.ToString(), likely there is something else in my application that is bad which is causing this to fail, but for the life of me I have no idea what. Any ideas?

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

0 Replies

· Add your reply
  • Sort: 

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

10 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Unity crashes when doing A* pathfinding loop 1 Answer

Infinite Looping Crash 2 Answers

Unity not picking up errors until after reopening 0 Answers

Unity crashes when using while 2 Answers

Unity freezes when OnTriggerEnter occurs 3 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges