Harmony
  1. Harmony
  2. HARMONY-2130

[drlvm][kernel] DaCapo antlr fails on drlvm

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: DRLVM
    • Labels:
      None
    • Environment:
      Linux (but suspected on windows too)

      Description

      The DaCapo antlr benchmark appears to use a version of antlr supplied by drlvm/harmony class libraries. The dacapo benchmark is based on antlr v2.7.2, and running

      $ $DRLVM_HOME/jre/bin/java -jar $HOME/dacapo-2006-10.jar antlr
      ===== DaCapo antlr starting =====
      Running antlr on grammar antlr/cpp/calc.g
      ANTLR Parser Generator Version 2.7.5 (20050128) 1989-2005 jGuru.com

      whereas on J9, we get
      $ /opt/ibm-java2-i386-50/bin/java -jar $HOME/dacapo-2006-10.jar antlr
      ===== DaCapo antlr starting =====
      Running antlr on grammar antlr/cpp/calc.g
      ANTLR Parser Generator Version 2.7.2 1989-2003 jGuru.com

      A workaround is possible by setting

      -Xbootclasspath/p:antlr.jar

      but this is clearly undesirable.

        Issue Links

          Activity

          Hide
          Vladimir Strigun added a comment -

          after the discussion on dev list I agree with you that we should fix it in drlvm. Looks like I was wrong.

          Show
          Vladimir Strigun added a comment - after the discussion on dev list I agree with you that we should fix it in drlvm. Looks like I was wrong.
          Hide
          Robin Garner added a comment -

          Ok, so what will happen if I have an application that requires antlr
          version 2.7.7 (for example), and I run

          $PATH_TO_DRLVM/jre/bin/java -cp antlr-2.7.7.jar antlr.Tool myGrammar.g

          What version of antlr will I run ? 2.7.7 or 2.7.5 ? What about when I
          compile the generated classes into an application, and run it ? will they
          pick up the bootclasspath versions of the antlr classes, or the ones in my
          command line library ?

          Show
          Robin Garner added a comment - Ok, so what will happen if I have an application that requires antlr version 2.7.7 (for example), and I run $PATH_TO_DRLVM/jre/bin/java -cp antlr-2.7.7.jar antlr.Tool myGrammar.g What version of antlr will I run ? 2.7.7 or 2.7.5 ? What about when I compile the generated classes into an application, and run it ? will they pick up the bootclasspath versions of the antlr classes, or the ones in my command line library ?
          Hide
          Vladimir Strigun added a comment -

          Robin,

          Unfortunately I can't say that I agree with you. Yes, antlr benchmark works correctly on more that 8 VMs, but the reason that benchmark finished abnormal on DRLVM is antl.jar in bootclasspath of VM. So, if I correctly understand the behavior of the bench will be the same on other VM's with antlr.jar bootclasspathed. As far as I can see from build file of Dacapo, you download antlr sources, patch it (the main point here is removing of System.exit() call from main method of Tool class), build it and use run Tool class during benchmarking.
          I've suggested to add additional method to AntlrHarness class that allows to avoid usage of main() function. In that case benchmark passes on VM with antlr bootclasspathed. Of course, version check should be done prior to execution.

          What do you think about it?

          Show
          Vladimir Strigun added a comment - Robin, Unfortunately I can't say that I agree with you. Yes, antlr benchmark works correctly on more that 8 VMs, but the reason that benchmark finished abnormal on DRLVM is antl.jar in bootclasspath of VM. So, if I correctly understand the behavior of the bench will be the same on other VM's with antlr.jar bootclasspathed. As far as I can see from build file of Dacapo, you download antlr sources, patch it (the main point here is removing of System.exit() call from main method of Tool class), build it and use run Tool class during benchmarking. I've suggested to add additional method to AntlrHarness class that allows to avoid usage of main() function. In that case benchmark passes on VM with antlr bootclasspathed. Of course, version check should be done prior to execution. What do you think about it?
          Hide
          Robin Garner added a comment -

          Hi Vladimir,

          I'll double check with Steve when I see him tomorrow, but my recollection
          is that we decided that since the benchmark works correctly on 8 or more
          other
          VMs, that the problem is with DRLVM or the Harmony classlib, not with
          DaCapo. Maybe we could add an antlr.jar in the same way as we provide
          xalan.jar.

          As far as we can tell, this problem would affect anyone running a version
          of antlr other than 2.7.5.

          cheers,
          Robin

          Show
          Robin Garner added a comment - Hi Vladimir, I'll double check with Steve when I see him tomorrow, but my recollection is that we decided that since the benchmark works correctly on 8 or more other VMs, that the problem is with DRLVM or the Harmony classlib, not with DaCapo. Maybe we could add an antlr.jar in the same way as we provide xalan.jar. As far as we can tell, this problem would affect anyone running a version of antlr other than 2.7.5. cheers, Robin
          Hide
          Vladimir Strigun added a comment -

          Hi Robin,

          About 1 month ago I've sent the patch for Dacapo to Steve. Within the patch it's possible to start Dacapo.atlr benchmark even if original antlr package exists in booclasspath. Do you know whether the patch will appear in the next release of Dacapo?

          Thanks,
          Vladimir.

          Show
          Vladimir Strigun added a comment - Hi Robin, About 1 month ago I've sent the patch for Dacapo to Steve. Within the patch it's possible to start Dacapo.atlr benchmark even if original antlr package exists in booclasspath. Do you know whether the patch will appear in the next release of Dacapo? Thanks, Vladimir.
          Hide
          Naveen Neelakantam added a comment -

          Thanks Robin, that did the trick!

          Show
          Naveen Neelakantam added a comment - Thanks Robin, that did the trick!
          Hide
          Robin Garner added a comment -

          Yep. DaCapo makes a small patch to antlr to remove a 'System.exit' at
          the end of parsing a grammar. Download

          http://cs.anu.edu.au/people/Robin.Garner/dacapo/antlr-dacapo.jar

          and use in place of the downloaded antlr-2.7.2 jar. Alternately, grab
          the antlr patch from the dacapo source distribution, and patch antlr
          2.7.2 yourself.

          cheers


          Robin Garner
          Dept. of Computer Science
          Australian National University
          http://cs.anu.edu.au/people/Robin.Garner/

          Show
          Robin Garner added a comment - Yep. DaCapo makes a small patch to antlr to remove a 'System.exit' at the end of parsing a grammar. Download http://cs.anu.edu.au/people/Robin.Garner/dacapo/antlr-dacapo.jar and use in place of the downloaded antlr-2.7.2 jar. Alternately, grab the antlr patch from the dacapo source distribution, and patch antlr 2.7.2 yourself. cheers – Robin Garner Dept. of Computer Science Australian National University http://cs.anu.edu.au/people/Robin.Garner/
          Hide
          Naveen Neelakantam added a comment -

          I have tried using the antlr.jar contained in antlr-2.7.2.tar.gz downloaded as part of the "sources" target of the DaCapo sources, but the workaround does not work for me. The benchmark terminates early as reported in HARMONY-1906:

          > java -Xbootclasspath/p:antlr.jar -jar dacapo-2006-10.jar -n 2 antlr
          ===== DaCapo antlr starting warmup =====
          Running antlr on grammar antlr/cpp/calc.g
          ANTLR Parser Generator Version 2.7.2 1989-2003 jGuru.com
          >

          Show
          Naveen Neelakantam added a comment - I have tried using the antlr.jar contained in antlr-2.7.2.tar.gz downloaded as part of the "sources" target of the DaCapo sources, but the workaround does not work for me. The benchmark terminates early as reported in HARMONY-1906 : > java -Xbootclasspath/p:antlr.jar -jar dacapo-2006-10.jar -n 2 antlr ===== DaCapo antlr starting warmup ===== Running antlr on grammar antlr/cpp/calc.g ANTLR Parser Generator Version 2.7.2 1989-2003 jGuru.com >
          Hide
          Robin Garner added a comment -

          I can work around it by putting the DaCapo antlr.jar at the start of the
          bootclasspath, but it's not ideal. (we also do that for xalan)


          Robin Garner
          Dept. of Computer Science
          Australian National University
          http://cs.anu.edu.au/people/Robin.Garner/

          Show
          Robin Garner added a comment - I can work around it by putting the DaCapo antlr.jar at the start of the bootclasspath, but it's not ideal. (we also do that for xalan) – Robin Garner Dept. of Computer Science Australian National University http://cs.anu.edu.au/people/Robin.Garner/
          Hide
          Alexey Varlamov added a comment -

          As a quick workaround drlvm could probably switch to 2.7.2 version of antlr

          Show
          Alexey Varlamov added a comment - As a quick workaround drlvm could probably switch to 2.7.2 version of antlr
          Hide
          Alexey Varlamov added a comment -

          Looks like we really have to get rid of antlr dependency for drlvm kernel classes.

          Show
          Alexey Varlamov added a comment - Looks like we really have to get rid of antlr dependency for drlvm kernel classes.

            People

            • Assignee:
              Unassigned
              Reporter:
              Robin Garner
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:

                Development