NetBSD Problem Report #37725

From kivinen@iki.fi  Wed Jan  9 12:43:18 2008
Return-Path: <kivinen@iki.fi>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by narn.NetBSD.org (Postfix) with ESMTP id 64EE763BD87
	for <gnats-bugs@gnats.NetBSD.org>; Wed,  9 Jan 2008 12:43:18 +0000 (UTC)
Message-Id: <18308.49498.67896.253810@fireball.kivinen.iki.fi>
Date: Wed, 9 Jan 2008 14:43:06 +0200
From: Tero Kivinen <kivinen@iki.fi>
Reply-To: kivinen@iki.fi
To: gnats-bugs@NetBSD.org
Subject: sun6-jre does not work on amd64
X-Send-Pr-Version: 3.95

>Number:         37725
>Category:       pkg
>Synopsis:       sun6-jre does not work on amd64
>Confidential:   no
>Severity:       critical
>Priority:       medium
>Responsible:    pkg-manager
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Jan 09 12:45:00 +0000 2008
>Closed-Date:    Fri Dec 28 18:28:19 +0000 2018
>Last-Modified:  Fri Dec 28 18:28:19 +0000 2018
>Originator:     Tero Kivinen
>Release:        NetBSD 4.0_STABLE
>Organization:
kivinen@safenet-inc.com
>Environment:
System: NetBSD tiiliskivi.kivinen.iki.fi 4.0_STABLE NetBSD 4.0_STABLE (TIILISKIVI) #0: Tue Dec 18 18:26:01 EET 2007 root@:/usr/obj/sys/arch/amd64/compile/TIILISKIVI amd64
Architecture: x86_64
Machine: amd64
>Description:

If I install sun6-jre from the pkgsrc/lang/sun-jre6 it installs i386
version of the java. The wrapper function created to the
pkg/bin/sun6-java uses x86_64 in the LD_LIBRARY_PATH as the
pkgsrc/lang/sun-jre6/Makefile.common defines that
JAVA_LD_LIBRARY_PATH=${JAVA_HOME}/lib/${MACHINE_ARCH}/jli. The jli
library installed is not in the lib/x86_64/jli but in the lib/i386/jli. 

>How-To-Repeat:

Install sun6-jre and notice that the INSTALL script running sun6-java
will fail with error complaining that libjli library cannot be found.

>Fix:

This patch fixes the problem:

Index: Makefile.common
===================================================================
RCS file: /cvsroot/pkgsrc/lang/sun-jre6/Makefile.common,v
retrieving revision 1.5
diff -u -r1.5 Makefile.common
--- Makefile.common	22 Aug 2007 14:03:49 -0000	1.5
+++ Makefile.common	9 Jan 2008 12:41:24 -0000
@@ -40,7 +40,7 @@
 JAVA_HOME=		${LOCALBASE}/java/sun-6
 JAVA_NAME=		sun6
 JAVA_UNLIMIT=		datasize
-JAVA_LD_LIBRARY_PATH=	${JAVA_HOME}/lib/${MACHINE_ARCH}/jli
+JAVA_LD_LIBRARY_PATH=	${JAVA_HOME}/lib/i386/jli

 MESSAGE_SUBST+=	JAVA_HOME=${JAVA_HOME:Q}


>Release-Note:

>Audit-Trail:
From: "OBATA Akio" <obache@netbsd.org>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: pkg/37725: sun6-jre does not work on amd64
Date: Wed, 09 Jan 2008 22:04:03 +0900

 On Wed, 09 Jan 2008 21:45:00 +0900, Tero Kivinen <kivinen@iki.fi> wrote:=


 > Index: Makefile.common
 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
 > RCS file: /cvsroot/pkgsrc/lang/sun-jre6/Makefile.common,v
 > retrieving revision 1.5
 > diff -u -r1.5 Makefile.common
 > --- Makefile.common	22 Aug 2007 14:03:49 -0000	1.5
 > +++ Makefile.common	9 Jan 2008 12:41:24 -0000
 > @@ -40,7 +40,7 @@
 >  JAVA_HOME=3D		${LOCALBASE}/java/sun-6
 >  JAVA_NAME=3D		sun6
 >  JAVA_UNLIMIT=3D		datasize
 > -JAVA_LD_LIBRARY_PATH=3D	${JAVA_HOME}/lib/${MACHINE_ARCH}/jli
 > +JAVA_LD_LIBRARY_PATH=3D	${JAVA_HOME}/lib/i386/jli

 Should use ${EMUL_ARCH} instead of bare i386.

 >  MESSAGE_SUBST+=3D	JAVA_HOME=3D${JAVA_HOME:Q}
 >
 >



 -- =

 "Of course I love NetBSD":-)
 OBATA Akio / obache@NetBSD.org

Responsible-Changed-From-To: pkg-manager->obache
Responsible-Changed-By: obache@narn.netbsd.org
Responsible-Changed-When: Sun, 20 Jan 2008 12:54:00 +0000
Responsible-Changed-Why:
I've commited the fix.


State-Changed-From-To: open->feedback
State-Changed-By: obache@narn.netbsd.org
State-Changed-When: Sun, 20 Jan 2008 12:54:00 +0000
State-Changed-Why:
Fix should be commited.
Would you confirm the fix on your environment?


From: OBATA Akio <obache@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/37725 CVS commit: pkgsrc/lang/sun-jre6
Date: Sun, 20 Jan 2008 12:51:44 +0000 (UTC)

 Module Name:	pkgsrc
 Committed By:	obache
 Date:		Sun Jan 20 12:51:44 UTC 2008

 Modified Files:
 	pkgsrc/lang/sun-jre6: Makefile.common

 Log Message:
 Use EMUL_ARCH instead of MACHINE_ARCH for x86_64 platform using 32bit binary.
 Problem reported in PR 37725.


 To generate a diff of this commit:
 cvs rdiff -r1.7 -r1.8 pkgsrc/lang/sun-jre6/Makefile.common

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: Tero Kivinen <kivinen@iki.fi>
To: gnats-bugs@NetBSD.org
Cc: obache@NetBSD.org, pkg-manager@NetBSD.org, pkgsrc-bugs@NetBSD.org,
        gnats-admin@NetBSD.org
Subject: Re: pkg/37725 (sun6-jre does not work on amd64)
Date: Mon, 21 Jan 2008 16:14:53 +0200

 obache@NetBSD.org writes:
 > Synopsis: sun6-jre does not work on amd64
 > 
 > Responsible-Changed-From-To: pkg-manager->obache
 > Responsible-Changed-By: obache@narn.netbsd.org
 > Responsible-Changed-When: Sun, 20 Jan 2008 12:54:00 +0000
 > Responsible-Changed-Why:
 > I've commited the fix.
 > 
 > 
 > State-Changed-From-To: open->feedback
 > State-Changed-By: obache@narn.netbsd.org
 > State-Changed-When: Sun, 20 Jan 2008 12:54:00 +0000
 > State-Changed-Why:
 > Fix should be commited.
 > Would you confirm the fix on your environment?

 Said cvs update and tried the new version. First the message telling
 what version to download says:

 ERROR: ======================================================================
 ERROR: 
 ERROR:  The file jre-6u4-linux-i586.bin containing Java Runtime Environment (JRE) 6u1
 ERROR: 
 ERROR:  must be fetched into:
 ERROR:  /usr/pkgsrc/distfiles/jre-6u4-linux-i586.bin
 ERROR:  from:
 ERROR:  http://java.sun.com/javase/downloads/index.jsp
 ERROR:  or http://java.sun.com/products/archive/
 ERROR: 
 ERROR:  Click Download for 'Java Runtime Environment (JRE) 6u1', read and accept the
 ERROR:  license, then choose 'Linux self-extracting file'.
 ERROR: 
 ERROR: ======================================================================

 I.e. the file name is said to be jre-6u4-linux-i586.bin, but it says I
 should select 6u1 from the list. I selected the latest 6 update 4
 version.

 The installation printed out following errors:
 ----------------------------------------------------------------------
 fear (16:11) /usr/pkgsrc/lang/sun-jre6#make update
 ===> Deinstalling for sun-jre6-6.0.4
 Running /usr/pkg/sbin/pkg_delete -K /var/db/pkg -r sun-jre6-6.0.4
 => Bootstrap dependency digest>=20010302: found digest-20070803
 ===> Checking for vulnerabilities in sun-jre6-6.0.4
 => Checksum SHA1 OK for jre-6u4-linux-i586.bin
 => Checksum RMD160 OK for jre-6u4-linux-i586.bin
 ===> Installing dependencies for sun-jre6-6.0.4
 ==========================================================================
 The supported build options for sun-jre6 are:

         sun-jre-jce

 You can select which build options to use by setting PKG_DEFAULT_OPTIONS
 or the following variable.  Its current value is shown:

         PKG_OPTIONS.sun-jre6 (not defined)

 ==========================================================================
 => Full dependency suse32_compat>=6.4: found suse32_compat-10.0nb3
 => Full dependency suse32_locale>=6.4: found suse32_locale-10.0nb2
 => Full dependency suse32_x11>=6.4: found suse32_x11-10.0nb3
 ===> Overriding tools for sun-jre6-6.0.4
 ===> Extracting for sun-jre6-6.0.4
 jre1.6.0_04/bin/java: error while loading shared libraries: libjli.so: cannot open shared object file: No such file or directory
 ...
 ----------------------------------------------------------------------

 There is still some more things printed out during the install, but I
 think the root problem can already been seen there. When I try to run
 java, I get the same error message:
 ----------------------------------------------------------------------
 fear (16:13) ~>sun6-java                                      
 dl failure on line 685Error: failed /usr/pkg/java/sun-6/lib/i386/client/libjvm.so, because /usr/pkg/java/sun-6/lib/i386/client/libjvm.so: cannot make segment writable for relocation: Permission denied
 zsh: 22627 exit 6     sun6-java
 fear (16:13) ~>fg
 [1]  + continued  sudo zsh
 (pwd : /usr/pkgsrc)
 fear (16:13) /usr/pkgsrc/lang/sun-jre6#sun6-java 
 dl failure on line 685Error: failed /usr/pkg/java/sun-6/lib/i386/client/libjvm.so, because /usr/pkg/java/sun-6/lib/i386/client/libjvm.so: cannot make segment writable for relocation: Permission denied
 zsh: 23220 exit 6     sun6-java
 fear (16:13) /usr/pkgsrc/lang/sun-jre6#
 ----------------------------------------------------------------------

 regardless whether I am root or not. 
 -- 
 kivinen@safenet-inc.com

Responsible-Changed-From-To: obache->pkg-manager
Responsible-Changed-By: obache@narn.netbsd.org
Responsible-Changed-When: Mon, 21 Jan 2008 15:11:28 +0000
Responsible-Changed-Why:
I can't handle this PR anymore.


State-Changed-From-To: feedback->open
State-Changed-By: obache@narn.netbsd.org
State-Changed-When: Mon, 21 Jan 2008 15:11:28 +0000
State-Changed-Why:
Problem still exists.


From: christos@zoulas.com (Christos Zoulas)
To: gnats-bugs@NetBSD.org, obache@NetBSD.org, gnats-admin@netbsd.org, 
	pkgsrc-bugs@netbsd.org, kivinen@iki.fi
Cc: 
Subject: Re: pkg/37725 (sun6-jre does not work on amd64)
Date: Mon, 21 Jan 2008 11:42:23 -0500

 On Jan 21,  2:20pm, kivinen@iki.fi (Tero Kivinen) wrote:
 -- Subject: Re: pkg/37725 (sun6-jre does not work on amd64)

 | The following reply was made to PR pkg/37725; it has been noted by GNATS.
 | 
 | From: Tero Kivinen <kivinen@iki.fi>
 | To: gnats-bugs@NetBSD.org
 | Cc: obache@NetBSD.org, pkg-manager@NetBSD.org, pkgsrc-bugs@NetBSD.org,
 |         gnats-admin@NetBSD.org
 | Subject: Re: pkg/37725 (sun6-jre does not work on amd64)
 | Date: Mon, 21 Jan 2008 16:14:53 +0200
 | 
 |  obache@NetBSD.org writes:
 |  > Synopsis: sun6-jre does not work on amd64
 |  > 
 |  > Responsible-Changed-From-To: pkg-manager->obache
 |  > Responsible-Changed-By: obache@narn.netbsd.org
 |  > Responsible-Changed-When: Sun, 20 Jan 2008 12:54:00 +0000
 |  > Responsible-Changed-Why:
 |  > I've commited the fix.
 |  > 
 |  > 
 |  > State-Changed-From-To: open->feedback
 |  > State-Changed-By: obache@narn.netbsd.org
 |  > State-Changed-When: Sun, 20 Jan 2008 12:54:00 +0000
 |  > State-Changed-Why:
 |  > Fix should be commited.
 |  > Would you confirm the fix on your environment?
 |  
 |  Said cvs update and tried the new version. First the message telling
 |  what version to download says:
 |  
 |  ERROR: ======================================================================
 |  ERROR: 
 |  ERROR:  The file jre-6u4-linux-i586.bin containing Java Runtime Environment (JRE) 6u1
 |  ERROR: 
 |  ERROR:  must be fetched into:
 |  ERROR:  /usr/pkgsrc/distfiles/jre-6u4-linux-i586.bin
 |  ERROR:  from:
 |  ERROR:  http://java.sun.com/javase/downloads/index.jsp
 |  ERROR:  or http://java.sun.com/products/archive/
 |  ERROR: 
 |  ERROR:  Click Download for 'Java Runtime Environment (JRE) 6u1', read and accept the
 |  ERROR:  license, then choose 'Linux self-extracting file'.
 |  ERROR: 
 |  ERROR: ======================================================================
 |  
 |  I.e. the file name is said to be jre-6u4-linux-i586.bin, but it says I
 |  should select 6u1 from the list. I selected the latest 6 update 4
 |  version.
 |  
 |  The installation printed out following errors:
 |  ----------------------------------------------------------------------
 |  fear (16:11) /usr/pkgsrc/lang/sun-jre6#make update
 |  ===> Deinstalling for sun-jre6-6.0.4
 |  Running /usr/pkg/sbin/pkg_delete -K /var/db/pkg -r sun-jre6-6.0.4
 |  => Bootstrap dependency digest>=20010302: found digest-20070803
 |  ===> Checking for vulnerabilities in sun-jre6-6.0.4
 |  => Checksum SHA1 OK for jre-6u4-linux-i586.bin
 |  => Checksum RMD160 OK for jre-6u4-linux-i586.bin
 |  ===> Installing dependencies for sun-jre6-6.0.4
 |  ==========================================================================
 |  The supported build options for sun-jre6 are:
 |  
 |          sun-jre-jce
 |  
 |  You can select which build options to use by setting PKG_DEFAULT_OPTIONS
 |  or the following variable.  Its current value is shown:
 |  
 |          PKG_OPTIONS.sun-jre6 (not defined)
 |  
 |  ==========================================================================
 |  => Full dependency suse32_compat>=6.4: found suse32_compat-10.0nb3
 |  => Full dependency suse32_locale>=6.4: found suse32_locale-10.0nb2
 |  => Full dependency suse32_x11>=6.4: found suse32_x11-10.0nb3
 |  ===> Overriding tools for sun-jre6-6.0.4
 |  ===> Extracting for sun-jre6-6.0.4
 |  jre1.6.0_04/bin/java: error while loading shared libraries: libjli.so: cannot open shared object file: No such file or directory
 |  ...
 |  ----------------------------------------------------------------------
 |  
 |  There is still some more things printed out during the install, but I
 |  think the root problem can already been seen there. When I try to run
 |  java, I get the same error message:
 |  ----------------------------------------------------------------------
 |  fear (16:13) ~>sun6-java                                      
 |  dl failure on line 685Error: failed /usr/pkg/java/sun-6/lib/i386/client/libjvm.so, because /usr/pkg/java/sun-6/lib/i386/client/libjvm.so: cannot make segment writable for relocation: Permission denied
 |  zsh: 22627 exit 6     sun6-java
 |  fear (16:13) ~>fg
 |  [1]  + continued  sudo zsh
 |  (pwd : /usr/pkgsrc)
 |  fear (16:13) /usr/pkgsrc/lang/sun-jre6#sun6-java 
 |  dl failure on line 685Error: failed /usr/pkg/java/sun-6/lib/i386/client/libjvm.so, because /usr/pkg/java/sun-6/lib/i386/client/libjvm.so: cannot make segment writable for relocation: Permission denied
 |  zsh: 23220 exit 6     sun6-java
 |  fear (16:13) /usr/pkgsrc/lang/sun-jre6#
 |  ----------------------------------------------------------------------
 |  
 |  regardless whether I am root or not. 
 |  -- 
 |  kivinen@safenet-inc.com

 There is a bug in the Makefiles of the linux java6jrl branch, and some files
 are not compiled with -fPIC. This creates text relocations which are not
 handled properly on amd64. Your best bet is to download the current patch
 set from: http://www.eyesbeyond.com/freebsddom/java/jdk16.html, but I am
 not sure if this contains the latest fixes you need to compile on NetBSD.

 christos

State-Changed-From-To: open->feedback
State-Changed-By: wiz@NetBSD.org
State-Changed-When: Sun, 21 Feb 2010 15:48:24 +0000
State-Changed-Why:
The package has been updated multiple times in the meantime.
Does it work now?
Have you tried openjdk7 instead?


From: Tero Kivinen <kivinen@iki.fi>
To: gnats-bugs@NetBSD.org
Cc: pkg-manager@NetBSD.org, pkgsrc-bugs@NetBSD.org, gnats-admin@NetBSD.org,
        wiz@NetBSD.org
Subject: Re: pkg/37725 (sun6-jre does not work on amd64)
Date: Thu, 4 Mar 2010 17:04:48 +0200

 wiz@NetBSD.org writes:
 > Synopsis: sun6-jre does not work on amd64
 > 
 > State-Changed-From-To: open->feedback
 > State-Changed-By: wiz@NetBSD.org
 > State-Changed-When: Sun, 21 Feb 2010 15:48:24 +0000
 > State-Changed-Why:
 > The package has been updated multiple times in the meantime.

 Yes.

 > Does it work now?

 Nope, and now it seems that latest sun-jre6-6.0.17 does not work with
 i386 anymore, it still crashes with segmentation fault.

 ----------------------------------------------------------------------
 raanu (16:05) ~/gcs>./gcs/gcs 

 [1]   Segmentation fault (core dumped) /usr/pkg/java/su...
 [2]    4357 exit 139   ./gcs/gcs
 raanu (16:05) ~/gcs>uname -a  
 NetBSD raanu.sfnt.local 5.99.23 NetBSD 5.99.23 (GENERIC) #0: Thu Jan  7 15:20:21 EET 2010  root@ryijy2.sfnt.local:/usr/obj/sys/arch/i386/compile/GENERIC i386
 raanu (16:05) ~/gcs>pkg_info sun-jre6
 Information for sun-jre6-6.0.17:

 Comment:
 Sun's Java(tm) 2 Standard Edition, Java Runtime Environment (JRE) 6u17

 Requires:
 suse_compat>=6.4
 suse_locale>=6.4
 suse_x11>=6.4

 Required by:
 sun-jdk6-6.0.17

 Description:
 This is the Linux port of the Sun Java(tm) Runtime Environment (J2SE 6.0).

 Homepage:
 http://java.sun.com/

 Install notice:
 ===========================================================================
 $NetBSD: MESSAGE.NetBSD,v 1.2 2007/08/22 14:49:24 jlam Exp $

 In order to be able to run the JVM, you need to add the following line
 to your /etc/fstab:

     procfs /emul/linux/proc procfs rw,linux

 Furthermore, the maximum data segment size assigned to your user must
 be at least 262144.

 You may want to read the following for details about running this JDK:

         /usr/pkg/java/sun-6/README

 ===========================================================================

 > Have you tried openjdk7 instead?

 Not yet. I did try to use kaffe, but that gave some error messages
 complaining something

 I will try the openjdk7 and see if that helps. 
 -- 
 kivinen@iki.fi

State-Changed-From-To: feedback->open
State-Changed-By: wiz@NetBSD.org
State-Changed-When: Thu, 04 Mar 2010 17:39:04 +0000
State-Changed-Why:
Feedback supplied, situation got worse.


From: Tero Kivinen <kivinen@iki.fi>
To: gnats-bugs@NetBSD.org
Cc: pkg-manager@NetBSD.org, gnats-admin@NetBSD.org, pkgsrc-bugs@NetBSD.org
Subject: Re: pkg/37725 (sun6-jre does not work on amd64)
Date: Sat, 6 Mar 2010 01:08:44 +0200

 Tero Kivinen writes:
 >  > Have you tried openjdk7 instead?
 >  
 >  Not yet. I did try to use kaffe, but that gave some error messages
 >  complaining something
 >  
 >  I will try the openjdk7 and see if that helps. 

 Openjdk7-1.7.078 seems to help for both i386 and amd64 environments,
 now the gcs (gurps character sheet) java program works in both of
 those environments. This solves my problem now, but it seems the
 sun6-jre still has some problems on both environments.
 -- 
 kivinen@iki.fi

State-Changed-From-To: open->closed
State-Changed-By: triaxx@NetBSD.org
State-Changed-When: Fri, 28 Dec 2018 18:28:19 +0000
State-Changed-Why:
It seems to work fine now:
$ uname -rsp && ${JAVA_HOME}/bin/java -version
NetBSD 8.0 x86_64
java version "1.6.0_45"
Java(TM) SE Runtime Environment (build 1.6.0_45-b06)
Java HotSpot(TM) 64-Bit Server VM (build 20.45-b01, mixed mode)


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.43 2018/01/16 07:36:43 maya Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2017 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.