Skip to content
Advertisement

Java 1.8.0_311 on Solaris 9 returns relocation error, symbols unsetenv and sema_timedwait not found

This is similar to this question about Java 1.6. As the OP of that question, I have a Solaris on a SPARC v9 architecture (physical SUN Fire V445):

-bash-4.4$ cat /etc/release 
                      Solaris 9 9/05 HW s9s_u9wos_06b SPARC
           Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
                        Use is subject to license terms.
                           Assembled 25 September 2006
-bash-4.4$ isainfo -v
64-bit sparcv9 applications
32-bit sparc applications

Calling java from the latest Oracle-distributed Java 8 for SPARC 64-bit gets me this:

-bash-4.4$ /usr/jdk/instances/jdk1.8.0_311/bin/java -version
Error: dl failure on line 893
Error: failed /export/home1/java/instances/jdk1.8.0_311/jre/lib/sparcv9/server/libjvm.so, because ld.so.1: java: fatal: relocation error: file /export/home1/java/instances/jdk1.8.0_311/jre/lib/sparcv9/server/libjvm.so: symbol unsetenv: referenced symbol not found

Looking at libjvm.so more closely, not only unsetenv is missing:

-bash-4.4$ ldd -rv /usr/jdk/instances/jdk1.8.0_311/jre/lib/sparcv9/server/libjvm.so

   find object=libsocket.so.1; required by /usr/jdk/instances/jdk1.8.0_311/jre/lib/sparcv9/server/libjvm.so
        libsocket.so.1 =>        /usr/lib/64/libsocket.so.1

   find object=libsched.so.1; required by /usr/jdk/instances/jdk1.8.0_311/jre/lib/sparcv9/server/libjvm.so
        libsched.so.1 =>         /usr/lib/64/libsched.so.1

   find object=libdl.so.1; required by /usr/jdk/instances/jdk1.8.0_311/jre/lib/sparcv9/server/libjvm.so
        libdl.so.1 =>    /usr/lib/64/libdl.so.1

   find object=libm.so.1; required by /usr/jdk/instances/jdk1.8.0_311/jre/lib/sparcv9/server/libjvm.so
        libm.so.1 =>     /usr/lib/64/libm.so.1

   find object=libCrun.so.1; required by /usr/jdk/instances/jdk1.8.0_311/jre/lib/sparcv9/server/libjvm.so
        libCrun.so.1 =>  /usr/lib/64/libCrun.so.1

   find object=libthread.so.1; required by /usr/jdk/instances/jdk1.8.0_311/jre/lib/sparcv9/server/libjvm.so
        libthread.so.1 =>        /usr/lib/64/libthread.so.1

   find object=libdoor.so.1; required by /usr/jdk/instances/jdk1.8.0_311/jre/lib/sparcv9/server/libjvm.so
        libdoor.so.1 =>  /usr/lib/64/libdoor.so.1

   find object=libc.so.1; required by /usr/jdk/instances/jdk1.8.0_311/jre/lib/sparcv9/server/libjvm.so
        libc.so.1 =>     /usr/lib/64/libc.so.1

   find object=libdemangle.so.1; required by /usr/jdk/instances/jdk1.8.0_311/jre/lib/sparcv9/server/libjvm.so
        libdemangle.so.1 =>      /usr/lib/64/libdemangle.so.1

   find object=libkstat.so.1; required by /usr/jdk/instances/jdk1.8.0_311/jre/lib/sparcv9/server/libjvm.so
        libkstat.so.1 =>         /usr/lib/64/libkstat.so.1

   find object=libnsl.so.1; required by /usr/lib/64/libsocket.so.1
        libnsl.so.1 =>   /usr/lib/64/libnsl.so.1
   find version=libnsl.so.1
        libnsl.so.1 (SUNW_1.7) =>        /usr/lib/64/libnsl.so.1
        libnsl.so.1 (SUNWprivate_1.1) =>         /usr/lib/64/libnsl.so.1

   find object=libc.so.1; required by /usr/lib/64/libsocket.so.1
   find version=libc.so.1
        libc.so.1 (SUNW_1.19) =>         /usr/lib/64/libc.so.1
        libc.so.1 (SUNWprivate_1.1) =>   /usr/lib/64/libc.so.1

   find object=libc.so.1; required by /usr/lib/64/libsched.so.1
   find version=libc.so.1
        libc.so.1 (SUNW_0.8) =>  /usr/lib/64/libc.so.1
        libc.so.1 (SUNWprivate_1.1) =>   /usr/lib/64/libc.so.1

   find object=libc.so.1; required by /usr/lib/64/libm.so.1
   find version=libc.so.1
        libc.so.1 (SUNW_0.7) =>  /usr/lib/64/libc.so.1

   find object=libc.so.1; required by /usr/lib/64/libCrun.so.1
   find version=libc.so.1
        libc.so.1 (SUNW_1.1) =>  /usr/lib/64/libc.so.1
        libc.so.1 (SUNWprivate_1.1) =>   /usr/lib/64/libc.so.1

   find object=libc.so.1; required by /usr/lib/64/libthread.so.1
   find version=libc.so.1
        libc.so.1 (SUNW_1.21.2) =>       /usr/lib/64/libc.so.1
        libc.so.1 (SUNWprivate_1.1) =>   /usr/lib/64/libc.so.1

   find object=libdl.so.1; required by /usr/lib/64/libthread.so.1
   find version=libdl.so.1
        libdl.so.1 (SUNWprivate_1.1) =>  /usr/lib/64/libdl.so.1

   find object=libc.so.1; required by /usr/lib/64/libdoor.so.1
   find version=libc.so.1
        libc.so.1 (SUNW_1.1) =>  /usr/lib/64/libc.so.1
        libc.so.1 (SUNWprivate_1.1) =>   /usr/lib/64/libc.so.1

   find object=libdl.so.1; required by /usr/lib/64/libc.so.1
   find version=libdl.so.1
        libdl.so.1 (SUNW_1.4) =>         /usr/lib/64/libdl.so.1
        libdl.so.1 (SUNWprivate_1.1) =>  /usr/lib/64/libdl.so.1

   find object=libc.so.1; required by /usr/lib/64/libdemangle.so.1
   find version=libc.so.1
        libc.so.1 (SUNW_0.8) =>  /usr/lib/64/libc.so.1

   find object=libc.so.1; required by /usr/lib/64/libkstat.so.1
   find version=libc.so.1
        libc.so.1 (SUNW_0.9) =>  /usr/lib/64/libc.so.1

   find object=libdl.so.1; required by /usr/lib/64/libnsl.so.1
   find version=libdl.so.1
        libdl.so.1 (SUNW_0.7) =>         /usr/lib/64/libdl.so.1

   find object=libc.so.1; required by /usr/lib/64/libnsl.so.1
   find version=libc.so.1
        libc.so.1 (SUNW_1.21) =>         /usr/lib/64/libc.so.1
        libc.so.1 (SUNWprivate_1.2) =>   /usr/lib/64/libc.so.1

   find object=libmp.so.2; required by /usr/lib/64/libnsl.so.1
        libmp.so.2 =>    /usr/lib/64/libmp.so.2
   find version=libmp.so.2
        libmp.so.2 (SUNW_1.1) =>         /usr/lib/64/libmp.so.2
        libmp.so.2 (SUNWprivate_1.1) =>  /usr/lib/64/libmp.so.2

   find object=libc.so.1; required by /usr/lib/64/libmp.so.2
   find version=libc.so.1
        libc.so.1 (SUNW_0.7) =>  /usr/lib/64/libc.so.1

   object=/usr/lib/64/libc.so.1; filter for /usr/platform/$PLATFORM/lib/sparcv9/libc_psr.so.1

   find object=/usr/platform/SUNW,Sun-Fire-V445/lib/sparcv9/libc_psr.so.1; required by /usr/lib/64/libc.so.1
        /usr/platform/SUNW,Sun-Fire-V445/lib/sparcv9/libc_psr.so.1

   object=/usr/lib/64/libdl.so.1; filter for /usr/lib/sparcv9/ld.so.1
        symbol not found: unsetenv              (/usr/jdk/instances/jdk1.8.0_311/jre/lib/sparcv9/server/libjvm.so)
        symbol not found: sema_timedwait                (/usr/jdk/instances/jdk1.8.0_311/jre/lib/sparcv9/server/libjvm.so)

