I have the following situation:
Have a test that runs into a StackOverflowError
.
(This is actually expected behaviour in the Red phase of Red/Green test-driven development.)
To report the situation, the program constructs an error message and submits it to a logging framework.
String concatenation requires stack. Calling into the logging framework requires stack. The logging framework might call into plugins which might lazily read configuration data, requiring even more stack.
I can imagine various ways to deal with this, but is there a discussion of the various approaches, how they work in practice, and what JVM guarantees they can rely on?
E.g. does the JVM guarantee some reserve stack space on StackOverflowError
, and if yes, where’s the specification?