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 axonJeff · Oct 02, 2013 at 10:24 PM · crashunity 4log

Unity Editor 4.2 crashes silently on play or start

I'm currently working on a hex-based map editor for a game and -- big win for me -- I finally have the ability to load in heightmaps and contour the terrain in roughly the style I'm aiming for.

However, now that contouring of the mesh vertices and normals is working, the editor will crash if I ever try to load or play a scene that has been contoured. When this happens, Editor.log provides me the following unhelpful output:


Platform assembly: C:\Program Files (x86)\Unity\Editor\Data\Mono\lib\mono\2.0\System.Xml.Linq.dll (this message is harmless)

Mono: successfully reloaded assembly

-Completed reload, in 1.660 seconds

Failed to postprocess stacktrace StackOverflowException

(Filename: Line: -1)

Failed to postprocess stacktrace StackOverflowException

(Filename: Line: -1)

Failed to postprocess stacktrace StackOverflowException

(Filename: Line: -1)

Failed to postprocess stacktrace StackOverflowException


... and so on and so forth until it dies and crashes out. Unity provides me with no error messages at the time of the crash. The log is all I have to go by.

I would provide a code sample to assist in debugging this problem, but there are at least half a dozen editor scripts at work and my scene contains literally thousands of gameobjects, all of which with their own updates and dynamic mesh scripts. More importantly, I really have no idea what code is causing the problem since I've got nothing to go on.

So I'll start generally... Does anyone know of any reason that Unity would fail in this way? Perhaps someone has experienced something similar and can suggest a workaround? I heard in some other thread that instantiating a ton of gameobjects at once can be trouble, but my map generation script has no trouble hammering out tens of thousands of gameobjects to operate on, so I doubt that's the problem.

I'm truly sorry to not be able to provide something more concrete but I am totally stumped with this at the moment. Let me know if there's any specific info I can provide to crack this can of worms open a little bit further...

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

2 Replies

· Add your reply
  • Sort: 
avatar image
2
Best Answer

Answer by axonJeff · Oct 12, 2013 at 01:20 PM

This problem was tough to resolve and all I have is theory to go on here. I hope that this helps to resolve similar issues for others.

Unity was storing inspector variables and therefore any references between scripts I had set up in the scene. However, since memory references are non-serializable, Unity (I think) serializes each object pointed to and saves them to disk as a file that it can find in the library at some "fileID" that is kept in the scene file.

When the scene loads, the scene loader needs to instantiate each gameobject in the scene from the data in the scene file and initialize them to the stored parameters. In order to do this, it has to unpack all of the serialized objects at the stored fileIDs and put them into memory.

Now, I don't know about this next part at all -- it is my best guess -- but I think that the scene loader was loading up each serialized script for each gameobject and had not resolved that many of them were pointing to the same things yet. I think the process of loading the scene content is some kind of recursive process and until some kind of check happens to cull the deserialized objects loaded from files that are determined to be duplicates, Unity is using a great deal more memory than it normally needs for the scene.

And thus I blew the stack with recursion that actually has a bound condition for the first time ever.

TO THOSE WHO NEED A QUICK FIX

The best short-term solution I could manage was to get rid of the references I was making between scripts -- at least as inspector variables. You are free to store these references in private members and recompute them each time your scene Start()s in the editor, or even to store this data in a file of your own to load them in if you want to. I didn't, but I can't see a reason you couldn't do that. However, Unity's scene loader routine is a child playing with fire in this case, and you need to take away those script references before it hurts itself.

Hope it helps someone. Seems like a pretty obscure problem.

Comment
Add comment · Share
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
0

Answer by DarkPixel · Oct 02, 2013 at 11:54 PM

Stackoverflow means you have a function that call ifself without a stopping condition. Check for any recursive function. Try commenting them and reload the scene until the crash stopped, you will probably find the problematic function that way.

Comment
Add comment · Share
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

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

15 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 avatar image avatar image avatar image avatar image avatar image

Related Questions

Please help understand this Editor-Crash Log file 0 Answers

Android crash logs? 1 Answer

How can I find editor log file? 5 Answers

Unity game crash dump. 0 Answers

Application crashes after seven hours ! 1 Answer


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