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

J9UNIX support on OSX #3603

Merged
merged 6 commits into from
Nov 14, 2018
Merged

J9UNIX support on OSX #3603

merged 6 commits into from
Nov 14, 2018

Conversation

babsingh
Copy link
Contributor

@babsingh babsingh commented Nov 7, 2018

1) Remove dead code - unused variable: envVarSize

2) Update (J9UNIX || OSX) ifdefs

  • J9UNIX flag will be enabled for OSX. Thus, replacing ifdefs: (J9UNIX || OSX) -> (J9UNIX).
  • Also, formatted J9UNIX ifdefs according to coding standards.

3) Handle outliers where J9UNIX code doesn't apply to OSX

J9UNIX flag is going to be enabled on OSX.

In jvm.c::JVM_Available and jvm.c::JVM_Open, stat and fstat are used on
OSX because stat64 and fstat64 are deprecated on OSX. J9UNIX code uses
stat64 and fstat64, which needs to be disabled on OSX.

In jvm.c::JVM_SetLength, ftruncate is used on OSX and ftruncate64 is used
on J9UNIX. ftruncate64 is unsupported on OSX. So, J9UNIX code related to
ftruncate64 needs to be disabled on OSX.

4) Avoid multiple J9UNIX definitions and enable J9UNIX flag on OSX

Two definitions of J9UNIX, in jvm.h and vmargs.c, have been removed.

A J9UNIX definition has been added in j9comp.h.

In jvm.h, code dependent on J9UNIX has been moved after j9comp.h is
included.

At the end, J9UNIX flag is enabled on OSX.

5) Use DYLD_LIBRARY_PATH on OSX

On OSX, environment variable, DYLD_LIBRARY_PATH, contains library search
paths. So, ENV_LD_LIB_PATH macro should refer to DYLD_LIBRARY_PATH on
OSX.

6) Don't append /usr/lib64 to java.library.path on OSX

/usr/lib64 doesn't exist on OSX. So, it shouldn't be appended to
java.library.path on OSX.

More details about J9UNIX usage available here: #3452.

Closes: #3452

Signed-off-by: Babneet Singh [email protected]

@babsingh babsingh force-pushed the j9unix_final branch 2 times, most recently from a616139 to d0246af Compare November 7, 2018 22:33
@babsingh babsingh changed the title J9UNIX support on OSX [WIP] J9UNIX support on OSX Nov 7, 2018
@babsingh babsingh force-pushed the j9unix_final branch 2 times, most recently from 31ba2a0 to eb9f637 Compare November 7, 2018 22:59
@babsingh
Copy link
Contributor Author

babsingh commented Nov 8, 2018

@gacholio can you please review these changes?

fyi - @pshipton @pdbain-ibm @DanHeidinga

@babsingh babsingh changed the title [WIP] J9UNIX support on OSX J9UNIX support on OSX Nov 8, 2018
runtime/j9vm/jvm.c Outdated Show resolved Hide resolved
runtime/util/vmargs.c Outdated Show resolved Hide resolved
@babsingh babsingh force-pushed the j9unix_final branch 2 times, most recently from 75bda06 to 44444c4 Compare November 8, 2018 16:11
@babsingh
Copy link
Contributor Author

@gacholio will you be reviewing this pull request?

@gacholio
Copy link
Contributor

I can do - the multiple J9UNIX definition still needs to be updated.

@babsingh babsingh force-pushed the j9unix_final branch 4 times, most recently from e59a307 to 68af41c Compare November 14, 2018 17:34
- J9UNIX flag will be enabled for OSX. Thus, replacing ifdefs: (J9UNIX
|| OSX) -> (J9UNIX).
- Also, formatted J9UNIX ifdefs according to coding standards.

Signed-off-by: Babneet Singh <[email protected]>
@babsingh
Copy link
Contributor Author

@gacholio updated PR - refer to commit 4 - Avoid multiple J9UNIX definitions and enable J9UNIX flag on OSX.

runtime/j9vm/jvm.c Show resolved Hide resolved
runtime/j9vm/jvm.h Outdated Show resolved Hide resolved
runtime/util/vmargs.c Outdated Show resolved Hide resolved
J9UNIX flag is going to be enabled on OSX.

In jvm.c::JVM_Available and jvm.c::JVM_Open, stat and fstat are used on
OSX because stat64 and fstat64 are deprecated on OSX. J9UNIX code uses
stat64 and fstat64, which needs to be disabled on OSX.

In jvm.c::JVM_SetLength, ftruncate is used on OSX and ftruncate64 is
used on J9UNIX. ftruncate64 is unsupported on OSX. So, J9UNIX code
related to ftruncate64 needs to be disabled on OSX.

Signed-off-by: Babneet Singh <[email protected]>
Two definitions of J9UNIX, in jvm.h and vmargs.c, have been removed.

A J9UNIX definition has been added in j9comp.h.

In jvm.h, code dependent on J9UNIX has been moved after j9comp.h is
included.

