Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TEST: java/util/Locale/LocaleCategory.java failed with jdk_util_j9: ubuntu, openj9, 11 |15 #59

Closed
sophia-guo opened this issue Dec 16, 2020 · 10 comments
Assignees
Milestone

Comments

@sophia-guo
Copy link
Contributor

Test failed:

#24 (comment)

STDERR:
java.util.IllformedLocaleException: Ill-formed language: c.u [at index 0]
	at java.base/java.util.Locale$Builder.setLanguage(Locale.java:2585)
	at LocaleCategory.main(LocaleCategory.java:56)
	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.MainWrapper$MainThread.run(MainWrapper.java:127)
	at java.base/java.lang.Thread.run(Thread.java:836)

JavaTest Message: Test threw exception: java.util.IllformedLocaleException: Ill-formed language: c.u [at index 0]
JavaTest Message: shutting down test

STATUS:Failed.`main' threw exception: java.util.IllformedLocaleException: Ill-formed language: c.u [at index 0]
rerun:
cd /home/runner/work/run-aqa/run-aqa/openjdk-tests/TKG/test_output_16080649133171/jdk_util_j9_0/work/scratch && \
HOME=/home/runner \
LANG=C.UTF-8 \
PATH=/bin:/usr/bin:/usr/sbin \
CLASSPATH=/home/runner/work/run-aqa/run-aqa/openjdk-tests/TKG/test_output_16080649133171/jdk_util_j9_0/work/classes/java/util/Locale/LocaleCategory.d:/home/runner/work/run-aqa/run-aqa/openjdk-tests/openjdk/openjdk-jdk/test/jdk/java/util/Locale:/home/runner/work/run-aqa/run-aqa/openjdk-tests/TKG/test_output_16080649133171/jdk_util_j9_0/work/classes/java/text/testlib:/home/runner/work/run-aqa/run-aqa/openjdk-tests/openjdk/openjdk-jdk/test/jdk/java/text/testlib:/home/runner/work/run-aqa/run-aqa/jvmtest/openjdk/jtreg/lib/javatest.jar:/home/runner/work/run-aqa/run-aqa/jvmtest/openjdk/jtreg/lib/jtreg.jar \
    /opt/hostedtoolcache/jdk-11-openj9/1.0.0/x64/bin/java \
        -Dtest.vm.opts='-ea -esa -Xmx512m -Xdump:system:none -Xdump:heap:none -Xdump:system:events=gpf+abort+traceassert+corruptcache' \
        -Dtest.tool.vm.opts='-J-ea -J-esa -J-Xmx512m -J-Xdump:system:none -J-Xdump:heap:none -J-Xdump:system:events=gpf+abort+traceassert+corruptcache' \
        -Dtest.compiler.opts= \
        -Dtest.java.opts= \
        -Dtest.jdk=/opt/hostedtoolcache/jdk-11-openj9/1.0.0/x64 \
        -Dcompile.jdk=/opt/hostedtoolcache/jdk-11-openj9/1.0.0/x64 \
        -Dtest.timeout.factor=8.0 \
        -Dtest.root=/home/runner/work/run-aqa/run-aqa/openjdk-tests/openjdk/openjdk-jdk/test/jdk \
        -Dtest.name=java/util/Locale/LocaleCategory.java \
        -Dtest.file=/home/runner/work/run-aqa/run-aqa/openjdk-tests/openjdk/openjdk-jdk/test/jdk/java/util/Locale/LocaleCategory.java \
        -Dtest.src=/home/runner/work/run-aqa/run-aqa/openjdk-tests/openjdk/openjdk-jdk/test/jdk/java/util/Locale \
        -Dtest.src.path=/home/runner/work/run-aqa/run-aqa/openjdk-tests/openjdk/openjdk-jdk/test/jdk/java/util/Locale:/home/runner/work/run-aqa/run-aqa/openjdk-tests/openjdk/openjdk-jdk/test/jdk/java/text/testlib \
        -Dtest.classes=/home/runner/work/run-aqa/run-aqa/openjdk-tests/TKG/test_output_16080649133171/jdk_util_j9_0/work/classes/java/util/Locale/LocaleCategory.d \
        -Dtest.class.path=/home/runner/work/run-aqa/run-aqa/openjdk-tests/TKG/test_output_16080649133171/jdk_util_j9_0/work/classes/java/util/Locale/LocaleCategory.d:/home/runner/work/run-aqa/run-aqa/openjdk-tests/TKG/test_output_16080649133171/jdk_util_j9_0/work/classes/java/text/testlib \
        -Dtest.class.path.prefix=/home/runner/work/run-aqa/run-aqa/openjdk-tests/TKG/test_output_16080649133171/jdk_util_j9_0/work/classes/java/util/Locale/LocaleCategory.d:/home/runner/work/run-aqa/run-aqa/openjdk-tests/openjdk/openjdk-jdk/test/jdk/java/util/Locale:/home/runner/work/run-aqa/run-aqa/openjdk-tests/TKG/test_output_16080649133171/jdk_util_j9_0/work/classes/java/text/testlib \
        -ea \
        -esa \
        -Xmx512m \
        -Xdump:system:none \
        -Xdump:heap:none \
        -Xdump:system:events=gpf+abort+traceassert+corruptcache \
        -Duser.language.display=ja \
        -Duser.language.format=zh \
        com.sun.javatest.regtest.agent.MainWrapper /home/runner/work/run-aqa/run-aqa/openjdk-tests/TKG/test_output_16080649133171/jdk_util_j9_0/work/java/util/Locale/LocaleCategory.d/main.0.jta

TEST RESULT: Failed. Execution failed: `main' threw exception: java.util.IllformedLocaleException: Ill-formed language: c.u [at index 0]

