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.8
  • 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)
  • Patch:
    Code
  • Approval:
    Incomplete

Description

Important Perf Note the new impl is faster for collections that are custom-reducible but not chunked, and is also faster for large numbers of bindings. The original implementation is hand tuned for chunked collections, and wins for larger chunked coll/smaller binding count scenarios, presumably due to the fn call/return tracking overhead of reduce. Details are in the comments.
Screened By
Patch doseq.patch

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.

  1. doseq.patch
    25/Jun/14 9:05 PM
    3 kB
    Ghadi Shayban
  2. doseq-bench.txt
    28/Jun/14 6:24 PM
    7 kB
    Ghadi Shayban
  3. script.clj
    28/Jun/14 6:24 PM
    3 kB
    Ghadi Shayban

Activity

People

Vote (3)
Watch (4)

Dates

  • Created:
    Updated: