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
Replace mingw with clang in compilation #2979
Replace mingw with clang in compilation #2979
Conversation
The changes mainly include:
Reviewer: @pshipton , @keithc-ca FYI @DanHeidinga |
6223f2a
to
35c8c92
Compare
Have you tested building Windows 32-bit? |
Nope, all builds were compiled on Windows 64-bit. |
I will try compiling a 32-bit Java 8 build on a Fyre machine to ensure everything works fine. |
35c8c92
to
05b945d
Compare
I've already complid Java 8 32 bit with MSVC + Clang (32bit). There is pretty much no change with compiler flags except that the compiler needs to be Clang 32bit (http://releases.llvm.org/6.0.1/LLVM-6.0.1-win32.exe) [1] Sanity test(functional) 64bit: [2] Sanity test (functional) 32bit: (2) msvc + clang TOTAL: 163 EXECUTED: 94 PASSED: 89 FAILED: 5 SKIPPED: 69 I manually ran one of failing tests cmdLineTester_jvmtitests_hcr_SE80_3 and it stopped working in testBCIUsingASM_InjectTryCatch_Level2_injectCatchAndThrowNewAIOBE_catchAIOBEAndThrowNewAE
Not yet figured out what happened to the failing tests on the build compiled with msvc + clang |
I tried replacing Still need to get back to the failing tests for root cause. |
05b945d
to
c463445
Compare
Investigation shows these test failures were triggered by 4 test classes in which the methods share the pretty much the same nested try-catch structure. That being said, these failures belong to the same issue.
/test/functional/cmdLineTests/jvmtitests/src/com/ibm/jvmti/tests/BCIWithASM/ta001.java
/test/functional/cmdLineTests/jvmtitests/src/com/ibm/jvmti/tests/BCIWithASM/Source4.java
The crash issue disappeared by removing count=0 (only with JIT on/off)
/test/functional/JIT_Test/src/jit/test/jitt/cfg/nestedExceptions.java
The crash issue disappeared by removing count=0 (only with JIT on/off)
/test/functional/Java8andUp/testng.xml
/test/functional/Java8andUp/src/org/openj9/test/java/lang/Test_ClassCastException.java
/test/functional/Java8andUp/src/org/openj9/test/java/lang/Test_InstantiationException.java
The crash issue disappeared by specifying -Xint (with JIT off) So it turns out JIT doesn't work good with the nested exception structure on the Clang compiled build on Windows 32bit. I suggest to create a separate issue for JIT to address the issue after merging the changes. Meanwhile, these failing test cases should be temporarily excluded unless the crash issue gets revolved by JIT. @pshipton , any other concern at this point? |
JIT should take a look at the crashes in advance of merging. We can't just exclude and ignore the problems as they may appear in other ways. |
or maybe @gacholio can help, its strange there would be a JIT issue when only the bytecode interpreter is compiled with clang. |
As with anything that crashes with the JIT and not without, limit the compilations down using -Xjit:verbose,vlog=filename and then -Xjit:limitfile=filename (you can trim the limitfile to get down to the minimal set of compiled methods). Especially effective with count=0. |
Personally, I think making a change which causes tests for fail for unknown reasons and excluding the tests is a terrible idea. Who knows what else out there is going to exhibit the issue? |
It's definitely correct to get JIT guys involved in the analysis before merging the changes. |
Guess we can check with them and see how they want to proceed. |
To confirm the crash was caused by JIT/count=0, actually I already isolated the failing methods by removing all methods in the test file before compiling the test case. e.g.
The triage on other 2 failing tests followed the same way: the whole test case passed by removing the failing methods by specifying -Xjit(removing count=0) or -Xint (disabling JIT) |
To get things simple, directly compile and run the following class (the class was copied from /test/functional/cmdLineTests/jvmtitests/src/com/ibm/jvmti/tests/BCIWithASM/Source4.java which is used in testBCIUsingASM_InjectTryCatch_Level2_injectCatchAndThrowNewAIOBE_catchAIOBEAndThrowNewAE)
It crashed when specifying -Xjit:count=0.
|
@0dvictor could you help take a look? Seems to fail consistently with |
@0dvictor , I already packaged these compiled builds at T drive for your analysis Administrator@JCHTORWIN101 ../z_jdk11_comp/perf_builds java8_32bit: |
I can run both builds now. However, instead of a crash, I got different failure - no crash but no output at all. Will investigate further. I suspect it is related to the signal handler, since |
The failure can be reproduced with |
@keithc-ca , does it mean there is problem with signal handler to deal with the nested exceptions on Windows 32bit? |
I suspect the root issue lies in the exception throw entry to the interpreter from the JIT (this path is never taken in pure interpreter mode). If you can run this in the debugger, break at |
I ran it in the debugger (Visual Studio), and found that |
@babsingh Any thoughts about signal handling? |
Is there an MSVC ifdef which should be windows? |
Hmm, looks like OMR believes both _MSC_VER and clang will be defined at the same time. |
We didn't have such tests but we already had perf test to ensure Clang meets our expectation at #2979 (comment)
USE_COMPUTED_GOTO is not defined when compiling with Clang because
Meanwhile, defining USE_COMPUTED_GOTO will end up with a bunch of errors during the compilation with Clang.
|
6f02255
to
6404604
Compare
I already added |
jenkins test all win jdk8,jdk11 |
jenkins test all win32 jdk8 |
jenkins line endings check |
jenkins copyright check |
jenkins test all win jdk11 |
jenkins test sanity win jdk11 |
jenkins test extended win jdk11 |
Why are there module.xml changes for util? There don't seem to be any clang-compiled files there. |
@gacholio note the "runtime/util/mingw_comp.c → runtime/util/clang_comp.c" |
Because runtime/oti/mingw_comp.h --> runtime/oti/clang_comp.h (name and code changed) |
@sxa555 the switch to clang is ready to go. We can coordinate the OpenJ9 change with the Adopt change, maybe on Monday. |
@ChengJin01 please fix the conflicts |
The change is to modify all scripts/code involved to ensure we use Clang in the place of mingw to compile the bytecode interpreter on Windows. Signed-off-by: CHENGJin <jincheng@ca.ibm.com>
6404604
to
672bd6d
Compare
Conflicts in changes have been addressed. |
jenkins compile win jdk8 |
OpenJ9 replaced mingw with Clang in eclipse-openj9#2979 [ci skip] Signed-off-by: Peter Shipton <Peter_Shipton@ca.ibm.com>
The change is to modify all scripts/code
involved to ensure we use Clang in the place
of mingw to compile the bytecode interpreter
on Windows.
depends on #2980
Signed-off-by: CHENGJin jincheng@ca.ibm.com