Skip to content
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

java.lang.ArrayIndexOutOfBoundsException: 256 with scala-asm #9391

Closed
scabug opened this issue Jul 11, 2015 · 3 comments
Closed

java.lang.ArrayIndexOutOfBoundsException: 256 with scala-asm #9391

scabug opened this issue Jul 11, 2015 · 3 comments
Assignees

Comments

@scabug
Copy link

scabug commented Jul 11, 2015

I am attempting to compile a generated Scala project (its a wsdl SOAP API which generates .scala sources, which are then compiled), and I am getting the following error

https://gist.github.com/mdedetrich/069a9b506eb6b7ff01ed

One important thing to note, is that the generated scala sources are huge (it generates 3891 scala sources, some of those files end up having > 100k lines of source code). To generate the Scala sources themselves, it takes around 2-3 hours, and to compile the sources it takes around 5 hours (with the following SBT arguments so it doesn't run out of memory)

-J-Xmx8G
-J-XX:MaxMetaspaceSize=1G
-J-XX:+CMSClassUnloadingEnabled
-J-XX:+UseConcMarkSweepGC

There is a github issue for this on scala-xb (eed3si9n/scalaxb#234 (comment)), however this appears to be strictly a scala compiler problem, probably due to a corner case of compiling such a huge number of sources.

Note that I do have the .wsdl sources/SBT project in question, however I can't share it publicly because its a private API. I can however provide a private link to download the SBT project to whoever is working on the issue.

@scabug
Copy link
Author

scabug commented Jul 11, 2015

Imported From: https://issues.scala-lang.org/browse/SI-9391?orig=1
Reporter: Matthew de Detrich (mdedetrich)
Affected Versions: 2.11.7

@scabug
Copy link
Author

scabug commented Jul 11, 2015

Matthew de Detrich (mdedetrich) said (edited on Jul 11, 2015 3:15:13 AM UTC):
Managed to find the issue in the scala-asm source code, its here

https://github.com/scala/scala-asm/blob/master/src/main/java/scala/tools/asm/ClassWriter.java#L611

The array size is being statically set to 256, which is probably too small for the size of the Scala code that is being compiled, maybe making it larger/allowing it to be set/ using something like Integer.MAX_VALUE-10 would solve the problem?

EDIT: Have also added an issue on scala-asm github, link is here scala/scala-asm#8

@scabug
Copy link
Author

scabug commented Jul 13, 2015

@retronym said:
Thanks for reporting.

Let's continue the discussion over on the scala-asm issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants