commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mark Thomas (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (DAEMON-325) missing location in location.c location_jvm_configure for Darwin
Date Fri, 20 Oct 2017 07:55:01 GMT

     [ https://issues.apache.org/jira/browse/DAEMON-325?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Mark Thomas resolved DAEMON-325.
--------------------------------
       Resolution: Duplicate
    Fix Version/s: 1.1

This was fixed in 1.0.x and forward ported to 1.1.x several months ago.

I'm currently working on getting a 1.1 release out that supports Java 9 - hopefully in the
next couple of weeks.

> missing location in location.c location_jvm_configure for Darwin
> ----------------------------------------------------------------
>
>                 Key: DAEMON-325
>                 URL: https://issues.apache.org/jira/browse/DAEMON-325
>             Project: Commons Daemon
>          Issue Type: Bug
>          Components: Jsvc
>    Affects Versions: 1.0.15
>         Environment: Mac OS X and JDK 7 
>            Reporter: philippe le berre
>            Priority: Blocker
>             Fix For: 1.1
>
>         Attachments: java.c.diff, location.c.diff
>
>
> On OS_DARWIN the native/location.c is missing a location and java.c is missing a check/location
for libverify.dylib
> --- location.c.old	2014-11-01 18:53:45.000000000 +0100
> +++ location.c	2014-11-01 18:54:15.000000000 +0100
> @@ -144,6 +144,7 @@ char *location_jvm_default[] = {
>  char *location_jvm_configured[] = {
>  #if defined(OS_DARWIN)
>      "$JAVA_HOME/../Libraries/lib$VM_NAME.dylib",
> +    "$JAVA_HOME/jre/lib/$VM_NAME/libjvm.dylib",
>  #elif defined(OS_CYGWIN)
>      "$JAVA_HOME/jre/bin/$VM_NAME/jvm.dll",              /* Sun JDK 1.3 */
>  #elif defined(OS_LINUX) || defined(OS_SOLARIS) || defined(OS_BSD) || defined(OS_FREEBSD)
|| defined(OS_TRU64)
> --- /Users/rplb/java.c.orig	2014-11-02 12:00:16.000000000 +0100
> +++ /Users/rplb/java.c	2014-11-02 12:16:25.000000000 +0100
> @@ -135,8 +135,15 @@
>  {
>  #ifdef OS_DARWIN
>      dso_handle apph = NULL;
> -    char appf[1024];
> +    char repl[1024];
>      struct stat sb;
> +    char *jvm_libs[] = {
> +        "$JAVA_HOME/../Libraries/libjvm_compat.dylib",
> +        "$JAVA_HOME/../Libraries/libappshell.dylib",
> +        "$JAVA_HOME/jre/lib/libverify.dylib",
> +        NULL,
> +    };
> +    
>  #endif /* ifdef OS_DARWIN */
>      jvm_create_t symb = NULL;
>      JNINativeMethod nativemethods[2];
> @@ -184,30 +191,33 @@
>         JVM 1.4.1 through 1.5.* The library name is libjvm_compat.dylib
>         starting with JVM 1.6 on OS X 10.6 the library name is libverify.dylib.
>       */
> -    if (replace(appf, 1024, "$JAVA_HOME/../Libraries/libappshell.dylib",
> -                "$JAVA_HOME", data->path) != 0) {
> -        log_error("Cannot replace values in loader library");
> -        return false;
> -    }
> -    if (stat(appf, &sb)) {
> -        if (replace(appf, 1024, "$JAVA_HOME/../Libraries/libjvm_compat.dylib",
> -                    "$JAVA_HOME", data->path) != 0) {
> +    x = 0;
> +    char *appf = NULL;
> +    while (jvm_libs[x] != NULL) {
> +        char *orig = jvm_libs[x];
> +        int k = 0;
> +        
> +        k = replace(repl, 1024, orig, "$JAVA_HOME", data->path);
> +        if (k != 0) {
>              log_error("Cannot replace values in loader library");
>              return false;
>          }
> -    }
> -    if (stat(appf, &sb)) {
> -        if (replace(appf, 1024, "$JAVA_HOME/../Libraries/libverify.dylib",
> -                    "$JAVA_HOME", data->path) != 0) {
> -            log_error("Cannot replace values in loader library");
> -            return false;
> +        
> +        if (stat(repl, &sb)) {
> +            log_debug("Cannot load the shell library %s", repl);
> +            x++;
> +        } else {
> +            appf = repl;
> +            break;
>          }
>      }
> -    apph = dso_link(appf);
> -    if (apph == NULL) {
> -        log_error("Cannot load required shell library %s", appf);
> +    
> +    if (appf == NULL) {
> +        log_error("Cannot load none of the required shell library");
>          return false;
>      }
> +    
> +    apph = dso_link(appf);
>      log_debug("Shell library %s loaded", appf);
>  #endif /* ifdef OS_DARWIN */
>  #if defined(OSD_POSIX)



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message