Bug 958232 - java-1.8.0-openjdk fails to build on s390(x)
java-1.8.0-openjdk fails to build on s390(x)
Status: CLOSED CURRENTRELEASE
Product: Fedora
Classification: Fedora
Component: java-1.8.0-openjdk (Show other bugs)
19
s390x Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: jiri vanek
Fedora Extras Quality Assurance
:
Depends On:
Blocks: ZedoraTracker
  Show dependency treegraph
 
Reported: 2013-04-30 12:14 EDT by Dan Horák
Modified: 2014-08-16 16:49 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2014-08-16 16:49:51 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)
rebased size_t patch (10.41 KB, patch)
2013-04-30 12:17 EDT, Dan Horák
no flags Details | Diff
patch to recognize s390(x) (645 bytes, patch)
2013-04-30 12:17 EDT, Dan Horák
no flags Details | Diff
update for spec file (541 bytes, patch)
2013-04-30 12:18 EDT, Dan Horák
no flags Details | Diff
full build.log from s390 (114.71 KB, text/x-log)
2013-05-03 09:15 EDT, Dan Horák
no flags Details
rebased and refreshed size_t patch (17.58 KB, patch)
2013-05-03 11:33 EDT, Dan Horák
no flags Details | Diff
workaround the OOM error on s390 (857 bytes, patch)
2013-05-03 11:33 EDT, Dan Horák
no flags Details | Diff
workaround the OOM error on s390 (854 bytes, patch)
2013-05-03 12:00 EDT, Dan Horák
no flags Details | Diff

  None (edit)
Description Dan Horák 2013-04-30 12:14:31 EDT
java-1.8.0-openjdk-1.8.0.0-0.5.b87 fails to build on s390(x) because

- the size_t patch needs rebase
- s390/s390x is not recognized as supported arch at all

I have fixed these 2 issues for s390x, see attachments

and the build on s390 (32 bit but with 2GB address space) fails with
mkdir -p /builddir/build/BUILD/java-1.8.0-openjdk/jdk8/build/jdk8.build/langtools/genstubs
mkdir -p /builddir/build/BUILD/java-1.8.0-openjdk/jdk8/build/jdk8.build/langtools/tmpstubs
echo > /dev/null Generating stubs from JDK sources.
(/usr/lib/jvm/java-openjdk/bin/java -Xms64M -Xmx1100M -XX:PermSize=32m -XX:MaxPermSize=160m -XX:ThreadStackSize=1536 "-Xbootclasspath/p:/builddir/build/BUILD/java-1.8.0-openjdk/jdk8/build/jdk8.build/langtools/dist/bootstrap/lib/javac.jar" -classpath /builddir/build/BUILD/java-1.8.0-openjdk/jdk8/build/jdk8.build/langtools/btclasses genstubs.GenStubs -s /builddir/build/BUILD/java-1.8.0-openjdk/jdk8/build/jdk8.build/langtools/tmpstubs -sourcepath /builddir/build/BUILD/java-1.8.0-openjdk/jdk8/jdk/src/share/classes java.util.Objects && echo STUBS_ARE_CREATED=yes > /builddir/build/BUILD/java-1.8.0-openjdk/jdk8/build/jdk8.build/langtools/genstubs/_the_stubs.d)
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
Error occurred during initialization of VM
Could not reserve enough space for object heap
gmake[1]: Leaving directory `/builddir/build/BUILD/java-1.8.0-openjdk/jdk8/langtools/makefiles'
gmake[1]: *** No rule to make target `all', needed by `default'.  Stop.
Comment 1 Dan Horák 2013-04-30 12:17:02 EDT
Created attachment 741915 [details]
rebased size_t patch
Comment 2 Dan Horák 2013-04-30 12:17:45 EDT
Created attachment 741916 [details]
patch to recognize s390(x)
Comment 3 Dan Horák 2013-04-30 12:18:32 EDT
Created attachment 741917 [details]
update for spec file
Comment 4 Dan Horák 2013-04-30 12:19:23 EDT
Please let me know if you need access to a s390(x) Fedora machine.
Comment 5 Omair Majid 2013-05-01 16:27:56 EDT
(In reply to comment #4)
> Please let me know if you need access to a s390(x) Fedora machine.

I would like to submit these patches upstream, but upstream requires a contributor agreement. Have you (or your employer) signed the OCA [1] by any chance? It would be nice to have access to a s390(x) machine so I can test this patch before sending it upstream.

[1] http://www.oracle.com/technetwork/oca-405177.pdf
Comment 6 Dan Horák 2013-05-01 16:43:59 EDT
(In reply to comment #5)
> (In reply to comment #4)
> > Please let me know if you need access to a s390(x) Fedora machine.
> 
> I would like to submit these patches upstream, but upstream requires a
> contributor agreement. Have you (or your employer) signed the OCA [1] by any
> chance? It would be nice to have access to a s390(x) machine so I can test
> this patch before sending it upstream.

this is my Fedora identity, I'm a Red Hat employee (dhorak@rh.c), so I guess the agreement doesn't make any problem. Please ping me (dhorak) tomorrow on internal IRC for the s390x machine access (I'm on the way to bed now :-) ). Thanks, Dan
Comment 7 Andrew John Hughes 2013-05-03 05:47:15 EDT
You say the size_t patch is a rebasing.  Where is the original from and why did it need rebasing?

The other change is fairly trivial and is just what we had in IcedTea beforehand, so looks fine.
Comment 8 Dan Horák 2013-05-03 06:01:32 EDT
the changes are visible in
http://pkgs.fedoraproject.org/cgit/java-1.8.0-openjdk.git/commit/?id=337e4b1b973806a312e6b1169464e70351d8c982

IIRC the hunk for jdk8/hotspot/src/share/vm/memory/collectorPolicy.cpp failed, because the context (see the // comments) around the change is different
Comment 9 Dan Horák 2013-05-03 06:46:16 EDT
The size_t patch needs a verification on s390, where the size_t makes the problem. I'm not able to run the build there because it fails very early with the "Could not reserve enough space for object heap" error (see above).
Comment 10 Dan Horák 2013-05-03 09:15:23 EDT
Created attachment 743211 [details]
full build.log from s390
Comment 11 Chris Phillips @ TO 2013-05-03 10:05:55 EDT
Hi
Its likely not able to reserve -Xmx1100 out of 2gb in jvm init. Try reducing that value (I'll try to find the place but not really familiar with new build yet...)

Chris
Comment 12 Dan Horák 2013-05-03 11:33:06 EDT
Created attachment 743258 [details]
rebased and refreshed size_t patch

This is a result of successful HotSpot build on s390.
Comment 13 Dan Horák 2013-05-03 11:33:59 EDT
Created attachment 743259 [details]
workaround the OOM error on s390
Comment 14 Dan Horák 2013-05-03 12:00:25 EDT
Created attachment 743260 [details]
workaround the OOM error on s390

s/endif/fi/
Comment 15 Dan Horák 2013-05-03 12:46:05 EDT
(In reply to comment #13)
> Created attachment 743259 [details]
> workaround the OOM error on s390

I'll also try a build on Fedora builders whose have more memory than my test machine, not sure if there will be a change when the limit is 2GB per process, but still worth trying IMHO.
Comment 16 Fedora Admin XMLRPC Client 2014-02-04 11:21:42 EST
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.
Comment 17 Dan Horák 2014-05-21 09:43:51 EDT
so I'm still struggling with this one ...

from build.log on s390 (32-bit)
...
+ /usr/bin/echo Generating stubs from JDK sources.
Generating stubs from JDK sources.
(/usr/lib/jvm/java-openjdk/bin/java -Xms64M -Xmx1100M -XX:PermSize=32m -XX:MaxPermSize=160m -XX:ThreadStackSize=1536 "-Xbootclasspath/p:/builddir/build/BUILD/java-1.8.0-openjdk/jdk8/build/jdk8.build/langtools/dist/bootstrap/lib/javac.jar" -classpath /builddir/build/BUILD/java-1.8.0-openjdk/jdk8/build/jdk8.build/langtools/btclasses genstubs.GenStubs -s /builddir/build/BUILD/java-1.8.0-openjdk/jdk8/build/jdk8.build/langtools/tmpstubs -sourcepath /builddir/build/BUILD/java-1.8.0-openjdk/jdk8/jdk/src/share/classes   java.util.function.Predicate && /usr/bin/echo STUBS_ARE_CREATED = yes > /builddir/build/BUILD/java-1.8.0-openjdk/jdk8/build/jdk8.build/langtools/genstubs/_the_stubs.d)
BuildLangtools.gmk:150: Building /builddir/build/BUILD/java-1.8.0-openjdk/jdk8/build/jdk8.build/langtools/genstubs/_the_stubs.d  (from /builddir/build/BUILD/java-1.8.0-openjdk/jdk8/jdk/src/share/classes/java/util/function/Predicate.java) (/builddir/build/BUILD/java-1.8.0-openjdk/jdk8/jdk/src/share/classes/java/util/function/Predicate.java /builddir/build/BUILD/java-1.8.0-openjdk/jdk8/build/jdk8.build/langtools/btclasses/_the.BUILD_TOOLS_batch /builddir/build/BUILD/java-1.8.0-openjdk/jdk8/build/jdk8.build/langtools/dist/bootstrap/lib/javac.jar /builddir/build/BUILD/java-1.8.0-openjdk/jdk8/build/jdk8.build/langtools/gensrc/_the_props.d  newer)
+ /usr/lib/jvm/java-openjdk/bin/java -Xms64M -Xmx1100M -XX:PermSize=32m -XX:MaxPermSize=160m -XX:ThreadStackSize=1536 -Xbootclasspath/p:/builddir/build/BUILD/java-1.8.0-openjdk/jdk8/build/jdk8.build/langtools/dist/bootstrap/lib/javac.jar -classpath /builddir/build/BUILD/java-1.8.0-openjdk/jdk8/build/jdk8.build/langtools/btclasses genstubs.GenStubs -s /builddir/build/BUILD/java-1.8.0-openjdk/jdk8/build/jdk8.build/langtools/tmpstubs -sourcepath /builddir/build/BUILD/java-1.8.0-openjdk/jdk8/jdk/src/share/classes java.util.function.Predicate
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
Error occurred during initialization of VM
Could not reserve enough space for object heap
gmake[1]: Leaving directory `/builddir/build/BUILD/java-1.8.0-openjdk/jdk8/langtools/make'
gmake[1]: *** No rule to make target `all', needed by `default'.  Stop.
make: *** [langtools-only] Error 2
Comment 18 Dan Horák 2014-05-21 09:48:04 EDT
I have tried various -Xmx values, for 800 it fails with

#
# There is insufficient memory for the Java Runtime Environment to continue.
# pthread_getattr_np
# An error report file with more information is saved as:
# /tmp/jvm-24104/hs_error.log
gmake[1]: *** [/builddir/build/BUILD/java-1.8.0-openjdk/jdk8/build/jdk8.build/langtools/classes/_the.BUILD_FULL_JAVAC_batch] Error 1
gmake[1]: Leaving directory `/builddir/build/BUILD/java-1.8.0-openjdk/jdk8/langtools/make'
make: *** [langtools-only] Error 2

for 900, 1100, 1300 it fails with the error in comment #17

I've also tried setting ThreadStackSize to 768 (as used in 32 bit builds), but no change
Comment 19 Dan Horák 2014-05-21 17:38:00 EDT
resolved/workarounded by 

diff -up jdk8/common/autoconf/boot-jdk.m4.s390 jdk8/common/autoconf/boot-jdk.m4
--- jdk8/common/autoconf/boot-jdk.m4.s390	2014-03-11 16:01:27.000000000 -0400
+++ jdk8/common/autoconf/boot-jdk.m4	2014-05-21 11:50:36.507890197 -0400
@@ -315,12 +315,12 @@ AC_DEFUN_ONCE([BOOTJDK_SETUP_BOOT_JDK_AR
     fi
 
     # Minimum amount of heap memory.
-    ADD_JVM_ARG_IF_OK([-Xms64M],boot_jdk_jvmargs,[$JAVA])
+    ADD_JVM_ARG_IF_OK([-Xms256M],boot_jdk_jvmargs,[$JAVA])
     if test "x$OPENJDK_TARGET_OS" = "xmacosx"; then
       # Why does macosx need more heap? Its the huge JDK batch.
       ADD_JVM_ARG_IF_OK([-Xmx1600M],boot_jdk_jvmargs,[$JAVA])
     else
-      ADD_JVM_ARG_IF_OK([-Xmx1100M],boot_jdk_jvmargs,[$JAVA])
+      ADD_JVM_ARG_IF_OK([-Xmx512M],boot_jdk_jvmargs,[$JAVA])
     fi
     # When is adding -client something that speeds up the JVM?
     # ADD_JVM_ARG_IF_OK([-client],boot_jdk_jvmargs,[$JAVA])

as suggested by aph

I'll close this once I have a build in s390 koji.

Note You need to log in before you can comment on or make changes to this bug.