Skip to contentSkip to conversation

Weird build problem with classpath-native/java-initial

PATCH Applied Steffen Sledz 2 participants 5 messages Sep 20, 2012 – Oct 9, 2012

lore
Share & tools
lore
#0 lore raw

We hit a weird build problem after upgrading from openSUSE 12.1 to 12.2.

We're building oe-classic (2011.03-maintenance). But the problem may be relevant for oe-core/meta-java too.

The first observation was that the do_configure step of classpath-native did not finish.

-------------> bitbake output <----------------
...
NOTE: Running task 7 of 18 (ID: 12, /home/sledz/work/openembedded/recipes/classpath/classpath-native_0.98.bb, do_configure)
NOTE: package classpath-native-0.98-r4: task do_configure: Started
(no more output here)
---------------------------------------------------------------------------------------------

Some investigations later we learned that configure calls a self built java-initial script. This script seams to have a problem.

-------------> config.log <---------------
configure:23774: checking if /home/sledz/work/HydraIP/OE/tmp.6/sysroots/i686-linux/usr/bin/java-initial works configure:23805: CLASSPATH=.: /home/sledz/work/HydraIP/OE/tmp.6/sysroots/i686-linux/usr/bin/java-initial Test

/home/sledz/work/HydraIP/OE/tmp.6/sysroots/i686-linux/usr/bin/java-initial: line 14:  9173 Segmentation fault      jamvm-initial ${1+"$@"}
/home/sledz/work/HydraIP/OE/tmp.6/sysroots/i686-linux/usr/bin/java-initial: line 14:  9178 Segmentation fault      jamvm-initial ${1+"$@"}
/home/sledz/work/HydraIP/OE/tmp.6/sysroots/i686-linux/usr/bin/java-initial: line 14:  9183 Segmentation fault      jamvm-initial ${1+"$@"}
/home/sledz/work/HydraIP/OE/tmp.6/sysroots/i686-linux/usr/bin/java-initial: line 14:  9188 Segmentation fault      jamvm-initial ${1+"$@"}
/home/sledz/work/HydraIP/OE/tmp.6/sysroots/i686-linux/usr/bin/java-initial: line 14:  9193 Segmentation fault      jamvm-initial ${1+"$@"}
/home/sledz/work/HydraIP/OE/tmp.6/sysroots/i686-linux/usr/bin/java-initial: line 14:  9198 Segmentation fault      jamvm-initial ${1+"$@"}

...
---------------------------------------------------------------------------------------------

A short look into this script shows the cause for the endless loop.

-------------> /home/sledz/work/HydraIP/OE/tmp.6/sysroots/i686-linux/usr/bin/java-initial <--------------- #!/bin/sh
#
# Wrapper which (almost) silently restarts the VM in case of segfaults.

redo_from_start=1;
while [ $redo_from_start -eq 1 ]; do

    echo "Running JamVM-initial: ${@}"
    redo_from_start=0;
    jamvm-initial ${1+"$@"}
    if [ $? -eq 139 ]; then
        echo "JamVM-initial crashed - silently trying again"
        redo_from_start=1;
    fi

done
---------------------------------------------------------------------------------------------

I see two problems:

* First the script should not use an endless loop.
* Second the segfault should be fixed.

Any specialists with suggestions handling this?

Regards,
Steffen

BTW: I'm absolutely not a Java specialist.

Signature · 7 lines
DResearch Fahrzeugelektronik GmbH
Otto-Schmirgal-Str. 3, 10319 Berlin, Germany
Tel: +49 30 515932-237 mailto:[email protected]
Fax: +49 30 515932-299
Geschäftsführer: Dr. Michael Weber, Werner Mögle;
Amtsgericht Berlin Charlottenburg; HRB 130120 B;
Ust.-IDNr. DE273952058
#1 lore raw

cover pull request 20121002

Hi Tom, hi meta-java maintainers,

this pull request contains a backport of jamvm-initial from meta-java which fixes at least the problem of endless loop in java-initial script while running do_configure for classpath-native.

The backport works well for us, but it would be nice if we can get some acks from the java maintainers before Tom pulls the commits to 2011.03-maintenance branch.

see also: http://thread.gmane.org/gmane.comp.handhelds.openembedded/54242

Thx,
Steffen
The following changes since commit a35ceaacb2019750dc9f4b4fd5ea927cf2ad47fb:

gdk-pixbuf: add missing dependencies (2012-09-14 15:07:04 -0700)

are available in the git repository at:

git://github.com/sledz/oe pull-request-1
https://github.com/sledz/oe/tree/pull-request-1

Steffen Sledz (2):
jamvm: reorganize metadata to simplify backport from meta-java
jamvm-initial: backport 1.4.5 from meta-java

 recipes/jamvm/files/jamvm_1.5.0-initial.patch      |   91 --------------------
 recipes/jamvm/files/java-initial                   |   17 ++++
 .../jamvm-initial.patch}                           |   19 ----
 recipes/jamvm/jamvm-initial_1.4.5.bb               |   22 ++---
 recipes/jamvm/{files => jamvm}/debian-jni.patch    |    0
 .../jamvm-1.3.1-size-defaults.patch                |    0
 .../jamvm-1.5.3-jni_h-noinst.patch                 |    0
 recipes/jamvm/jamvm/libffi.patch                   |   66 ++++++++++++++
 8 files changed, 95 insertions(+), 120 deletions(-)
 delete mode 100644 recipes/jamvm/files/jamvm_1.5.0-initial.patch
 create mode 100755 recipes/jamvm/files/java-initial
 rename recipes/jamvm/{files/jamvm_1.4.5-initial.patch => jamvm-initial/jamvm-initial.patch} (81%)
 rename recipes/jamvm/{files => jamvm}/debian-jni.patch (100%)
 rename recipes/jamvm/{files => jamvm}/jamvm-1.3.1-size-defaults.patch (100%)
 rename recipes/jamvm/{files => jamvm}/jamvm-1.5.3-jni_h-noinst.patch (100%)
 create mode 100644 recipes/jamvm/jamvm/libffi.patch
Signature · 1 line
1.7.10.4
#2 lore raw

PATCH 1/2 jamvm: reorganize metadata to simplify backport from meta-java

---
 recipes/jamvm/files/jamvm_1.5.0-initial.patch      |   91 --------------------
 .../jamvm_1.4.5-initial.patch                      |    0
 recipes/jamvm/{files => jamvm}/debian-jni.patch    |    0
 .../jamvm-1.3.1-size-defaults.patch                |    0
 .../jamvm-1.5.3-jni_h-noinst.patch                 |    0
 5 files changed, 91 deletions(-)
 delete mode 100644 recipes/jamvm/files/jamvm_1.5.0-initial.patch
 rename recipes/jamvm/{files => jamvm-initial}/jamvm_1.4.5-initial.patch (100%)
 rename recipes/jamvm/{files => jamvm}/debian-jni.patch (100%)
 rename recipes/jamvm/{files => jamvm}/jamvm-1.3.1-size-defaults.patch (100%)
 rename recipes/jamvm/{files => jamvm}/jamvm-1.5.3-jni_h-noinst.patch (100%)
recipes/jamvm/files/jamvm_1.5.0-initial.patch deleted +0 -91
deleted file mode 100644
index 1f63dba..0000000
@@ -1,91 +0,0 @@
-Index: jamvm-1.5.0/configure.ac
-===================================================================
---- jamvm-1.5.0.orig/configure.ac	2007-12-20 00:01:08.000000000 +0100
-+++ jamvm-1.5.0/configure.ac	2007-12-20 00:03:40.000000000 +0100
-@@ -22,7 +22,7 @@
- dnl Process this file with autoconf to produce a configure script.
- 
- AC_INIT(src/jam.c)
--AM_INIT_AUTOMAKE(jamvm, 1.5.0)
-+AM_INIT_AUTOMAKE(jamvm-initial, 1.5.0)
- AC_CONFIG_HEADERS([src/config.h])
- AC_PREFIX_DEFAULT(/usr/local/jamvm)
- 
-Index: jamvm-1.5.0/java-initial
-===================================================================
---- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ jamvm-1.5.0/java-initial	2007-12-20 00:03:27.000000000 +0100
-@@ -0,0 +1,14 @@
-+#!/bin/sh
-+#
-+# Wrapper which (almost) silently restarts the VM in case of segfaults.
-+
-+redo_from_start=1;
-+while [ $redo_from_start -eq 1 ]; do
-+    echo "Running JamVM-initial: ${@}"
-+    redo_from_start=0;
-+    jamvm-initial ${1+"$@"}
-+    if [ $? -eq 139 ]; then
-+        echo "JamVM-initial crashed - silently trying again"
-+        redo_from_start=1;
-+    fi
-+done
-Index: jamvm-1.5.0/lib/Makefile.am
-===================================================================
---- jamvm-1.5.0.orig/lib/Makefile.am	2007-12-20 00:05:24.000000000 +0100
-+++ jamvm-1.5.0/lib/Makefile.am	2007-12-20 00:05:28.000000000 +0100
-@@ -19,7 +19,7 @@
- ## Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- ##
- 
--CP_LIB_DIR = ${with_classpath_install_dir}/share/classpath
-+CP_LIB_DIR = ${with_classpath_install_dir}/share/classpath-initial
- GLIBJ_ZIP  = ${CP_LIB_DIR}/glibj.zip
- 
- SUBDIRS = jamvm java gnu sun
-Index: jamvm-1.5.0/src/class.h
-===================================================================
---- jamvm-1.5.0.orig/src/class.h	2007-12-20 00:06:34.000000000 +0100
-+++ jamvm-1.5.0/src/class.h	2007-12-20 00:16:41.000000000 +0100
-@@ -39,11 +39,11 @@
-    separate class files in a directory structure */
- 
- #ifdef USE_ZIP
--#define JAMVM_CLASSES INSTALL_DIR"/share/jamvm/classes.zip"
--#define CLASSPATH_CLASSES CLASSPATH_INSTALL_DIR"/share/classpath/glibj.zip"
-+#define JAMVM_CLASSES CLASSPATH_INSTALL_DIR"/share/jamvm-initial/classes.zip"
-+#define CLASSPATH_CLASSES CLASSPATH_INSTALL_DIR"/share/classpath-initial/glibj.zip"
- #else
--#define JAMVM_CLASSES INSTALL_DIR"/share/jamvm/classes"
--#define CLASSPATH_CLASSES CLASSPATH_INSTALL_DIR"/share/classpath"
-+#define JAMVM_CLASSES CLASSPATH_INSTALL_DIR"/share/jamvm-initial/classes"
-+#define CLASSPATH_CLASSES CLASSPATH_INSTALL_DIR"/share/classpath-initial"
- #endif
- 
- #define DFLT_BCP JAMVM_CLASSES":"CLASSPATH_CLASSES
-Index: jamvm-1.5.0/src/dll.c
-===================================================================
---- jamvm-1.5.0.orig/src/dll.c	2007-12-20 00:01:24.000000000 +0100
-+++ jamvm-1.5.0/src/dll.c	2007-12-20 00:03:27.000000000 +0100
-@@ -294,7 +294,7 @@
- }
- 
- char *getBootDllPath() {
--    return CLASSPATH_INSTALL_DIR"/lib/classpath";
-+    return CLASSPATH_INSTALL_DIR"/lib/classpath-initial";
- }
- 
- char *getDllName(char *name) {
-Index: jamvm-1.5.0/src/Makefile.am
-===================================================================
---- jamvm-1.5.0.orig/src/Makefile.am	2007-12-20 00:21:37.000000000 +0100
-+++ jamvm-1.5.0/src/Makefile.am	2007-12-20 00:21:46.000000000 +0100
-@@ -23,7 +23,7 @@
- DIST_SUBDIRS = os arch interp
- 
- bin_PROGRAMS = jamvm
--include_HEADERS = jni.h
-+noinst_HEADERS = jni.h
- 
- lib_LTLIBRARIES = libjvm.la
- noinst_LTLIBRARIES = libcore.la
recipes/jamvm/jamvm-initial/jamvm_1.4.5-initial.patch renamed from recipes/jamvm/files/jamvm_1.4.5-initial.patch +0 -0
similarity index 100%
rename from recipes/jamvm/files/jamvm_1.4.5-initial.patch
rename to recipes/jamvm/jamvm-initial/jamvm_1.4.5-initial.patch
recipes/jamvm/jamvm/debian-jni.patch renamed from recipes/jamvm/files/debian-jni.patch +0 -0
similarity index 100%
rename from recipes/jamvm/files/debian-jni.patch
rename to recipes/jamvm/jamvm/debian-jni.patch
recipes/jamvm/jamvm/jamvm-1.3.1-size-defaults.patch renamed from recipes/jamvm/files/jamvm-1.3.1-size-defaults.patch +0 -0
similarity index 100%
rename from recipes/jamvm/files/jamvm-1.3.1-size-defaults.patch
rename to recipes/jamvm/jamvm/jamvm-1.3.1-size-defaults.patch
recipes/jamvm/jamvm/jamvm-1.5.3-jni_h-noinst.patch renamed from recipes/jamvm/files/jamvm-1.5.3-jni_h-noinst.patch +0 -0
similarity index 100%
rename from recipes/jamvm/files/jamvm-1.5.3-jni_h-noinst.patch
rename to recipes/jamvm/jamvm/jamvm-1.5.3-jni_h-noinst.patch
Signature · 1 line
1.7.10.4
#3 lore raw

PATCH 2/2 jamvm-initial: backport 1.4.5 from meta-java

This fixes the at least the problem of endless loop in java-initial script while running do_configure for classpath-native.

see also: http://thread.gmane.org/gmane.comp.handhelds.openembedded/54242

---
 recipes/jamvm/files/java-initial                   |   17 +++++
 ...mvm_1.4.5-initial.patch => jamvm-initial.patch} |   19 ------
 recipes/jamvm/jamvm-initial_1.4.5.bb               |   22 ++++---
 recipes/jamvm/jamvm/libffi.patch                   |   66 ++++++++++++++++++++
 4 files changed, 95 insertions(+), 29 deletions(-)
 create mode 100755 recipes/jamvm/files/java-initial
 rename recipes/jamvm/jamvm-initial/{jamvm_1.4.5-initial.patch => jamvm-initial.patch} (81%)
 create mode 100644 recipes/jamvm/jamvm/libffi.patch
recipes/jamvm/files/java-initial new file +17 -0
new file mode 100755
index 0000000..1b27f81
@@ -0,0 +1,17 @@
+#!/bin/sh
+#
+# Wrapper which (almost) silently restarts the VM in case of segfaults.
+
+error_counter=0;
+error_occured=139
+while [ ${error_counter} -le 50 -a ${error_occured} -eq 139 ]; do
+    echo "Running JamVM-initial: ${@}"
+    jamvm-initial ${1+"$@"}
+    error_occured=$?
+    if [ ${error_occured} -eq 139 ]; then
+        echo "JamVM-initial crashed - silently trying again"
+        error_counter=$(( $error_counter + 1 ))
+    fi
+done
+
+exit ${error_occured}
recipes/jamvm/jamvm-initial/jamvm-initial.patch renamed from recipes/jamvm/jamvm-initial/jamvm_1.4.5-initial.patch +0 -19
similarity index 81%
rename from recipes/jamvm/jamvm-initial/jamvm_1.4.5-initial.patch
rename to recipes/jamvm/jamvm-initial/jamvm-initial.patch
index 175052d..fb069f8 100644
@@ -10,25 +10,6 @@ Index: jamvm-1.4.5/configure.ac
  AC_CONFIG_HEADERS([src/config.h])
  AC_PREFIX_DEFAULT(/usr/local/jamvm)
  
-Index: jamvm-1.4.5/java-initial
-===================================================================
---- /dev/null
-+++ jamvm-1.4.5/java-initial
-@@ -0,0 +1,14 @@
-+#!/bin/sh
-+#
-+# Wrapper which (almost) silently restarts the VM in case of segfaults.
-+
-+redo_from_start=1;
-+while [ $redo_from_start -eq 1 ]; do
-+    echo "Running JamVM-initial: ${@}"
-+    redo_from_start=0;
-+    jamvm-initial ${1+"$@"}
-+    if [ $? -eq 139 ]; then
-+        echo "JamVM-initial crashed - silently trying again"
-+        redo_from_start=1;
-+    fi
-+done
 Index: jamvm-1.4.5/lib/Makefile.am
 ===================================================================
 --- jamvm-1.4.5.orig/lib/Makefile.am
recipes/jamvm/jamvm-initial_1.4.5.bb +12 -10
index 55bd5f9..a662077 100644
@@ -1,17 +1,20 @@
 SUMMARY = "A compact Java Virtual Machine which conforms to the JVM specification version 2."
 HOMEPAGE = "http://jamvm.sourceforge.net/"
 LICENSE = "GPL"
+LIC_FILES_CHKSUM = "file://COPYING;md5=0636e73ff0215e8d672dc4c32c317bb3"
 
 DEPENDS = "zlib-native classpath-initial jikes-initial libffi-native"
 
-PR = "r3"
-
 PROVIDES = "virtual/java-initial"
 
+PR = "r4"
+
 S = "${WORKDIR}/jamvm-${PV}"
 
 SRC_URI = "${SOURCEFORGE_MIRROR}/jamvm/jamvm-${PV}.tar.gz \
-          file://jamvm_${PV}-initial.patch \
+           file://libffi.patch \
+           file://jamvm-initial.patch \
+           file://java-initial \
           "
 
 # This uses 32 bit arm, so force the instruction set to arm, not thumb
@@ -25,20 +28,19 @@ EXTRA_OECONF = "\
   --with-classpath-install-dir=${prefix} \
   --program-suffix=-initial \
   --libdir=${STAGING_LIBDIR}/jamvm-initial \
+  --enable-ffi \
   "
 
 # jamvm-initial has to run some binaries which need lots of memory.
 CFLAGS += "-DDEFAULT_MAX_HEAP=512*MB"
 
-do_compile() {
-  oe_runmake \
-    JAVAC=jikes-initial \
-    GLIBJ_ZIP=${STAGING_DATADIR_NATIVE}/classpath-initial/glibj.zip
-}
-
+# Enforce usage of jikes-initial.
+EXTRA_OEMAKE = "JAVAC=${STAGING_BINDIR_NATIVE}/jikes-initial \
+                GLIBJ_ZIP=${STAGING_DATADIR_NATIVE}/classpath-inital/glibj.zip \
+               "
 do_install_append() {
   install -d ${D}${bindir}/
-  install -m 0755 java-initial ${D}${bindir}/
+  install -m 0755 ${WORKDIR}/java-initial ${D}${bindir}/
 }
 
 SRC_URI[md5sum] = "3f538bab6e1c77aed331e5e71f754f5b"
recipes/jamvm/jamvm/libffi.patch new file +66 -0

66 lines not on this page · raw message

Signature · 1 line
1.7.10.4
Applied
#4 lore raw

Re: [2011.03-maintenance 0/2] pull request 20121002

In reply to Steffen Sledz
Quoted 27 lines · Steffen Sledz

Hi Tom, hi meta-java maintainers,

this pull request contains a backport of jamvm-initial from meta-java which fixes at least the problem of endless loop in java-initial script while running do_configure for classpath-native.

The backport works well for us, but it would be nice if we can get some acks from the java maintainers before Tom pulls the commits to 2011.03-maintenance branch.

see also: http://thread.gmane.org/gmane.comp.handhelds.openembedded/54242

Thx,
Steffen
The following changes since commit a35ceaacb2019750dc9f4b4fd5ea927cf2ad47fb:

gdk-pixbuf: add missing dependencies (2012-09-14 15:07:04 -0700)

are available in the git repository at:

git://github.com/sledz/oe pull-request-1
https://github.com/sledz/oe/tree/pull-request-1

Steffen Sledz (2):
jamvm: reorganize metadata to simplify backport from meta-java
jamvm-initial: backport 1.4.5 from meta-java

Quoted 16 lines
 recipes/jamvm/files/jamvm_1.5.0-initial.patch      |   91 --------------------
 recipes/jamvm/files/java-initial                   |   17 ++++
 .../jamvm-initial.patch}                           |   19 ----
 recipes/jamvm/jamvm-initial_1.4.5.bb               |   22 ++---
 recipes/jamvm/{files => jamvm}/debian-jni.patch    |    0
 .../jamvm-1.3.1-size-defaults.patch                |    0
 .../jamvm-1.5.3-jni_h-noinst.patch                 |    0
 recipes/jamvm/jamvm/libffi.patch                   |   66 ++++++++++++++
 8 files changed, 95 insertions(+), 120 deletions(-)
 delete mode 100644 recipes/jamvm/files/jamvm_1.5.0-initial.patch
 create mode 100755 recipes/jamvm/files/java-initial
 rename recipes/jamvm/{files/jamvm_1.4.5-initial.patch => jamvm-initial/jamvm-initial.patch} (81%)
 rename recipes/jamvm/{files => jamvm}/debian-jni.patch (100%)
 rename recipes/jamvm/{files => jamvm}/jamvm-1.3.1-size-defaults.patch (100%)
 rename recipes/jamvm/{files => jamvm}/jamvm-1.5.3-jni_h-noinst.patch (100%)
 create mode 100644 recipes/jamvm/jamvm/libffi.patch

Applied to 2011.03-maintenance, thanks and sorry for the delay.

Signature · 1 line
Tom