Uploaded image for project: 'Clojure'
  1. CLJ-1322

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

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects versions: Release 1.5
    • Fix versions: Release 1.11
    • 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:
      Incomplete
    • Patch:
      Code

      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.

        Attachments

        1. doseq.patch
          3 kB
        2. doseq-bench.txt
          7 kB
        3. script.clj
          3 kB

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              arcatan Miikka Koskinen
            • Votes:
              4 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated: