Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 SirWeeble · Nov 27, 2015 at 10:21 AM · debug

Debug an occasional freeze

I've had an occasional freeze that has been occurring for a long time and cannot find the source nor any way to find it. Debug.log isn't helpful as it doesn't function during the freeze - since everything locks up. Monodevelop debugging mode also doesn't help as I don't know where it is occurring, so I don't know where to set breakpoints.

The bug itself only occurs randomly. Sometimes I can run the program for 30 minutes without a freeze, sometimes it freezes after 10 seconds.

I've tried disabling sections of code, but since no user action "provokes" the crash as far as i can tell (right now the only input is camera movement), i can't attempt to get it to crash on-demand. Since it occurs maybe once every 10-20 minutes of running, there's really no way to know if the problem was in my disabled code or if it just decided not to crash.

I've dug through the code looking for possible infinite loops, but I don't use do/while at all, nor do I manually alter my iterating variables in for/loops

Since there's no user-conditions which prompt the freeze and no indication that it's going to freeze (framerate doesn't drop before it or anything, it's just out of nowhere) I can't even begin to guess what's causing the problem. I was hoping the problem is just the unity editor, but it freezes in stand-alone exes too.

Has anyone a solution to this problem, or any suggestions of what to try to track down this frustrating freeze?

Comment
Add comment · Show 2
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
avatar image Zorkman · Nov 27, 2015 at 11:13 AM 0
Share

These kinds of bugs are just terrible. I don't know how extensively you are using the OnEnable() and OnDisable() functions. But I would recommend that for every script you enable you could write:

void OnEnable() { Type t = typeof(this); Debug.Log(t.ToString() + " enabled"); }

With this you can narrow it down to which component is enabled lastly before the occurring freeze. I posted this as a comment since I have not tested the above code and does not know if it is working :) But I think you get the idea. Also it might be good checking out the error logs that unity creates: http://docs.unity3d.com/$$anonymous$$anual/LogFiles.html

avatar image SirWeeble Zorkman · Nov 27, 2015 at 10:16 PM 0
Share

I'm not using OnEnable/OnDisable very much, so this would be of limited utility, but it's a good idea.

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

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

print(); to console problem - beginner 0 Answers

Step/Iterative Debugging 1 Answer

How to catch Unity values in Android EDI ? 0 Answers

Getting variables from c# to js 2 Answers

Debug build runs better than release build. 0 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