At the end, J9UNIX flag is enabled on OSX.

Signed-off-by: Babneet Singh <[email protected]>
On OSX, environment variable, DYLD_LIBRARY_PATH, contains library search
paths. So, ENV_LD_LIB_PATH macro should refer to DYLD_LIBRARY_PATH on
OSX.

Signed-off-by: Babneet Singh <[email protected]>
/usr/lib64 doesn't exist on OSX. So, it shouldn't be appended to
java.library.path on OSX.

Signed-off-by: Babneet Singh <[email protected]>
@gacholio
Copy link
Contributor

jenkins test sanity plinux jdk8

@gacholio
Copy link
Contributor

jenkins test sanity osx jdk11

@gacholio
Copy link
Contributor

OSX build failing for known reasons.

@gacholio
Copy link
Contributor

I did say "known reason" :)

@babsingh
Copy link
Contributor Author

OSX JDK11 CI job will work after #3671 is merged.

@babsingh
Copy link
Contributor Author

@gacholio #3671 was just merged. can you restart the OSX JDK11 CI job?

@gacholio
Copy link
Contributor

jenkins test sanity osx jdk11

@gacholio
Copy link
Contributor

gacholio commented Nov 14, 2018

@babsingh Is the pltest failure expected?

@gacholio
Copy link
Contributor

Given that the test failure seems to be unrelated to this PR, I'll merge.

@gacholio gacholio merged commit f744a06 into eclipse-openj9:master Nov 14, 2018
@babsingh
Copy link
Contributor Author

babsingh commented Nov 14, 2018

@gacholio None of the previous OSX JDK11 CI Sanity jobs reached Testing: PLTEST stage. The previous CI jobs seem to be stuck at Testing: abort. These changes resolve the abort hang.

The failure is related to test script mkgen.pl:

17:16:22     echo ""; echo "cmdLineTester_pltest_0""_PASSED"; echo ""; cd /Users/jenkins/workspace/PullRequest-Sanity-JDK11-osx_x86-64_cmprssptrs-OpenJ9/openj9/test/TestConfig/scripts/testKitGen/../../..; rm -f -r "/Users/jenkins/workspace/PullRequest-Sanity-JDK11-osx_x86-64_cmprssptrs-OpenJ9/openj9/test/TestConfig/scripts/testKitGen/../../../TestConfig/test_output_15422313122267/cmdLineTester_pltest_0";
17:16:22 else
17:16:22     echo ""; echo "cmdLineTester_pltest_0""_FAILED"; echo "";
17:16:22 fi; } 2>&1
17:16:22      64364                       | tee -a "/Users/jenkins/workspace/PullRequest-Sanity-JDK11-osx_x86-64_cmprssptrs-OpenJ9/openj9/test/TestConfig/scripts/testKitGen/../../../TestConfig/test_output_15422313122267/TestTargetResult"
17:16:22 make[4]: *** [cmdLineTester_pltest_0] Error 131
17:16:22 make[3]: *** [sanity-pltest] Error 1
17:16:22 make[2]: *** [sanity-cmdLineTests] Error 1
17:16:22 make[1]: *** [sanity-functional] Error 1
17:16:22 make: *** [sanity-..] Error 1

In the above log snippet, the following command is invalid:

64364                       | tee -a "/Users/jenkins/workspace/PullRequest-Sanity-JDK11-osx_x86-64_cmprssptrs-OpenJ9/openj9/test/TestConfig/scripts/testKitGen/../../../TestConfig

Created #3685 for the above PLTEST failure.

Also, the following tests are failing in this PR's Sanity - JDK11 - osx_x86-64_cmprssptrs:

16:49:38 ---SUMMARY OF FAILED TESTS---
16:49:38 abort  
16:49:38 softwareFloat  
16:49:38 hardwareFloat  
16:49:38 softwareRead  
16:49:38 hardwareRead  
16:49:38 abort thread
16:49:38 softwareFloat thread
16:49:38 hardwareFloat thread
16:49:38 softwareRead thread
16:49:38 hardwareRead thread

The reason for the above test failures is UnsatisfiedLinkError:

16:49:18  [ERR] Exception in thread "main" java.lang.UnsatisfiedLinkError: gptest (Not found in java.library.path)
16:49:18  [ERR] 	at java.base/java.lang.ClassLoader.loadLibraryWithPath(ClassLoader.java:1678)
16:49:18  [ERR] 	at java.base/java.lang.ClassLoader.loadLibraryWithClassLoader(ClassLoader.java:1648)
16:49:18  [ERR] 	at java.base/java.lang.System.loadLibrary(System.java:559)
16:49:18  [ERR] 	at VMBench.GPTests.GPTest.<clinit>(GPTest.java:70)

To fix the above test failures, test infrastructure needs to set DYLD_LIBRARY_PATH on MacOSX instead of LD_LIBRARY_PATH. Created #3686 for the above UnsatisfiedLinkError failures.

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

Successfully merging this pull request may close these issues.

4 participants