-
Notifications
You must be signed in to change notification settings - Fork 394
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Getting a stackoverflow error #123
Comments
@dineshgioe |
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:
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. |
This happens to be related to #585 |
I was trying to use this library to test my pipeline code. I have my pipelines defined in a share library and I am calling this library as a pipeline script. Following code is configured as a pipeline code in the jenkin jobs.
**@Library('commons@develop')
import test.builds.designapp.Facade
new Facade(this).createPipeline()**
Facade is a groovy class which contains the required pipeline code. I have tried to test this by copying the same above exact lines into a file and loading the file using loadScript method.
But when I tried to run the tests I am getting the "java.lang.StackOverflowError" with out any trace. I have tried in multiple ways but end up with same error. I would like to know if this is a proper way of using the jenkinspipelineunit.
The text was updated successfully, but these errors were encountered: