Clojure

doseq with several bindings causes "ClassFormatError: Invalid Method Code length"

Details

  • Type: Defect Defect
  • Status: Open Open
  • Priority: Major Major
  • Resolution: Unresolved
  • Affects Version/s: Release 1.5
  • Fix Version/s: Release 1.7
  • Component/s: None
  • Labels:
    None
  • Environment:
    Clojure 1.5.1, java 1.7.0_25, OpenJDK Runtime Environment (IcedTea 2.3.10) (7u25-2.3.10-1ubuntu0.12.04.2)
  • Approval:
    Vetted

Description

user=> (def a1 (range 10))
#'user/a1
user=> (doseq [x1 a1 x2 a1 x3 a1 x4 a1 x5 a1 x6 a1 x7 a1 x8 a1] (do))
CompilerException java.lang.ClassFormatError: Invalid method Code length 69883 in class file user$eval1032, compiling:(NO_SOURCE_PATH:2:1)

While this example is silly, it's a problem we've hit a couple of times. It's pretty surprising when you have just a couple of lines of code and suddenly you get the code length error.

Activity

Hide
Kevin Downey added a comment -

reproduces with jdk 1.8.0 and clojure 1.6

Show
Kevin Downey added a comment - reproduces with jdk 1.8.0 and clojure 1.6
Hide
Nicola Mometto added a comment -

A potential fix for this is to make doseq generate intermediate fns like `for` does instead of expanding all the code directly.

Show
Nicola Mometto added a comment - A potential fix for this is to make doseq generate intermediate fns like `for` does instead of expanding all the code directly.

People

Vote (1)
Watch (2)

Dates

  • Created:
    Updated: