Message12700

Author adamburke
Recipients adamburke, jeff.allen
Date 2019-10-07.08:24:20
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1570436661.01.0.476034503456.issue2810@roundup.psfhosted.org>
In-reply-to
Content
I get it on Oracle jdk 11.0.4 too though

C:\Users\Adam\jython\jython5\jython>dist\bin\jython.exe -m test.regrtest -e -v test_jython_initializer
== 2.7.2a1+ (uncontrolled:+, Oct. 7 2019, 18:17:02)
== [Java HotSpot(TM) 64-Bit Server VM (Oracle Corporation)]
== platform: java11.0.4
== encodings: stdin=cp850, stdout=cp850, FS=utf-8
== locale: default=('en_AU', 'windows-1252'), actual=(None, None)
test_jython_initializer
test_syspath_initializer (test.test_jython_initializer.TestUsingInitializer) ... Exception in thread "main" java.lang.NoSuchMethodError: java.nio.ByteBuffer.clear()Ljava/nio/ByteBuffer;
        at org.python.core.io.BufferedReader.clear(BufferedReader.java:147)
        at org.python.core.io.BufferedReader.<init>(BufferedReader.java:27)
        at org.python.core.PyFile.createBuffer(PyFile.java:227)
        at org.python.core.PyFile.file___init__(PyFile.java:185)
        at org.python.core.PyFile.file___init__(PyFile.java:178)
        at org.python.core.PyFile.<init>(PyFile.java:101)
        at org.python.core.PySystemState.<init>(PySystemState.java:237)
        at org.python.core.PySystemState.doInitialize(PySystemState.java:1222)
        at SyspathAppendingInitializer.initialize(SyspathAppendingInitializer.java:15)
        at org.python.core.PySystemState.initialize(PySystemState.java:1171)
        at org.python.core.PySystemState.initialize(PySystemState.java:1102)
        at org.python.core.PySystemState.initialize(PySystemState.java:1085)
        at org.python.core.PySystemState.initialize(PySystemState.java:1080)
        at org.python.core.PySystemState.initialize(PySystemState.java:1075)
        at org.python.util.jython.main(jython.java:531)
FAIL

======================================================================
FAIL: test_syspath_initializer (test.test_jython_initializer.TestUsingInitializer)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Users\Adam\jython\jython5\jython\dist\Lib\test\test_jython_initializer.py", line 23, in test_syspath_initializer
    self.assertEquals(0, subprocess.call([sys.executable, fn], env=env))
AssertionError: 0 != 1

----------------------------------------------------------------------
Ran 1 test in 0.911s


Further weirdness - other classes have this same idiom, but don't trigger the bug. A good example is org/python/util/ConsoleOutputStream.java

  protected java.lang.CharSequence getPrompt(java.nio.charset.Charset);
    Code:
       0: aload_0
       1: getfield      #4                  // Field buf:Ljava/nio/ByteBuffer;
       4: invokevirtual #13                 // Method java/nio/ByteBuffer.flip:()Ljava/nio/ByteBuffer;
       7: pop
       8: aload_1
       9: aload_0
      10: getfield      #4                  // Field buf:Ljava/nio/ByteBuffer;
      13: invokevirtual #14                 // Method java/nio/charset/Charset.decode:(Ljava/nio/ByteBuffer;)Ljava/nio/CharBuffer;
      16: astore_2
      17: aload_0
      18: getfield      #4                  // Field buf:Ljava/nio/ByteBuffer;
      21: invokevirtual #15                 // Method java/nio/ByteBuffer.compact:()Ljava/nio/ByteBuffer;
      24: pop
      25: aload_2
      26: areturn
}

getPrompt() is called on every evaluation of the Jython console. I even put println() statements in to prove it was getting called, without this crash. JIT is only thing I can think of that would cause that? Since it seems to have the same invokevirtual instruction on the same method.
History
Date User Action Args
2019-10-07 08:24:21adamburkesetmessageid: <1570436661.01.0.476034503456.issue2810@roundup.psfhosted.org>
2019-10-07 08:24:21adamburkesetrecipients: + adamburke, jeff.allen
2019-10-07 08:24:20adamburkelinkissue2810 messages
2019-10-07 08:24:20adamburkecreate