<p>What is a <code>StackOverflowError</code>, what causes it, and how should I deal with them?</p>

Like you say, you need to show some code. :-)
A stack overflow error usually happens when your function calls nest too deeply. See the
Stack Overflow Code Golf
thread for some examples of how this happens (though in the case of that question, the answers intentionally cause stack overflow).