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
1
Question by Zobtzler · Apr 02, 2013 at 06:03 PM · exceptionstackstackoverflowoverflow

I'm getting StackOverFlowException

Hi. I'm trying to make at first person shooter, but I'm getting trouble. I get a stackoverflowexception and for now it's pointing at main camera. I'll include links to my files. (it's only two)

https://www.dropbox.com/s/um4k40gb8lceony/MenuManager.txt https://www.dropbox.com/s/4twejp50gmgaffg/MultiplayerManager.txt

Comment
Add comment · Show 1
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 hoy_smallfry · Apr 02, 2013 at 06:57 PM 3
Share

The call stack is a structure that keeps track of function call states. That is, every time a function gets called, the the program$$anonymous$$g language environment puts the instruction pointer and variables connected to function on the the stack as a way to keep track of the state of your program. When a function is finished, it gets taken off the stack, and you are returned to the state below it, which is almost always the function that originally called the function which just finished.

Usually, you get a stack overflow when more states are put on the stack than the stack can carry, hence it "overflows" with function states.

Since the stack is quite large, it would take a LOT of functions calling functions for that to happen... or, there's a high chance that a functions starts calling others or even itself recursively, infititely, until the stack overflows.

If you don't know which functions could be recursively calling each other, I suggest you stub the functions in one of your classes (comment them out), run the program again to make sure that the code you stubbed is what is causing the problem. Then, reintegrate each function and run so that you can locate which function is causing the overflow.

1 Reply

· Add your reply
  • Sort: 
avatar image
1

Answer by Ubahs · Apr 02, 2013 at 08:13 PM

You have a method that is calling itself, this will do so infinitely, until you overflow the stack - I bolded the offending lines. Server_PlayerJoinRequest, will loop back to itself forever.

 [RPC]
 void Server_PlayerJoinRequest(string playername, NetworkPlayer view)
 {
     networkView.RPC("Server_PlayerJoinRequest", RPCMode.All, playername, view);
 }
Comment
Add comment · Show 1 · 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 KLEPSTER · Aug 07, 2016 at 08:09 AM 0
Share

thnx you Ubahs

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

14 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

Related Questions

StackOverflowException on UI Button message 0 Answers

How to ignore Overflow Exception 2 Answers

Stack Overflow in if condition. 1 Answer

Catching a Stack Overflow 1 Answer

int array overflow exception 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