uncaught exception during compilation: java.lang.ArrayIndexOutOfBoundsException

233 views
Skip to first unread message

Indu

unread,
Jul 18, 2016, 8:46:28 AM7/18/16
to Gatling User Group
Hi All,

We have been using Gatling for a while to record and play simulations to load test our Web app. While executing certain simulations we get the following Compilation error in zinc compiler. We are using an older version of Gatling - 2.0.1.

I tried breaking to multiple chains, as well as increasing the jvmArgs value in gatling.conf assuming it is a stack size issue. How ever that did not have any impact. The error remains the same.

If I comment out some of the Http requests, it appears to compile fine. I could not find any other posts about this issue... Any suggestions?

Thanks in advance,
Indu


I have pasted the console output here.
--------------------------------------------------------------------------------------------------------------------------------------------
     while compiling: D:\Gatling\gatling-charts-highcharts-2.0.1\user-files\simulations\sim1.scala
        during phase: jvm
     library version: version 2.10.4
    compiler version: version 2.10.4

----------------------------------------------------------------------------------------
  last tree to typer: Literal(Constant(String))
              symbol: null
   symbol definition: null
                 tpe: Class(classOf[java.lang.String])
       symbol owners:
      context owners: anonymous class anonfun$3 -> package <empty>

== Enclosing template or block ==

Template( // val <local $anonfun>: <notype>, tree.tpe=anonfun$3
  "scala.runtime.AbstractFunction1", "scala.Serializable" // parents
  ValDef(
    private
    "_"
    <tpt>
    <empty>
  )
  // 3 statements
  DefDef( // final def apply(session: io.gatling.core.session.Session): io.gatling.core.validation.Validation
    <method> final <triedcooking>
    "apply"
    []
    // 1 parameter list
    ValDef( // session: io.gatling.core.session.Session
      <param> <triedcooking>
      "session"
      <tpt> // tree.tpe=io.gatling.core.session.Session
      <empty>
    )
    <tpt> // tree.tpe=io.gatling.core.validation.Validation
    Apply( // implicit def value2Success(value: Object): io.gatling.core.validation.Validation in object Predef, tree.tpe=io.gatling.core.validation.Validation
      "io"."gatling"."core"."Predef"."value2Success" // implicit def value2Success(value: Object): io.gatling.core.validation.Validation in object Predef, tree.tpe=(value: Object)io.gatling.core.valid
dation
      Apply( // def set(key: String,value: Object): io.gatling.core.session.Session in class Session, tree.tpe=io.gatling.core.session.Session
        "session"."set" // def set(key: String,value: Object): io.gatling.core.session.Session in class Session, tree.tpe=(key: String, value: Object)io.gatling.core.session.Session
        // 2 arguments
        "aPath"
        "assigned-14648890"
      )
    )
  )
  DefDef( // final def apply(v1: Object): Object
    <method> final <bridge>
    "apply"
    []
    // 1 parameter list
    ValDef( // v1: Object
      <param> <triedcooking>
      "v1"
      <tpt> // tree.tpe=Object
      <empty>
    )
    <tpt> // tree.tpe=Object
    Apply( // final def apply(session: io.gatling.core.session.Session): io.gatling.core.validation.Validation, tree.tpe=io.gatling.core.validation.Validation
      sim1$$anonfun$3.this."apply" // final def apply(session: io.gatling.core.session.Session): io.gatling.core.validation.Validation, tree.tpe=(session: io.gatling.core
ession)io.gatling.core.validation.Validation
      Apply( // final def $asInstanceOf[T0 >: ? <: ?](): T0 in class Object, tree.tpe=io.gatling.core.session.Session
        TypeApply( // final def $asInstanceOf[T0 >: ? <: ?](): T0 in class Object, tree.tpe=()io.gatling.core.session.Session
          "v1"."$asInstanceOf" // final def $asInstanceOf[T0 >: ? <: ?](): T0 in class Object, tree.tpe=[T0 >: ? <: ?]()T0
          <tpt> // tree.tpe=io.gatling.core.session.Session
        )
        Nil
      )
    )
  )
  DefDef( // def <init>(arg$outer: sim1): anonfun$3
    <method> <triedcooking>
    "<init>"
    []
    // 1 parameter list
    ValDef( // $outer: sim1
      <param>
      "$outer"
      <tpt> // tree.tpe=sim1
      <empty>
    )
    <tpt> // tree.tpe=anonfun$3
    Block( // tree.tpe=Unit
      Apply( // def <init>(): scala.runtime.AbstractFunction1 in class AbstractFunction1, tree.tpe=scala.runtime.AbstractFunction1
        sim1$$anonfun$3.super."<init>" // def <init>(): scala.runtime.AbstractFunction1 in class AbstractFunction1, tree.tpe=()scala.runtime.AbstractFunction1
        Nil
      )
      ()
    )
  )
)

== Expanded type of tree ==

ConstantType(value = Constant(String))

uncaught exception during compilation: java.lang.ArrayIndexOutOfBoundsException
Compilation failed

Indu