I assume that the timedwait semaphore should be implemented by librt, but it is not:

-bash-4.4$ nm -gD /usr/lib/64/librt.so | grep sema
                 w _libthread_sema_wait
                 U _lwp_sema_init
                 U _lwp_sema_post
                 U _lwp_sema_trywait
                 U _lwp_sema_wait
                 U sema_destroy
                 U sema_init
                 U sema_post
                 U sema_trywait
                 U sema_wait

Seems, I’m stuck here, since that is the only librt.so available on that machine. Does anybody have an idea how to get it working? (I know, sunos5.9 is a dying platform, but Oracle still distributes for that platform and I’d simply expect to use it there as well.)

Thanks!

Advertisement

Answer

You need to upgrade your system to a later version of Solaris. Java 8 is not supported on Solaris 9:

System Requirements

This version of the JDK is supported on the Oracle Solaris 10 Update 9 or later OS, Oracle Solaris 11 Express OS, and Oracle Solaris 11 OS. …

Solaris 9 does not have an unsetenv() function. The basic library functions documented in the Solaris 9 man page only lists the following u*() functions:

U

ualarm(3C)- schedule signal after interval in microseconds
ulckpwdf(3C)- manipulate shadow password database lock file
ulltostr(3C)- string conversion routines
ungetc(3C)- push byte back into input stream
ungetwc(3C)- push wide-character code back into input stream
unlockpt(3C)- unlock a pseudo-terminal master/slave pair
unordered(3C)- determine type of floating-point number
updwtmp(3C)- user accounting database functions
updwtmpx(3C)- user accounting database functions
usleep(3C)- suspend execution for interval in microseconds
utmpname(3C)- user accounting database functions
utmpxname(3C)- user accounting database functions

The only environment handling function in Solaris 9 is putenv():

NAME

putenv- change or add value to environment

SYNOPSIS

#include <stdlib.h>

int putenv(char *string);

Likewise, there’s no sema_timedwait() in the “S” section of the Threads and Realtime Library Functions man pages section 3 documentation:

S

   .
   .
   .
sem_unlink — remove a named semaphore ( Index Term Link )
sem_wait — acquire or wait for a semaphore ( Index Term Link )
sema_destroy() — destroy a semaphore ( Index Term Link )
sema_init() — initialize a semaphore ( Index Term Link )
sema_post() — increment a semaphore ( Index Term Link )
sema_trywait() — decrement a semaphore ( Index Term Link )
sema_wait() — decrement a semaphore ( Index Term Link )
semaphore ...
Advertisement