java.lang.StackOverflowError - Trying to build JIRA 5.1.6 from source

Lavar Askew October 10, 2012

I keep getting an java.lang.StackOverflowError when I try to build JIRA 5.1.6 from source. This happens every time maven tries to build Atlassian JIRA - Plugins - OAuth Service Provider SPI. I have tried increasing my maven heap size in the mvn2.sh file to:

export MAVEN_OPTS=-Xmx4096m -XX:MaxPermSize=2048m

I have also placed the same line in my .bash_profile as well as the build.sh with no luck. I am on a Mac BookPro with 16 GB of RAM running Lion.

The trace is as follows:

INFO ------------------------------------------------------------------------

INFO Building Atlassian JIRA - Plugins - OAuth Service Provider SPI

INFO task-segment: clean, install

INFO ------------------------------------------------------------------------

INFO ------------------------------------------------------------------------

ERROR FATAL ERROR

INFO ------------------------------------------------------------------------

INFO null

INFO ------------------------------------------------------------------------

INFO Trace

java.lang.StackOverflowError

at java.io.InputStream.(InputStream.java:26)

at java.io.FileInputStream.(FileInputStream.java:142)

at java.lang.UNIXProcess$DeferredCloseInputStream.(UNIXProcess.java:161)

at java.lang.UNIXProcess$DeferredCloseInputStream.(UNIXProcess.java:156)

at java.lang.UNIXProcess$1.run(UNIXProcess.java:65)

at java.security.AccessController.doPrivileged(Native Method)

at java.lang.UNIXProcess.(UNIXProcess.java:60)

at java.lang.ProcessImpl.start(ProcessImpl.java:91)

at java.lang.ProcessBuilder.start(ProcessBuilder.java:453)

at java.lang.Runtime.exec(Runtime.java:593)

at java.lang.Runtime.exec(Runtime.java:431)

at java.lang.Runtime.exec(Runtime.java:328)

at org.codehaus.plexus.interpolation.os.OperatingSystemUtils.getSystemEnvVars(OperatingSystemUtils.java:83)

at org.codehaus.plexus.interpolation.EnvarBasedValueSource.(EnvarBasedValueSource.java:62)

at org.codehaus.plexus.interpolation.EnvarBasedValueSource.(EnvarBasedValueSource.java:47)

at org.apache.maven.profiles.activation.FileProfileActivator.isActive(FileProfileActivator.java:61)

at org.apache.maven.profiles.DefaultProfileManager.isActive(DefaultProfileManager.java:273)

at org.apache.maven.profiles.DefaultProfileManager.getActiveProfiles(DefaultProfileManager.java:209)

at org.apache.maven.project.DefaultMavenProjectBuilder.injectActiveProfiles(DefaultMavenProjectBuilder.java:1506)

.

.

.

.

at org.apache.maven.project.DefaultMavenProjectBuilder.assembleLineage(DefaultMavenProjectBuilder.java:1415)

at org.apache.maven.project.DefaultMavenProjectBuilder.assembleLineage(DefaultMavenProjectBuilder.java:1415)

INFO ------------------------------------------------------------------------

INFO Total time: 2 minutes 56 seconds

INFO Finished at: Wed Oct 10 23:52:13 EDT 2012

INFO Final Memory: 125M/478M

INFO ------------------------------------------------------------------------

3 answers

1 accepted

0 votes
Answer accepted
Lavar Askew October 11, 2012

I solved my problem. Renjith told me that I may have a circular dependency somewhere so that got me thinking about the pom files. I just went through and downloaded each jar, pom and sha1 file to my local repository and that is what worked for me.

1 vote
Joe Clark
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 10, 2012

The settings you have specified (-Xmx and -XX:MaxPermSize) both control memory allocation on the heap. However, the error message you are seeing is a stack overflow error. The size of the stack is not related to the amount of memory allocated to the heap - it's a separate config.

While the broader question of why your JIRA build is getting a stack overflow remains a mystery to me, you can try brute-forcing through this problem by beefing up your maximum stack size. Use the "-Xss" parameter for this.

eg.

export MAVEN_OPTS=-Xss32m

Lavar Askew October 10, 2012

Thanks for the reply Joseph. I tried increasing the maximum stack size, but the build process still breaks at Building Atlassian JIRA - Plugins - OAuth Service Provider SPI. I also noticed that I while I did have jta1.0.1.jar I did not have the pom file in my local repo. Not sure where to go from here. How can I see OAuth Service Provider SPI dependencies.

taras19921 June 6, 2018

In Windows:

set MAVEN_OPTS="-Xss32m"

You can create Environment variable with name: MAVEN_OPTS and value:  -Xss32m

0 votes
Sebastian Pipping May 18, 2013

This seems to be a bug in maven (both 2.0.11 and 2.2.1). Seen it with JIRA 5.2.10 myself again.

Suggest an answer

Log in or Sign up to answer