groovy
  1. groovy
  2. GROOVY-5267

getting java.lang.VerifyError depending on some simple method content

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 1.7.10, 1.8.0, 1.8.4, 1.8.5, 2.0-beta-2
    • Fix Version/s: 1.8.6, 2.0-beta-3
    • Component/s: Compiler
    • Labels:
      None
    • Environment:
      linux 64bit, sun jvm 1.6.0.29,
    • Testcase included:
      yes
    • Number of attachments :
      3

      Description

      This is a very strange issue. Everything was working but then I added some very basic code in a method and I'm now seeing this issue with 1.7.10, 1.8.0 & 1.8.4: The openStore() method is throwing java.lang.VerifyError when I activate line 104 below but it works if I comment 104 and activate 103.

      I've attached a zip file with lucene jars, two groovy files and one runme.sh script.

      Thanks for looking into this!

      BTW, I'm seeing the same issue with groovy-2.0.0-beta-2

      In LuceneStore.groovy (attached)

          97          /* FIXME: Bug triggers here
          98             with this line, everything works:
          99                  writer.setRAMBufferSizeMB(400);
         100             with this line, we get the java.lang.VerifyError
         101                 writer.setRAMBufferSizeMB(defaultRamBufferSize());
         102          */       
         103         // writer.setRAMBufferSizeMB(400);
         104         writer.setRAMBufferSizeMB(defaultRamBufferSize());
      

        Activity

        Hide
        CÚdric Champeau added a comment -

        confirmed on 1.8.5 and master too

        Show
        CÚdric Champeau added a comment - confirmed on 1.8.5 and master too
        Hide
        CÚdric Champeau added a comment - - edited

        The problem is most likely due to the fact you've written writer.setRAMBufferSizeMB(defaultRamBufferSize()) instead of writer.setRAMBufferSizeMB(defaultRamBufferSize) (defaultRamBufferSize is an int, not a method nor a closure). However, a VerifyError should not happen.=

        Show
        CÚdric Champeau added a comment - - edited The problem is most likely due to the fact you've written writer.setRAMBufferSizeMB(defaultRamBufferSize()) instead of writer.setRAMBufferSizeMB(defaultRamBufferSize) (defaultRamBufferSize is an int, not a method nor a closure). However, a VerifyError should not happen.=
        Hide
        CÚdric Champeau added a comment -

        Attached a simpler example which triggers the same error (on 1.8.X, not on master, where an NPE is thrown instead).

        Show
        CÚdric Champeau added a comment - Attached a simpler example which triggers the same error (on 1.8.X, not on master, where an NPE is thrown instead).
        Hide
        CÚdric Champeau added a comment -

        Stripped down:

        class Bar {
           int defaultValue = 40
           void m() {
            defaultValue()
           }
        }
        new Bar().m()
        
        Show
        CÚdric Champeau added a comment - Stripped down: class Bar { int defaultValue = 40 void m() { defaultValue() } } new Bar().m()
        Hide
        Jean-Philippe Robichaud added a comment -

        oh, wow, good catch removing this typo (not sure why I ended up with that, I'm currently re-factoring some code) makes everything working properly now.

        I guess a "no such method" exception would have been better

        Thanks!

        Show
        Jean-Philippe Robichaud added a comment - oh, wow, good catch removing this typo (not sure why I ended up with that, I'm currently re-factoring some code) makes everything working properly now. I guess a "no such method" exception would have been better Thanks!
        Hide
        blackdrag blackdrag added a comment -

        I set it as critical bug for 1.8,so we don't forget about this one

        Show
        blackdrag blackdrag added a comment - I set it as critical bug for 1.8,so we don't forget about this one

          People

          • Assignee:
            CÚdric Champeau
            Reporter:
            Jean-Philippe Robichaud
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: