core.match

Invalid method Code length when generating red black tree matcher

Details

  • Type: Defect Defect
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Completed
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None
  • Environment:

Description

The issue is the same as stated on
https://github.com/swannodette/match/issues/54
but moved here as a part of moving match to Clojure contrib.

Here is a copy of the text from the issue above:

After having forked the latest version on branch and compiling I attempted to execute the infamous red-black tree rebalancing code.

(let [node nil]
(match/match
[node]
[([:black [:red [:red a x b] y c] z d] |
[:black [:red a x [:red b y c]] z d] |
[:black a x [:red [:red b y c] z d]] |
[:black a x [:red b y [:red c z d]]])]
[:red [:black a x b] y [:black c z d]]))
The good news is that issue issue 47 is indeed resolved. The bad news is that a new issue has cropped up, namely that the ClassFormatError with the message

error: java.lang.ClassFormatError: Invalid method Code length 78596 in class file redblack/core$eval3306 (core.clj:10)
is raised.

Activity

Hide
David Nolen added a comment -

Do you encounter this error at the REPL?

Show
David Nolen added a comment - Do you encounter this error at the REPL?
Hide
Thomas Greve Kristensen added a comment -

Sort of - it is encountered when connecting to the REPL using swank form emacs.

Show
Thomas Greve Kristensen added a comment - Sort of - it is encountered when connecting to the REPL using swank form emacs.
Hide
David Nolen added a comment -

Can you elaborate the exact steps? What OS?

I'm interested in knowing the details since I haven't run into it myself - solving http://dev.clojure.org/jira/browse/MATCH-1 should address this problem.

Show
David Nolen added a comment - Can you elaborate the exact steps? What OS? I'm interested in knowing the details since I haven't run into it myself - solving http://dev.clojure.org/jira/browse/MATCH-1 should address this problem.
Hide
Thomas Greve Kristensen added a comment -

I have executed all my tests on a mac os x lion 10.7.1. I've just added my (failing) code to github, it can be found here:
https://github.com/tgk/RedBlackTreesUsingMatch

The steps are as follows:
lein deps
lein swank
From aquaemacs, connect to swank using slime-connect
Open the file src/redblack/core.clj
Execute the entire file (C-c C-k if memory serves)

Sorry for the very brief description, but I'm at work...

Show
Thomas Greve Kristensen added a comment - I have executed all my tests on a mac os x lion 10.7.1. I've just added my (failing) code to github, it can be found here: https://github.com/tgk/RedBlackTreesUsingMatch The steps are as follows: lein deps lein swank From aquaemacs, connect to swank using slime-connect Open the file src/redblack/core.clj Execute the entire file (C-c C-k if memory serves) Sorry for the very brief description, but I'm at work...
Hide
Thomas Greve Kristensen added a comment -

Here's a bit longer description:

First, I cloned clojure.core.match.core and installed it using
mvn install

I have added a :main description to the project above. To make it fail I can simply use
lein run

Show
Thomas Greve Kristensen added a comment - Here's a bit longer description: First, I cloned clojure.core.match.core and installed it using mvn install I have added a :main description to the project above. To make it fail I can simply use lein run
Hide
Thomas Greve Kristensen added a comment -

I have also tried using 1.3.0-master-SNAPSHOT of clojure but with no luck. Which version of java are you using?

Show
Thomas Greve Kristensen added a comment - I have also tried using 1.3.0-master-SNAPSHOT of clojure but with no luck. Which version of java are you using?
Hide
Thomas Greve Kristensen added a comment -

I have also tried using 1.3.0-master-SNAPSHOT of clojure but with no luck. Which version of java are you using?

Show
Thomas Greve Kristensen added a comment - I have also tried using 1.3.0-master-SNAPSHOT of clojure but with no luck. Which version of java are you using?
Hide
David Nolen added a comment -

Sorry been a bit swamped so I haven't had a chance to go through your exact steps (I'm sure I'll get the same error). Again I'm pretty confident I know why the red black tree pattern generates so much code. Adding backtracking will be a significant code size optimization.

Show
David Nolen added a comment - Sorry been a bit swamped so I haven't had a chance to go through your exact steps (I'm sure I'll get the same error). Again I'm pretty confident I know why the red black tree pattern generates so much code. Adding backtracking will be a significant code size optimization.
Hide
David Nolen added a comment -

See MATCH-1

Show
David Nolen added a comment - See MATCH-1
Hide
David Nolen added a comment -

Fixed now in master.

Show
David Nolen added a comment - Fixed now in master.
David Nolen made changes -
Field Original Value New Value
Status Open [ 1 ] Resolved [ 5 ]
Resolution Completed [ 1 ]
David Nolen made changes -
Status Resolved [ 5 ] Closed [ 6 ]

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: