Coder Social home page Coder Social logo

Comments (10)

Storyyeller avatar Storyyeller commented on June 14, 2024

Are you using a nonstandard JVM? It appears that your JVM is handling invalid innerclass attribute lengths differently than Hotspot does. At any rate, you can ignore the test if you want.

For what it's worth, here's mine.

java version "1.7.0_21"
Java(TM) SE Runtime Environment (build 1.7.0_21-b11)
Java HotSpot(TM) 64-Bit Server VM (build 23.21-b01, mixed mode)

from krakatau.

Storyyeller avatar Storyyeller commented on June 14, 2024

The relevant code is in http://hg.openjdk.java.net/jdk7/hotspot-rt/hotspot/file/5dce25362b8a/src/share/vm/classfile/classFileParser.cpp. Does your build include this?

from krakatau.

daveloyall avatar daveloyall commented on June 14, 2024

I'm using the standard JVM. Well, the standard JVM for my family of operating systems. http://openjdk.java.net/projects/icedtea/

I used to install Sun Java on my GNU/Linux systems, but starting with openjdk-7, I was promised that openjdk-7 would BE the standard.

...Hm, yes, that still seems to be the case. According to http://openjdk.java.net/faq/, Oracle Java is based on OpenJDK, not the other way around. :)

That being said, I'll certainly see what JVMs are available for my Debian machine and see which ones pass or fail this test.

Hm, java.lang.ClassFormatError: Truncated class file seems like a reasonable response to the .innerlength 0xFFFFFFFF thing, right?

Cheers,

from krakatau.

Storyyeller avatar Storyyeller commented on June 14, 2024

BadInnerTest and OldVersionTest are effectively testing undocumented corner cases in Hotspot. You can ignore them if you wish.

I'm surprised yours is behaving differently though since the code is part of the OpenJDK code base.

from krakatau.

daveloyall avatar daveloyall commented on June 14, 2024

I have learned that I can use different VMs by employing command line arguments when invoking java.

Abbreviated java -help output:

-server   to select the "server" VM
-zero     to select the "zero" VM
-jamvm    to select the "jamvm" VM
-avian    to select the "avian" VM
          The default VM is server,
          because you are running on a server-class machine.

(server is apparently IcedTea, though I have also read that my default VM is Hotspot and I'm not sure about the relationship between them in OpenJDK. It's not even clear to me that IcedTea is a VM and not merely a build environment for OpenJDK.)

However, it's not immediately apparent to me whether I need to modify runtests.py or tests/__init__.py in order to add a command line argument to the java invocation.

from krakatau.

Storyyeller avatar Storyyeller commented on June 14, 2024

You need to modify runtests.py line 27. For consistency, you'd probably want to change line 74 too.

init.py only has the name and inputs for each test.

from krakatau.

daveloyall avatar daveloyall commented on June 14, 2024

So, I modified runtests.py to take a command line argument --vm= and here are my results, just FYI. The results for avian are apparently a local problem.

$ ./runtests.py --vm=server |tail -22:

VM was: server. Test results:
  ArgumentTypes: Pass
  ArrayTest: Pass
  BadInnerTest: Fail
  BoolizeTest: Pass
  ControlFlow: Pass
  DoubleEdge: Pass
  DuplicateInit: Pass
  NullInference: Pass
  OddsAndEnds: Pass
  OldVersionTest: Pass
  SkipJSR: Pass
  StaticInitializer: Pass
  Switch: Pass
  Synchronized: Pass
  TryCatchTest: Pass
  UnicodeTest: Pass
  WhileLoops: Pass
  floattest: Pass
  splitnew: Pass
18/19 tests passed

$ ./runtests.py --vm=zero |tail -22:

VM was: zero. Test results:
  ArgumentTypes: Pass
  ArrayTest: Fail
  BadInnerTest: Fail
  BoolizeTest: Pass
  ControlFlow: Pass
  DoubleEdge: Pass
  DuplicateInit: Pass
  NullInference: Pass
  OddsAndEnds: Pass
  OldVersionTest: Pass
  SkipJSR: Pass
  StaticInitializer: Pass
  Switch: Fail
  Synchronized: Pass
  TryCatchTest: Pass
  UnicodeTest: Pass
  WhileLoops: Pass
  floattest: Pass
  splitnew: Pass
16/19 tests passed

$ ./runtests.py --vm=jamvm |tail -22:

VM was: jamvm. Test results:
  ArgumentTypes: Pass
  ArrayTest: Fail
  BadInnerTest: Fail
  BoolizeTest: Pass
  ControlFlow: Fail
  DoubleEdge: Pass
  DuplicateInit: Pass
  NullInference: Pass
  OddsAndEnds: Pass
  OldVersionTest: Pass
  SkipJSR: Pass
  StaticInitializer: Pass
  Switch: Pass
  Synchronized: Pass
  TryCatchTest: Pass
  UnicodeTest: Pass
  WhileLoops: Pass
  floattest: Pass
  splitnew: Pass
16/19 tests passed

$ ./runtests.py --vm=avian |tail -22:

VM was: avian. Test results:
  ArgumentTypes: Fail
  ArrayTest: Fail
  BadInnerTest: Fail
  BoolizeTest: Fail
  ControlFlow: Fail
  DoubleEdge: Fail
  DuplicateInit: Fail
  NullInference: Fail
  OddsAndEnds: Fail
  OldVersionTest: Fail
  SkipJSR: Fail
  StaticInitializer: Fail
  Switch: Fail
  Synchronized: Fail
  TryCatchTest: Fail
  UnicodeTest: Fail
  WhileLoops: Fail
  floattest: Fail
  splitnew: Fail
0/19 tests passed

from krakatau.

Storyyeller avatar Storyyeller commented on June 14, 2024

That's weird. The pure Java tests (ArrayTest and Switch) shouldn't fail regardless of which JVM is being used. Did you record what the error messages were? The only thing I can think of is that it might be printing out stack traces differently after recompilation despite compiling without debugging info.

P.S. Did you remember to regenerate the expected outputs (tests/*.test) in between tests? If you switch VMs without changing the expected output you'll get false failures.

from krakatau.

Storyyeller avatar Storyyeller commented on June 14, 2024

I went ahead and disabled the implementation specific tests (BadInnerTest and OldVersionTest).

from krakatau.

Storyyeller avatar Storyyeller commented on June 14, 2024

FYI, I tested this again a couple weeks ago and it no longer works even in Java 8. It seems that this undocumented feature is only present up to Java 7.

from krakatau.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.