You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by gs...@apache.org on 2007/01/18 17:44:57 UTC

svn commit: r497495 - in /harmony/enhanced/drlvm/trunk: src/test/regression/H2335/ src/test/regression/H2335/SimplestLibraryPathTest.java src/test/regression/H2335/readme.txt src/test/regression/H2335/run.test.xml vm/vmcore/src/init/vm_properties.cpp

Author: gshimansky
Date: Thu Jan 18 08:44:56 2007
New Revision: 497495

URL: http://svn.apache.org/viewvc?view=rev&rev=497495
Log:
Applied HARMONY-2335 The DRLVM fails to start if -Djava.library.path specified

Tests passed on Ubuntu6 x86, Windows 2003 server x86 and SuSE9 x86_64


Added:
    harmony/enhanced/drlvm/trunk/src/test/regression/H2335/
    harmony/enhanced/drlvm/trunk/src/test/regression/H2335/SimplestLibraryPathTest.java   (with props)
    harmony/enhanced/drlvm/trunk/src/test/regression/H2335/readme.txt   (with props)
    harmony/enhanced/drlvm/trunk/src/test/regression/H2335/run.test.xml   (with props)
Modified:
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/init/vm_properties.cpp

Added: harmony/enhanced/drlvm/trunk/src/test/regression/H2335/SimplestLibraryPathTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/src/test/regression/H2335/SimplestLibraryPathTest.java?view=auto&rev=497495
==============================================================================
--- harmony/enhanced/drlvm/trunk/src/test/regression/H2335/SimplestLibraryPathTest.java (added)
+++ harmony/enhanced/drlvm/trunk/src/test/regression/H2335/SimplestLibraryPathTest.java Thu Jan 18 08:44:56 2007
@@ -0,0 +1,11 @@
+package org.apache.harmony.drlvm.tests.regression.h2335;
+import junit.framework.TestCase;
+
+/**
+ * Test for HARMONY-2335 does nothing - the reason of bug was in broken path to
+ * system native libraries if -Djava.library.path="any subdir" is specified.
+ */
+public class SimplestLibraryPathTest extends TestCase {
+    public static void main(String[] args) {}
+    public void testNothing() {}
+} // end of class 'SimplestLibraryPathTest' definition 

Propchange: harmony/enhanced/drlvm/trunk/src/test/regression/H2335/SimplestLibraryPathTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: harmony/enhanced/drlvm/trunk/src/test/regression/H2335/SimplestLibraryPathTest.java
------------------------------------------------------------------------------
    svn:executable = *

Added: harmony/enhanced/drlvm/trunk/src/test/regression/H2335/readme.txt
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/src/test/regression/H2335/readme.txt?view=auto&rev=497495
==============================================================================
--- harmony/enhanced/drlvm/trunk/src/test/regression/H2335/readme.txt (added)
+++ harmony/enhanced/drlvm/trunk/src/test/regression/H2335/readme.txt Thu Jan 18 08:44:56 2007
@@ -0,0 +1,11 @@
+Test are written for http://issues.apache.org/jira/browse/HARMONY-2335.
+
+Please note that test code is dummy - it is not required actually. The bug was
+reporduced if you run DRLVM with java.library.path pointed to any directory e.g.:
+
+   <trunk>/working_vm/build/deploy/jdk/jre/bin/java -Djavaa.library.path=tmp NoClass
+
+The failed test output is:
+   HMYEXEL062E Internal VM error: Failed to create Java VM
+   FAILED to invoke JVM.
+

Propchange: harmony/enhanced/drlvm/trunk/src/test/regression/H2335/readme.txt
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: harmony/enhanced/drlvm/trunk/src/test/regression/H2335/readme.txt
------------------------------------------------------------------------------
    svn:executable = *

Added: harmony/enhanced/drlvm/trunk/src/test/regression/H2335/run.test.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/src/test/regression/H2335/run.test.xml?view=auto&rev=497495
==============================================================================
--- harmony/enhanced/drlvm/trunk/src/test/regression/H2335/run.test.xml (added)
+++ harmony/enhanced/drlvm/trunk/src/test/regression/H2335/run.test.xml Thu Jan 18 08:44:56 2007
@@ -0,0 +1,13 @@
+<project name="RUN HARMONY-2335 Regression Test">
+  <target name="run-test">
+    <!-- extend JUnit test launcher to run JNI test -->
+    <run-junit-test 
+      test="org.apache.harmony.drlvm.tests.regression.h2335.SimplestLibraryPathTest">
+        <junit-element>
+          <!-- All test is here - one need to set java.library.path variable -->
+          <!-- to any directory (but not '.' or dir with java executable     -->
+          <sysproperty key="java.library.path" value="non-existing-directory"/>
+        </junit-element>
+      </run-junit-test>
+  </target>
+</project>

Propchange: harmony/enhanced/drlvm/trunk/src/test/regression/H2335/run.test.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/init/vm_properties.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/init/vm_properties.cpp?view=diff&rev=497495&r1=497494&r2=497495
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/init/vm_properties.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/init/vm_properties.cpp Thu Jan 18 08:44:56 2007
@@ -214,6 +214,12 @@
     properties.set("sun.boot.library.path", base_path_buf);
 
     /*
+     * This property is used by java/lang/Runtime#loadLibrary0
+     * as path to system native libraries.
+     */
+    properties.set("vm.boot.library.path", base_path_buf);
+
+    /*
     *  it's possible someone forgot to set this property - set to default of .
     */
     if (!properties.is_set(O_A_H_VM_VMDIR)) {
@@ -240,15 +246,6 @@
         properties.set("vm.use_verifier", "true");
         properties.set("vm.jvmti.enabled", "false");
         properties.set("vm.bootclasspath.appendclasspath", "false");
-
-        /*
-        *  vm.boot.library.path initialization, the value is the location of VM executable
-        * 
-        *  2006-09-06 gmj :  there's no reason to ever believe this is true given how the VM can be 
-        *  launched in a mariad of ways, so just set to empty string.
-        */
-        properties.set("vm.boot.library.path", "");
-
         properties.set("vm.dlls", PORT_DSO_NAME(GC_DLL));
 
         int n_api_dll_files = sizeof(api_dll_files) / sizeof(char *);