unread,
Jul 19, 2016, 11:16:05 AM7/19/16
to Gatling User Group
I got full stack trace of the Exception by compiling the simulation from SBT console.
-----------------------------------------------------------------------------------------------------------------------------------
[error] == Expanded type of tree ==
[error]
[error] ConstantType(value = Constant(String))
[error]
[error] uncaught exception during compilation: java.lang.ArrayIndexOutOfBoundsException
java.lang.ArrayIndexOutOfBoundsException: 4111
        at scala.tools.asm.MethodWriter.getSize(MethodWriter.java:1860)
        at scala.tools.asm.ClassWriter.toByteArray(ClassWriter.java:792)
        at scala.tools.nsc.backend.jvm.GenASM$JBuilder.writeIfNotTooBig(GenASM.scala:458)
        at scala.tools.nsc.backend.jvm.GenASM$JPlainBuilder.genClass(GenASM.scala:1413)
        at scala.tools.nsc.backend.jvm.GenASM$AsmPhase.run(GenASM.scala:120)
        at scala.tools.nsc.Global$Run.compileUnitsInternal(Global.scala:1583)
        at scala.tools.nsc.Global$Run.compileUnits(Global.scala:1557)
        at scala.tools.nsc.Global$Run.compileSources(Global.scala:1553)
        at scala.tools.nsc.Global$Run.compile(Global.scala:1662)
        at xsbt.CachedCompiler0.run(CompilerInterface.scala:116)
        at xsbt.CachedCompiler0.run(CompilerInterface.scala:95)
        at xsbt.CompilerInterface.run(CompilerInterface.scala:26)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at sbt.compiler.AnalyzingCompiler.call(AnalyzingCompiler.scala:101)
        at sbt.compiler.AnalyzingCompiler.compile(AnalyzingCompiler.scala:47)
        at sbt.compiler.AnalyzingCompiler.compile(AnalyzingCompiler.scala:41)
        at sbt.compiler.MixedAnalyzingCompiler$$anonfun$compileScala$1$1.apply$mcV$sp(MixedAnalyzingCompiler.scala:50)
        at sbt.compiler.MixedAnalyzingCompiler$$anonfun$compileScala$1$1.apply(MixedAnalyzingCompiler.scala:50)
        at sbt.compiler.MixedAnalyzingCompiler$$anonfun$compileScala$1$1.apply(MixedAnalyzingCompiler.scala:50)
        at sbt.compiler.MixedAnalyzingCompiler.timed(MixedAnalyzingCompiler.scala:74)
        at sbt.compiler.MixedAnalyzingCompiler.compileScala$1(MixedAnalyzingCompiler.scala:49)
        at sbt.compiler.MixedAnalyzingCompiler.compile(MixedAnalyzingCompiler.scala:64)
        at sbt.compiler.IC$$anonfun$compileInternal$1.apply(IncrementalCompiler.scala:160)
        at sbt.compiler.IC$$anonfun$compileInternal$1.apply(IncrementalCompiler.scala:160)
        at sbt.inc.IncrementalCompile$$anonfun$doCompile$1.apply(Compile.scala:66)
        at sbt.inc.IncrementalCompile$$anonfun$doCompile$1.apply(Compile.scala:64)
        at sbt.inc.IncrementalCommon.cycle(IncrementalCommon.scala:32)
        at sbt.inc.Incremental$$anonfun$1.apply(Incremental.scala:68)
        at sbt.inc.Incremental$$anonfun$1.apply(Incremental.scala:67)
        at sbt.inc.Incremental$.manageClassfiles(Incremental.scala:95)
        at sbt.inc.Incremental$.compile(Incremental.scala:67)
        at sbt.inc.IncrementalCompile$.apply(Compile.scala:54)
        at sbt.compiler.IC$.compileInternal(IncrementalCompiler.scala:160)
        at sbt.compiler.IC$.incrementalCompile(IncrementalCompiler.scala:138)
        at sbt.Compiler$.compile(Compiler.scala:152)
        at sbt.Compiler$.compile(Compiler.scala:138)
        at sbt.Defaults$.sbt$Defaults$$compileIncrementalTaskImpl(Defaults.scala:860)
        at sbt.Defaults$$anonfun$compileIncrementalTask$1.apply(Defaults.scala:851)
        at sbt.Defaults$$anonfun$compileIncrementalTask$1.apply(Defaults.scala:849)
        at scala.Function1$$anonfun$compose$1.apply(Function1.scala:47)
        at sbt.$tilde$greater$$anonfun$$u2219$1.apply(TypeFunctions.scala:40)
        at sbt.std.Transform$$anon$4.work(System.scala:63)
        at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:228)
        at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:228)
        at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:17)
        at sbt.Execute.work(Execute.scala:237)
        at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:228)
        at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:228)
        at sbt.ConcurrentRestrictions$$anon$4$$anonfun$1.apply(ConcurrentRestrictions.scala:159)
        at sbt.CompletionService$$anon$2.call(CompletionService.scala:28)
        at java.util.concurrent.FutureTask.run(FutureTask.java:262)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
        at java.util.concurrent.FutureTask.run(FutureTask.java:262)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at java.lang.Thread.run(Thread.java:745)
[error] (compile:compileIncremental) java.lang.ArrayIndexOutOfBoundsException: 4111


Indu

unread,
Jul 19, 2016, 2:30:46 PM7/19/16
to Gatling User Group
I was able to solve the problem by creating a couple of scala objects and move few of the chains to those objects.

Stéphane LANDELLE

unread,
Jul 19, 2016, 3:33:03 PM7/19/16
to gat...@googlegroups.com
You most likely have a chain that's way too long, resulting in a method (actually, the constructor) that causes the compiler to choke.

Stéphane Landelle
GatlingCorp CEO


On Tue, Jul 19, 2016 at 8:30 PM, Indu <indusas...@gmail.com> wrote:
I was able to solve the problem by creating a couple of scala objects and move few of the chains to those objects.

--
You received this message because you are subscribed to the Google Groups "Gatling User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gatling+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages