Summary: | dev-java/icedtea-[6.1.10.4,7.2.2.1] fails to build on x86 due to bad stack alignment. | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Philipp Riegger <bugs+gentoo> |
Component: | [OLD] Java | Assignee: | Andrew John Hughes <gnu_andrew> |
Status: | RESOLVED OBSOLETE | ||
Severity: | normal | CC: | caster, chewi, ed, follettoonip, java, johannes.hirte, mgorny, nrndda, proxy-maint, renegabriels, zima |
Priority: | High | ||
Version: | unspecified | ||
Hardware: | x86 | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Attachments: | hs_err_pid30735.log as mentioned in error message |
Description
Philipp Riegger
2010-04-21 14:39:16 UTC
Created attachment 228631 [details]
hs_err_pid30735.log as mentioned in error message
Does downgrading icedtea6-bin to the previous version help? No, does not help. I'm trying other versions of icedtea at the moment. Bad thing is, it takes very very long until I get to the error. Should I try with sun-jdk instead of icedtea6-bin? (In reply to comment #4) > Should I try with sun-jdk instead of icedtea6-bin? No, you can't build it with sun-jdk. But you could try with gcj-jdk: emerge gcj-jdk JAVA_PKG_FORCE_VM=gcj-jdk emerge icedtea:6 (In reply to comment #5) > (In reply to comment #4) > > Should I try with sun-jdk instead of icedtea6-bin? > > No, you can't build it with sun-jdk. But you could try with gcj-jdk: > emerge gcj-jdk > JAVA_PKG_FORCE_VM=gcj-jdk emerge icedtea:6 > I can confirm this error. Also previous versions of icedtea didn't work, neither with icedtea6-bin nor gjc-jdk. Yes, it does not work with gcj-jdk. I get a different error, but I get an error. Can you show the log with error using gcj-jdk then? [next line very often] /bin/sh: /var/tmp/portage/dev-java/icedtea-6.1.8.0/work/icedtea6-1.8/bootstrap/jdk1.6.0/bin/native2ascii: No such file or directory >>>Making trim-image-jre @ Fri Apr 23 19:47:22 CEST 2010 ... >>>Making trim-image-jdk @ Fri Apr 23 19:47:22 CEST 2010 ... >>>Making process-image-jre @ Fri Apr 23 19:47:22 CEST 2010 ... >>>Making process-image-jdk @ Fri Apr 23 19:47:22 CEST 2010 ... >>>Making sec-files @ Fri Apr 23 19:47:23 CEST 2010 ... >>>Making sec-files-win @ Fri Apr 23 19:47:24 CEST 2010 ... >>>Making jgss-files @ Fri Apr 23 19:47:24 CEST 2010 ... >>>Finished making images @ Fri Apr 23 19:47:24 CEST 2010 ... Control build finished: 10-04-23 19:47 ecj-poured IcedTea is served: openjdk-ecj/build/linux-i586 # # A fatal error has been detected by the Java Runtime Environment: # # SIGSEGV (0xb) at pc=0x40260cad, pid=30280, tid=1085176688 # # JRE version: 6.0_18-b18 # Java VM: OpenJDK Client VM (16.0-b13 mixed mode linux-x86 ) # Derivative: IcedTea6 1.8 # Distribution: Built on Gentoo Base System release 2.0.1 (Fri Apr 23 17:29:24 CEST 2010) # Problematic frame: # V [libjvm.so+0x4ecad] # # An error report file with more information is saved as: # /var/tmp/portage/dev-java/icedtea-6.1.8.0/work/icedtea6-1.8/hs_err_pid30280.log # # If you would like to submit a bug report, please include # instructions how to reproduce the bug and visit: # http://icedtea.classpath.org/bugzilla # /bin/sh: line 6: 30280 Aborted bootstrap/jdk1.6.0/bin/java -version bootstrap/jdk1.6.0/bin/java cannot be found or is corrupted. make: *** [stamps/bootstrap-directory-symlink.stamp] Error 1 * ERROR: dev-java/icedtea-6.1.8.0 failed: * make failed * * Call stack: * ebuild.sh, line 48: Called src_compile * environment, line 4449: Called die * The specific snippet of code: * emake -j 1 || die "make failed" * * If you need support, post the output of 'emerge --info =dev-java/icedtea-6.1.8.0', * the complete build log and the output of 'emerge -pqv =dev-java/icedtea-6.1.8.0'. * This ebuild is from an overlay named 'java-overlay': '/mnt/space/gentoo/layman/java-overlay/' !!! When you file a bug report, please include the following information: GENTOO_VM=gcj-jdk CLASSPATH="" JAVA_HOME="" JAVACFLAGS="" COMPILER="" and of course, the output of emerge --info * The complete build log is located at '/var/log/portage/dev-java:icedtea-6.1.8.0:20100423-152904.log'. * The ebuild environment file is located at '/var/tmp/portage/dev-java/icedtea-6.1.8.0/temp/environment'. * S: '/var/tmp/portage/dev-java/icedtea-6.1.8.0/work/icedtea6-1.8' That should be the right one. I don't have too much time at the moment, but I can do lots of testing in about a week. Ok, I've digged a little into it. This is again the stack-alignment problem of gcc. Take a look at the instruction: Instructions: (pc=0x4015b89d) 0x4015b88d: 10 39 c8 77 07 8d 4d d8 39 cf 76 37 f3 0f 6f 07 0x4015b89d: 66 0f 7f 00 8b 4f 10 89 4d d8 6a 02 83 c2 04 50 66 0f 7f is the MOVDQA command (if I'm not completely wrong), that needs a 16 byte alignment. Now take a look at the stackpointer: Top of Stack: (sp=0xbfd04a18) In dec this is 3218098712, a 2 byte alignment. This must leed to a segfault. So either disable SSE at all for icedtea or add -mstackrealign to CFLAGS. I've tested both on a Pentium4, and both works for me. (In reply to comment #11) > Ok, I've digged a little into it. This is again the stack-alignment problem of > gcc. Take a look at the instruction: What you mean by "again"? We had this bug before, or? > either disable SSE at all for icedtea or add -mstackrealign to CFLAGS. I've > tested both on a Pentium4, and both works for me. Hmm, but the first comments show this crash in icedtea6-bin. If it's build wrong, how comes it crashes only for some poeple? (In reply to comment #12) > (In reply to comment #11) > > Ok, I've digged a little into it. This is again the stack-alignment problem of > > gcc. Take a look at the instruction: > > What you mean by "again"? We had this bug before, or? I mean, that the problem with stack alignment is not new. Take a look at http://bugs.gentoo.org/show_bug.cgi?id=151394 or http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41156 It's the same problem here. > > either disable SSE at all for icedtea or add -mstackrealign to CFLAGS. I've > > tested both on a Pentium4, and both works for me. > > Hmm, but the first comments show this crash in icedtea6-bin. If it's build > wrong, how comes it crashes only for some poeple? No, it't in icedtea. It happens here: ./test_gamma: line 12: 30735 Aborted ./${gamma:-gamma} -Xbatch This is a shell script that tests the new build icedtea. > > Hmm, but the first comments show this crash in icedtea6-bin. If it's build
> > wrong, how comes it crashes only for some poeple?
>
> No, it't in icedtea. It happens here:
>
> ./test_gamma: line 12: 30735 Aborted ./${gamma:-gamma} -Xbatch
>
> This is a shell script that tests the new build icedtea.
>
Here is the content of test_gamma:
#!/bin/sh
# Generated by /var/tmp/portage/dev-java/icedtea-6.1.8.0/work/icedtea6-1.8/openjdk/hotspot/make/linux/makefiles/buildtree.make
. ./env.sh
if [ -z $JAVA_HOME ]; then { echo JAVA_HOME must be set to run this test.; exit 0; }; fi
if ! ${JAVA_HOME}/bin/java -d32 -fullversion 2>&1 > /dev/null
then
echo JAVA_HOME must point to 32bit JDK.; exit 0;
fi
rm -f Queens.class
${JAVA_HOME}/bin/javac -d . /var/tmp/portage/dev-java/icedtea-6.1.8.0/work/icedtea6-1.8/openjdk/hotspot/make/test/Queens.java
[ -f gamma_g ] && { gamma=gamma_g; }
./${gamma:-gamma} -Xbatch -showversion Queens < /dev/null
and the content of the sourced env.sh:
# Generated by /var/tmp/portage/dev-java/icedtea-6.1.8.0/work/icedtea6-1.8/openjdk/hotspot/make/linux/makefiles/buildtree.make
: ${JAVA_HOME:=/var/tmp/portage/dev-java/icedtea-6.1.8.0/work/icedtea6-1.8/bootstrap/jdk1.6.0}
LD_LIBRARY_PATH=.:${JAVA_HOME}/jre/lib/i386/native_threads:${JAVA_HOME}/jre/lib/i386:
CLASSPATH=.:${JAVA_HOME}/jre/lib/rt.jar:${JAVA_HOME}/jre/lib/i18n.jar
HOTSPOT_BUILD_USER="root in hotspot"
export JAVA_HOME LD_LIBRARY_PATH CLASSPATH HOTSPOT_BUILD_USER
Looking at hotspot/src/cpu/x86/vm/assembler_x86.cpp there are a large number of sites where the code generation code would have to be changed to maintain alignment (by dropping the stack before pushing arguments, etc.) and even this would not be sufficient if - as seems to be the case - other generated code plays with the stack, pushing and popping (etc.) outside of function call boilerplate. I don't think fixing icedtea will be possible without the active assistance of the upstream developers, and have little confidence about how likely that would be to be forthcoming. I'm going to try -mstackrealign and accept that x86-32 is no longer a commercially supported architecture :( no traffic here. please reopen of the problem persists with the latest version. This isn't solved. It is still happening with 6.1.9.4 The ebuild should, at least, force -mstackrealign so that compiling can complete. The best would be to correctly patch sources, but I know this is quite overkilling Reopening. this version is not available anymore. please try latest version of the package. feel free to reopen the bug if the problem persists. Issue persists with 6.1.10.4. Please reopen. # # A fatal error has been detected by the Java Runtime Environment: # # SIGSEGV (0xb) at pc=0xb6caeedc, pid=3501, tid=3062184816 # # JRE version: 6.0_22-b22 # Java VM: OpenJDK Server VM (20.0-b11 mixed mode linux-x86 ) # Derivative: IcedTea6 1.10.4 # Distribution: Built on Gentoo Base System release 2.1 (Thu Oct 27 22:56:16 BST 2011) # Problematic frame: # V [libjvm.so+0x158edc] Assembler::jmp_literal(unsigned char*, RelocationHolder const&)+0x8c # # An error report file with more information is saved as: # /var/tmp/portage/dev-java/icedtea-6.1.10.4/work/icedtea6-1.10.4/openjdk.build/hotspot/outputdir/linux_i486_compiler2/product/hs_err_pid3501.log # # If you would like to submit a bug report, please include # instructions how to reproduce the bug and visit: # http://icedtea.classpath.org/bugzilla # ./test_gamma: line 13: 3501 Aborted ./${gamma:-gamma} -Xbatch -showversion Queens < /dev/null make[5]: *** [product] Error 134 make[5]: Leaving directory `/var/tmp/portage/dev-java/icedtea-6.1.10.4/work/icedtea6-1.10.4/openjdk.build/hotspot/outputdir' Please reopen this bug per above. As mentioned above, there is a simple fix to force -mstackrealign on x86. Reopen as per #c22 Please try icedtea-7.2.2. (In reply to comment #24) > Please try icedtea-7.2.2. The bug is still present with icedtea-7.2.2.1 on ~x86 with -O3. As shown below, the problem is a call into libz. Recompiling zlib with -mstackrealign fixes it. I guess -O2 or -fno-tree-vectorize for zlib would also help. [...] /bin/mkdir -p /tmp/paludis/dev-java-icedtea-7.2.2.1/work/icedtea-2.2.1/openjdk.build-boot/jaxp ######################################################################## ######################################################################## ##### Entering jaxp for target(s) all ##### ######################################################################## (cd ./jaxp/make && \ /usr/bin/make JDK_TOPDIR=/tmp/paludis/dev-java-icedtea-7.2.2.1/work/icedtea-2.2.1/openjdk-boot/jdk JDK_MAKE_SHARED_DIR=/tmp/pa make[3]: Entering directory `/tmp/paludis/dev-java-icedtea-7.2.2.1/work/icedtea-2.2.1/openjdk-boot/jaxp/make' cd .. && JAVA_HOME=/tmp/paludis/dev-java-icedtea-7.2.2.1/work/icedtea-2.2.1/bootstrap/jdk1.6.0 /usr/bin/ant -Djavac.target=7 -D Apache Ant(TM) version 1.8.4 compiled on July 26 2012 cd .. && JAVA_HOME=/tmp/paludis/dev-java-icedtea-7.2.2.1/work/icedtea-2.2.1/bootstrap/jdk1.6.0 /usr/bin/ant -Djavac.target=7 -D Buildfile: /tmp/paludis/dev-java-icedtea-7.2.2.1/work/icedtea-2.2.1/openjdk-boot/jaxp/build.xml -banner: [echo] +---------------------------------------+ [echo] + Starting ant project jaxp + [echo] +---------------------------------------+ -javac-jar-exists: sanity: [echo] Sanity Settings: [echo] ant.home=/usr/share/ant-core [echo] ant.version=Apache Ant(TM) version 1.8.4 compiled on July 26 2012 [echo] ant.java.version=1.7 [echo] java.home=/usr/lib/icedtea7/jre [echo] java.version=1.7.0_05 [echo] os.name=Linux [echo] os.arch=i386 [echo] os.version=3.5.0-kotatko [echo] bootstrap.dir=/tmp/paludis/dev-java-icedtea-7.2.2.1/work/icedtea-2.2.1/openjdk.build-boot/langtools/dist/bootstrap [echo] javac.jar=/tmp/paludis/dev-java-icedtea-7.2.2.1/work/icedtea-2.2.1/openjdk.build-boot/langtools/dist/bootstrap/lib/ [echo] javac.memoryInitialSize=256m [echo] javac.memoryMaximumSize=512m [echo] javac.source=7 [echo] javac.debug=true [echo] javac.target=7 [echo] javac.version.opt= [echo] javac.lint.opts= [echo] javac.no.jdk.warnings=-XDignore.symbol.file=true [echo] output.dir=/tmp/paludis/dev-java-icedtea-7.2.2.1/work/icedtea-2.2.1/openjdk.build-boot/jaxp [echo] build.dir=/tmp/paludis/dev-java-icedtea-7.2.2.1/work/icedtea-2.2.1/openjdk.build-boot/jaxp/build [echo] dist.dir=/tmp/paludis/dev-java-icedtea-7.2.2.1/work/icedtea-2.2.1/openjdk.build-boot/jaxp/dist [echo] init: [mkdir] Created dir: /tmp/paludis/dev-java-icedtea-7.2.2.1/work/icedtea-2.2.1/openjdk.build-boot/jaxp/build [mkdir] Created dir: /tmp/paludis/dev-java-icedtea-7.2.2.1/work/icedtea-2.2.1/openjdk.build-boot/jaxp/build/classes [mkdir] Created dir: /tmp/paludis/dev-java-icedtea-7.2.2.1/work/icedtea-2.2.1/openjdk.build-boot/jaxp/dist [mkdir] Created dir: /tmp/paludis/dev-java-icedtea-7.2.2.1/work/icedtea-2.2.1/openjdk.build-boot/jaxp/dist/lib [javac] Compiling 1925 source files to /tmp/paludis/dev-java-icedtea-7.2.2.1/work/icedtea-2.2.1/openjdk.build-boot/jaxp/bui [javac] # [javac] # A fatal error has been detected by the Java Runtime Environment: [javac] # [javac] # SIGSEGV (0xb) at pc=0xb76e5380, pid=32029, tid=3064326976 [javac] # [javac] # JRE version: 7.0_05-b21 [javac] # Java VM: OpenJDK Client VM (23.0-b21 mixed mode linux-x86 ) [javac] # Problematic frame: [javac] # C [libz.so.1+0xa380] inflateMark+0x69 [javac] # [javac] # Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" befor [javac] # [javac] # An error report file with more information is saved as: [javac] # /tmp/paludis/dev-java-icedtea-7.2.2.1/work/icedtea-2.2.1/openjdk-boot/jaxp/hs_err_pid32029.log [javac] # [javac] # If you would like to submit a bug report, please include [javac] # instructions on how to reproduce the bug and visit: [javac] # http://icedtea.classpath.org/bugzilla [javac] # BUILD FAILED /tmp/paludis/dev-java-icedtea-7.2.2.1/work/icedtea-2.2.1/openjdk-boot/jaxp/build.xml:127: Compile failed; see the compiler erro Total time: 4 seconds make[3]: *** [all] Error 1 make[3]: Leaving directory `/tmp/paludis/dev-java-icedtea-7.2.2.1/work/icedtea-2.2.1/openjdk-boot/jaxp/make' make[2]: *** [jaxp-build] Error 2 make[2]: Leaving directory `/tmp/paludis/dev-java-icedtea-7.2.2.1/work/icedtea-2.2.1/openjdk-boot' make[1]: *** [build_product_image] Error 2 make[1]: Leaving directory `/tmp/paludis/dev-java-icedtea-7.2.2.1/work/icedtea-2.2.1/openjdk-boot' make: *** [stamps/icedtea-boot.stamp] Error 2 (In reply to comment #25) > (In reply to comment #24) > > Please try icedtea-7.2.2. > > The bug is still present with icedtea-7.2.2.1 on ~x86 with -O3. As shown > below, the problem is a call into libz. Recompiling zlib with -mstackrealign > fixes it. I guess -O2 or -fno-tree-vectorize for zlib would also help. The problem is with icedtea, not with zlib. The correct solution is to compile icedtea with -mstackrealign or to fix icedtea. (In reply to comment #26) > (In reply to comment #25) > > (In reply to comment #24) > > > Please try icedtea-7.2.2. > > > > The bug is still present with icedtea-7.2.2.1 on ~x86 with -O3. As shown > > below, the problem is a call into libz. Recompiling zlib with -mstackrealign > > fixes it. I guess -O2 or -fno-tree-vectorize for zlib would also help. > > The problem is with icedtea, not with zlib. The correct solution is to > compile icedtea with -mstackrealign or to fix icedtea. I have a bit of experience with these sse/stack alignment problems on x86. I know the culprit is icedtea, which calls into zlib in a wrong way, i.e. with unaligned stack. You are definitely right that the correct solution is to fix icedtea to respect the new stack aligning rules on x86 (required by sse). But as I understand it, recompiling icedtea with -mstackrealign is no good. The realigning prologue in icedtea would not prevent it to break the alignment again just before calling into zlib. Haven't tried this, anyone has? You need to realign the stack at the zlib's function entry point. That's where it is unaligned. Anyway recompiling just zlib with -mstackrealign definitely helped. Still present in 7.2.4.1? No reply for 4+ years, closing as obsolete. |