JDK-8207780 : FindDecoderBugs.java fails intermittently with GB18030 charset
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.nio.charsets
  • Affected Version: 8,12
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows
  • CPU: x86_64
  • Submitted: 2018-07-18
  • Updated: 2024-02-02
  • Resolved: 2024-02-02
Related Reports
Duplicate :  
Relates :  
Relates :  
Description
The following test failed in the JDK12 CI:

sun/nio/cs/FindDecoderBugs.java

Here is a snippet from the log file:

-----
Results differ for direct buffers: GB18030
    "??"[4/4] => UNDERFLOW "u????"[1/19]
    "??"[0/4] => MALFORMED[4] ""[0/19] (direct)
failures=1
-----
Results differ for direct buffers: GB18030
    "??"[4/4] => UNDERFLOW "u????"[1/1]
    "??"[0/4] => MALFORMED[4] ""[0/1] (direct)
failures=1

Passed = 521138590, failed = 2

----------System.err:(12/717)----------
java.lang.AssertionError: Some tests failed
	at FindDecoderBugs.main(FindDecoderBugs.java:448)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at com.sun.javatest.regtest.agent.MainActionHelper$SameVMRunnable.run(MainActionHelper.java:229)
	at java.base/java.lang.Thread.run(Thread.java:834)

JavaTest Message: Test threw exception: java.lang.AssertionError
JavaTest Message: shutting down test

result: Failed. Execution failed: `main' threw exception: java.lang.AssertionError: Some tests failed


test result: Failed. Execution failed: `main' threw exception: java.lang.AssertionError: Some tests failed
Comments
This is a dup bug that is recently fixed: JDK-8211382.
30-11-2018

It looks like the test case randomly selects the input byte sequence, thus the intermittency. The offending sequence is: 0x84, 0x31, 0xa4, 0x38, which is U+FFFE in GB18030 encoding. The decoding using direct buffer for some reason regards this byte sequence as MALFORMED.
30-11-2018

I set the seed from the failing test run with: * @run main/othervm/timeout=1800 -Dseed=-7467769374842554699 FindDecoderBugs and it fails reliably on Mac at the same place.
18-07-2018

In the past, this test has failed with C2 issues so I think we should capture a bit of information about the machine where this happened in case it is significant.
18-07-2018

Found a really old sighting of this test failing, but the failure mode is different: JDK-7067676
18-07-2018