Initial investigation:
#24 (comment)
#24 (comment)

@karianna karianna added the bug Something isn't working label Dec 16, 2020
@lumpfish
Copy link

lumpfish commented Jan 6, 2021

Also seen on AdoptOpenJDK jdk15 nightly build: https://ci.adoptopenjdk.net/job/Test_openjdk15_j9_sanity.openjdk_x86-64_linux/152/consoleFull
Testing on docker images has just been introduced for the AdoptOpenJDK x86_linux builds -I cannot find an instance of this failure on a non docker test.
Was the test failure reported in this issue also running on docker?

@sophia-guo
Copy link
Contributor Author

@lumpfish it's running on git-hub runner, shouldn't be docker.

@sxa
Copy link
Member

sxa commented Jan 9, 2021

This has been seen on multiple systems where LANG is not set to en_US.UTF-8 (See adoptium/infrastructure#1268, adoptium/aqa-tests#1705 and eclipse-openj9/openj9#9042 for examples)

My feeling is that we should be able to run these tests on any system in any locale and if we don't we have a bug that needs to be resolved. We cannot assume that anyone who wants to run our tests suites is in the US! While setting that locale on the systems affected as a global would likely resolve it it does not feel like the right solution as it is simply masking the problem. We should either

  • Set it as a default on the system (which I don't personally approve of)
  • If the specific test case somehow requires that locale to be set, it should be set by the test case
  • Understand why it doesn't work in other locales and fix the underlying problem with the test case or the java code.
  • If none of the above are viable, perhaps modify the entire test harness to set it at the start to make it self-contained

@smlambert
Copy link
Contributor

The test material in question is from OpenJDK.

Agree that making the test more resilient to any environment is optimal. Historically, when we have suggested upstream OpenJDK tests contain more logic to 'do the right thing', it was met with a different philosophical approach than you have suggested.

(In a different issue regarding jdi tests where we thought tests should clean up stray processes they started, the JBS issue was closed with a note that said its up to the person running the test to do such activities).

I am happy to always start with the attempt to report/fix the test at the source (as described in our Triage guidelines), in this case in OpenJDK.

@sophia-guo
Copy link
Contributor Author

sophia-guo commented Jan 9, 2021

I'm not sure if it's the test case issue as the test never has issue with hotspot impl with the exact same environment as far as I know. It looks likely there's some difference between hotspot and openj9 underlying?

@sxa
Copy link
Member

sxa commented Jan 11, 2021

If that's true (and a quick scan through our logs suggests it's on jdk_util_j9_0 in sanity.openjdk on JDK11+ - have not seen it on 8 so far) it sounds like we need to raise with OpenJ9 ... @pshipton is this something you're aware of and if it's not something obvious shall we raise an issue against OpenJ9?

@pshipton
Copy link

Please open an OpenJ9 issue. I can reproduce the problem on Ubuntu (16) by exporting LANG=C.UTF-8 and then checking the user.language system property, which is set to c.u. The problematic code is here https://github.com/eclipse/openj9-omr/blob/openj9/port/unix/j9nlshelpers.c#L120-L132, which doesn't expect setlocale(LC_CTYPE, NULL); to return C.UTF-8.

@sophia-guo sophia-guo added upstream bug and removed bug Something isn't working labels Jan 11, 2021
@sophia-guo
Copy link
Contributor Author

Issue opened in eclipse-openj9/openj9#11620,

Keep this open for verification.

@pshipton
Copy link

The OMR change has promoted, should be fixed in the next build.

@sophia-guo
Copy link
Contributor Author

Test passed. Close it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants