david-schuler/javalanche — Issue #5: Error with specific test cases (transformation of class fails)
Author: kevinjalbert
Created: 2012-03-06 01:26:13+00:00
State: open

I've encountered a situation where I have isolated a test case from JGAP-3.6.1 ([org.jgap.gp.impl.GPGenotypeTest.testConstruct_1][2]) that causes an error to occur. This error is quite interesting as Javalanche will encounter it in the *runMutations* task and effectively causes this test class to repeat the task over and over (as it keeps failing and never progresses as shown in the following **[Gist of the Error][3]**).

I am not entirely sure why this error occurs. The resulting stack-trace indicates that there is *insufficient maximum stack size* (shown below):

```
[exec] [junit] Caused by: java.lang.IndexOutOfBoundsException: Insufficient maximum stack size.
[exec] [junit]	at org.objectweb.asm.tree.analysis.Frame.push(Frame.java:207)
[exec] [junit]	at org.objectweb.asm.tree.analysis.Frame.execute(Frame.java:312)
[exec] [junit]	at org.objectweb.asm.tree.analysis.Analyzer.analyze(Analyzer.java:194)
[exec] [junit]	... 44 more
```

I attempted to increase the memory and stack size of Java/Javalanche with no success. I decided to look deeper and saw that the transformation is failing due to this error in Javalanche:

```
[exec] [junit]	at de.unisb.cs.st.javalanche.mutation.javaagent.classFileTransfomer.MutationFileTransformer.transform(MutationFileTransformer.java:92)
```

-----

I found that there is a `System.exit(0);` in the aforementioned file ([de.unisb.cs.st.javalanche.mutation.javaagent.classFileTransfomer.MutationFileTransformer][1]) which is why the *runMutations* task keeps repeating over-and-over as the task is ending abruptly. I see that there is also a commented *throw* just under the exit statement. I have enabled this locally and it seemed to have solved my problem (the task keeps on going, though I am assuming that the thrown error is handled appropriately).

-----

I also found the following test from JGAP cause this error:

```
org.jgap.gp.impl.GPConfigurationTest.testClone_1
org.jgap.gp.impl.GPConfigurationTest.testClone_0
org.jgap.gp.impl.GPGenotypeTest.testConstruct_1
org.jgap.gp.impl.GPGenotypeTest.testConstruct_0
org.jgap.gp.impl.GPGenotypeTest.testOutputSolution_0
org.jgap.gp.impl.GPGenotypeTest.testConfigurationInstance_0
org.jgap.gp.impl.GPGenotypeTest.testReferenceProblem_0
```

[1]: https://github.com/david-schuler/javalanche/blob/master/src/main/java/de/unisb/cs/st/javalanche/mutation/javaagent/classFileTransfomer/MutationFileTransformer.java#L118
[2]: http://jgap.cvs.sourceforge.net/viewvc/jgap/jgap/tests/org/jgap/gp/impl/GPGenotypeTest.java?view=markup
[3]: https://gist.github.com/1982702