Why am I getting a StackOverflow Exception when saving Jenkins global configuration?

Issue

  • When I am trying to update the Jenkins configuration and hit save, I am getting a StackOverflow exception as shown below:
WARNING	o.e.j.s.h.ContextHandler$Context#log: Error while serving http://jenkinsurl:8080/configSubmit
java.lang.StackOverflowError
	at java.lang.System.getProperty(System.java:714)
	at sun.security.action.GetPropertyAction.run(GetPropertyAction.java:84)
	at sun.security.action.GetPropertyAction.run(GetPropertyAction.java:49)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.io.BufferedWriter.<init>(BufferedWriter.java:109)
	at java.io.BufferedWriter.<init>(BufferedWriter.java:88)
	at hudson.util.AtomicFileWriter.<init>(AtomicFileWriter.java:76)
	at hudson.util.AtomicFileWriter.<init>(AtomicFileWriter.java:57)
	at hudson.XmlFile.write(XmlFile.java:168)
	at hudson.model.Descriptor.save(Descriptor.java:872)
	at hudson.model.Saveable$save.callCurrent(Unknown Source)

Environment

Resolution

This is a known Jenkins issue Jenkins-39096 which is fixed in versions of the Jira Trigger plugin equal or higher than 0.2.4.

You can check the plugin changelog to get additional information on the changes included in the different versions.

Have more questions?

1 Comments

  • 0
    Avatar
    Filler Mark

    A StackOverflowError is simply signals that there is no more memory available. It is to the stack what an OutOfMemoryError is to the heap: it simply signals that there is no more memory available. JVM has a given memory allocated for each stack of each thread, and if an attempt to call a method happens to fill this memory, JVM throws an error. Just like it would do if you were trying to write at index N of an array of length N. No memory corruption can happen. The stack can not write into the heap.

    The common cause for a stackoverflow is a bad recursive call. Typically, this is caused when your recursive functions doesn't have the correct termination condition, so it ends up calling itself forever. Or when the termination condition is fine, it can be caused by requiring too many recursive calls before fulfilling it.

    Here's an example:

    public class Overflow {
    public static final void main(String[] args) {
    main(args);
    }

    }
    That function calls itself repeatedly with no termination condition. Consequently, the stack fills up because each call has to push a return address on the stack, but the return addresses are never popped off the stack because the function never returns, it just keeps calling itself.

     

Please sign in to leave a comment.