[Pkg-octave-devel] Bug#676800: Bug#676800: octave-java: completely breaks octave

John W. Eaton jwe at octave.org
Wed Jun 20 16:49:06 UTC 2012


On 20-Jun-2012, Sébastien Villemot wrote:

| "John W. Eaton" <jwe at octave.org> writes:
| 
| > I'd like to help debug this problem but I need some help.
| 
| Thanks for volunteering!
| 
| > I need to be able to install a debug version of Octave (preferably the
| > current development sources) and build the Java package also with
| > debugging symbols.  I'm using Debian testing.  What packages do I need
| > to install?  After doing
| >
| >   pkg install java-1.2.8.tar.gz
| >
| > apparently successfully, I'm seeing
| >
| >   octave> javaclasspath
| >   warning: timestamp on file /usr/lib/jvm/default-java/jre/lib/amd64/client/libjvm.so is in the future
| >   error: java_invoke: /usr/lib/jvm/default-java/jre/lib/amd64/client/libjvm.so: failed to load: /usr/lib/jvm/default-java/jre/lib/amd64/client/libjvm.so: cannot open shared object file: No such file or directory
| >   error: called from:
| >   error:   /home/jwe/octave/java-1.2.8/javaclasspath.m at line 49, column 14
| 
| You need this patch (incorporated in the octave-java package):
| 
|  http://anonscm.debian.org/gitweb/?p=pkg-octave/octave-java.git;a=blob;f=debian/patches/libjvm.patch;h=cc847293d00ae09ac74e8eca833dbafdd48918a2;hb=19a7fdc2264cb0166f5324677bf2615252fda8e3
| 
| Also, /usr/lib/jvm/default-java points to OpenJDK 6 on my Debian sid
| system. If you want to select OpenJDK 7, you need to set the JAVA_HOME
| variable to:
| 
|  export JAVA_HOME = /usr/lib/jvm/java-7-openjdk-amd64
| 
| (this is done in debian/rules of the octave-java package).

Thanks.  With that, I'm able to build the java package.  Running
Octave with valgrind and executing javaclasspath at the Octave prompt,
I see a lot of messages, starting with:

  ==29404== Warning: set address range perms: large range [0x393a7000, 0x1371a7000) (defined)
  ==29404== Warning: set address range perms: large range [0x393a7000, 0x1371a7000) (noaccess)
  ==29404== Warning: set address range perms: large range [0x393a7000, 0x1371a7000) (defined)
  ==29404== Warning: set address range perms: large range [0x1371a7000, 0x234fa7000) (defined)
  ==29404== Warning: set address range perms: large range [0x234fa7000, 0x332da7000) (defined)
  ==29404== Warning: set address range perms: large range [0x41036a000, 0x50e16a000) (defined)
  ==29404== Warning: set address range perms: large range [0x50e16a000, 0x60bf6a000) (defined)
  ==29404== Warning: set address range perms: large range [0x60bf6a000, 0x709d6a000) (defined)
  ==29404== Warning: set address range perms: large range [0x393a7000, 0x1371a7000) (noaccess)
  ==29404== Warning: set address range perms: large range [0x1371a7000, 0x234fa7000) (noaccess)
  ==29404== Warning: set address range perms: large range [0x234fa7000, 0x332da7000) (noaccess)
  ==29404== Warning: set address range perms: large range [0x41036a000, 0x50e16a000) (noaccess)
  ==29404== Warning: set address range perms: large range [0x50e16a000, 0x60bf6a000) (noaccess)
  ==29404== Warning: set address range perms: large range [0x60bf6a000, 0x702200000) (noaccess)
  ==29404== Warning: set address range perms: large range [0x393a7000, 0x1371b7000) (defined)
  ==29404== Warning: set address range perms: large range [0x393a7000, 0x1371b7000) (noaccess)
  ==29404== Warning: set address range perms: large range [0x393a7000, 0x1371c0000) (defined)
  ==29404== Invalid write of size 4
  ==29404==    at 0x163212BD: ???
  ==29404==    by 0x16311437: ???
  ==29404==    by 0x1554C68D: JavaCalls::call_helper(JavaValue*, methodHandle*, JavaCallArguments*, Thread*) (in /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server/libjvm.so)
  ==29404==    by 0x1554C134: JavaCalls::call(JavaValue*, methodHandle, JavaCallArguments*, Thread*) (in /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server/libjvm.so)
  ==29404==    by 0x1550ECA0: instanceKlass::call_class_initializer_impl(instanceKlassHandle, Thread*) (in /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server/libjvm.so)
  ==29404==    by 0x1550ED1C: instanceKlass::call_class_initializer(Thread*) (in /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server/libjvm.so)
  ==29404==    by 0x1550EEF0: instanceKlass::initialize_impl(instanceKlassHandle, Thread*) (in /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server/libjvm.so)
  ==29404==    by 0x1550F40A: instanceKlass::initialize(Thread*) (in /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server/libjvm.so)
  ==29404==    by 0x1550F17F: instanceKlass::initialize_impl(instanceKlassHandle, Thread*) (in /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server/libjvm.so)
  ==29404==    by 0x1550F40A: instanceKlass::initialize(Thread*) (in /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server/libjvm.so)
  ==29404==    by 0x1582E6F5: Threads::create_vm(JavaVMInitArgs*, bool*) (in /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server/libjvm.so)
  ==29404==    by 0x15569D67: JNI_CreateJavaVM (in /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server/libjvm.so)
  ==29404==  Address 0x7feffd960 is not stack'd, malloc'd or (recently) free'd
  ==29404== 
  ==29404== Invalid write of size 4
  ==29404==    at 0x163212C4: ???
  ==29404==    by 0x16311437: ???
  ==29404==    by 0x1554C68D: JavaCalls::call_helper(JavaValue*, methodHandle*, JavaCallArguments*, Thread*) (in /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server/libjvm.so)
  ==29404==    by 0x1554C134: JavaCalls::call(JavaValue*, methodHandle, JavaCallArguments*, Thread*) (in /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server/libjvm.so)
  ==29404==    by 0x1550ECA0: instanceKlass::call_class_initializer_impl(instanceKlassHandle, Thread*) (in /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server/libjvm.so)
  ==29404==    by 0x1550ED1C: instanceKlass::call_class_initializer(Thread*) (in /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server/libjvm.so)
  ==29404==    by 0x1550EEF0: instanceKlass::initialize_impl(instanceKlassHandle, Thread*) (in /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server/libjvm.so)
  ==29404==    by 0x1550F40A: instanceKlass::initialize(Thread*) (in /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server/libjvm.so)
  ==29404==    by 0x1550F17F: instanceKlass::initialize_impl(instanceKlassHandle, Thread*) (in /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server/libjvm.so)
  ==29404==    by 0x1550F40A: instanceKlass::initialize(Thread*) (in /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server/libjvm.so)
  ==29404==    by 0x1582E6F5: Threads::create_vm(JavaVMInitArgs*, bool*) (in /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server/libjvm.so)
  ==29404==    by 0x15569D67: JNI_CreateJavaVM (in /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server/libjvm.so)
  ==29404==  Address 0x7feffc960 is not stack'd, malloc'd or (recently) free'd
  ==29404== 
  ==29404== Invalid write of size 4
  ==29404==    at 0x163212CB: ???
  ==29404==    by 0x16311437: ???
  ==29404==    by 0x1554C68D: JavaCalls::call_helper(JavaValue*, methodHandle*, JavaCallArguments*, Thread*) (in /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server/libjvm.so)
  ==29404==    by 0x1554C134: JavaCalls::call(JavaValue*, methodHandle, JavaCallArguments*, Thread*) (in /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server/libjvm.so)
  ==29404==    by 0x1550ECA0: instanceKlass::call_class_initializer_impl(instanceKlassHandle, Thread*) (in /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server/libjvm.so)
  ==29404==    by 0x1550ED1C: instanceKlass::call_class_initializer(Thread*) (in /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server/libjvm.so)
  ==29404==    by 0x1550EEF0: instanceKlass::initialize_impl(instanceKlassHandle, Thread*) (in /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server/libjvm.so)
  ==29404==    by 0x1550F40A: instanceKlass::initialize(Thread*) (in /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server/libjvm.so)
  ==29404==    by 0x1550F17F: instanceKlass::initialize_impl(instanceKlassHandle, Thread*) (in /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server/libjvm.so)
  ==29404==    by 0x1550F40A: instanceKlass::initialize(Thread*) (in /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server/libjvm.so)
  ==29404==    by 0x1582E6F5: Threads::create_vm(JavaVMInitArgs*, bool*) (in /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server/libjvm.so)
  ==29404==    by 0x15569D67: JNI_CreateJavaVM (in /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server/libjvm.so)
  ==29404==  Address 0x7feffb960 is not stack'd, malloc'd or (recently) free'd
  ==29404== 
  ==29404== Invalid write of size 4
  ==29404==    at 0x163212D2: ???
  ==29404==    by 0x16311437: ???
  ==29404==    by 0x1554C68D: JavaCalls::call_helper(JavaValue*, methodHandle*, JavaCallArguments*, Thread*) (in /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server/libjvm.so)
  ==29404==    by 0x1554C134: JavaCalls::call(JavaValue*, methodHandle, JavaCallArguments*, Thread*) (in /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server/libjvm.so)
  ==29404==    by 0x1550ECA0: instanceKlass::call_class_initializer_impl(instanceKlassHandle, Thread*) (in /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server/libjvm.so)
  ==29404==    by 0x1550ED1C: instanceKlass::call_class_initializer(Thread*) (in /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server/libjvm.so)
  ==29404==    by 0x1550EEF0: instanceKlass::initialize_impl(instanceKlassHandle, Thread*) (in /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server/libjvm.so)
  ==29404==    by 0x1550F40A: instanceKlass::initialize(Thread*) (in /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server/libjvm.so)
  ==29404==    by 0x1550F17F: instanceKlass::initialize_impl(instanceKlassHandle, Thread*) (in /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server/libjvm.so)
  ==29404==    by 0x1550F40A: instanceKlass::initialize(Thread*) (in /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server/libjvm.so)
  ==29404==    by 0x1582E6F5: Threads::create_vm(JavaVMInitArgs*, bool*) (in /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server/libjvm.so)
  ==29404==    by 0x15569D67: JNI_CreateJavaVM (in /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server/libjvm.so)
  ==29404==  Address 0x7feffa960 is not stack'd, malloc'd or (recently) free'd
  ==29404== 
  ==29404== Invalid write of size 4
  ==29404==    at 0x163212D9: ???
  ==29404==    by 0x16311437: ???
  ==29404==    by 0x1554C68D: JavaCalls::call_helper(JavaValue*, methodHandle*, JavaCallArguments*, Thread*) (in /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server/libjvm.so)
  ==29404==    by 0x1554C134: JavaCalls::call(JavaValue*, methodHandle, JavaCallArguments*, Thread*) (in /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server/libjvm.so)
  ==29404==    by 0x1550ECA0: instanceKlass::call_class_initializer_impl(instanceKlassHandle, Thread*) (in /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server/libjvm.so)
  ==29404==    by 0x1550ED1C: instanceKlass::call_class_initializer(Thread*) (in /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server/libjvm.so)
  ==29404==    by 0x1550EEF0: instanceKlass::initialize_impl(instanceKlassHandle, Thread*) (in /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server/libjvm.so)
  ==29404==    by 0x1550F40A: instanceKlass::initialize(Thread*) (in /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server/libjvm.so)
  ==29404==    by 0x1550F17F: instanceKlass::initialize_impl(instanceKlassHandle, Thread*) (in /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server/libjvm.so)
  ==29404==    by 0x1550F40A: instanceKlass::initialize(Thread*) (in /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server/libjvm.so)
  ==29404==    by 0x1582E6F5: Threads::create_vm(JavaVMInitArgs*, bool*) (in /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server/libjvm.so)
  ==29404==    by 0x15569D67: JNI_CreateJavaVM (in /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server/libjvm.so)
  ==29404==  Address 0x7feff9960 is not stack'd, malloc'd or (recently) free'd
  ==29404== 
  ==29404== Invalid write of size 4
  ==29404==    at 0x163212E0: ???
  ==29404==    by 0x16311437: ???
  ==29404==    by 0x1554C68D: JavaCalls::call_helper(JavaValue*, methodHandle*, JavaCallArguments*, Thread*) (in /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server/libjvm.so)
  ==29404==    by 0x1554C134: JavaCalls::call(JavaValue*, methodHandle, JavaCallArguments*, Thread*) (in /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server/libjvm.so)
  ==29404==    by 0x1550ECA0: instanceKlass::call_class_initializer_impl(instanceKlassHandle, Thread*) (in /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server/libjvm.so)
  ==29404==    by 0x1550ED1C: instanceKlass::call_class_initializer(Thread*) (in /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server/libjvm.so)
  ==29404==    by 0x1550EEF0: instanceKlass::initialize_impl(instanceKlassHandle, Thread*) (in /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server/libjvm.so)
  ==29404==    by 0x1550F40A: instanceKlass::initialize(Thread*) (in /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server/libjvm.so)
  ==29404==    by 0x1550F17F: instanceKlass::initialize_impl(instanceKlassHandle, Thread*) (in /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server/libjvm.so)
  ==29404==    by 0x1550F40A: instanceKlass::initialize(Thread*) (in /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server/libjvm.so)
  ==29404==    by 0x1582E6F5: Threads::create_vm(JavaVMInitArgs*, bool*) (in /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server/libjvm.so)
  ==29404==    by 0x15569D67: JNI_CreateJavaVM (in /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server/libjvm.so)
  ==29404==  Address 0x7feff8960 is not stack'd, malloc'd or (recently) free'd
  ==29404== 
  ==29404== Invalid write of size 4
  ==29404==    at 0x163229BF: ???
  ==29404==    by 0x16316F97: ???
  ==29404==    by 0x16311437: ???
  ==29404==    by 0x1554C68D: JavaCalls::call_helper(JavaValue*, methodHandle*, JavaCallArguments*, Thread*) (in /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server/libjvm.so)
  ==29404==    by 0x1554C134: JavaCalls::call(JavaValue*, methodHandle, JavaCallArguments*, Thread*) (in /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server/libjvm.so)
  ==29404==    by 0x1550ECA0: instanceKlass::call_class_initializer_impl(instanceKlassHandle, Thread*) (in /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server/libjvm.so)
  ==29404==    by 0x1550ED1C: instanceKlass::call_class_initializer(Thread*) (in /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server/libjvm.so)
  ==29404==    by 0x1550EEF0: instanceKlass::initialize_impl(instanceKlassHandle, Thread*) (in /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server/libjvm.so)
  ==29404==    by 0x1550F40A: instanceKlass::initialize(Thread*) (in /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server/libjvm.so)
  ==29404==    by 0x1550F17F: instanceKlass::initialize_impl(instanceKlassHandle, Thread*) (in /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server/libjvm.so)
  ==29404==    by 0x1550F40A: instanceKlass::initialize(Thread*) (in /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server/libjvm.so)
  ==29404==    by 0x1582E6F5: Threads::create_vm(JavaVMInitArgs*, bool*) (in /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server/libjvm.so)
  ==29404==  Address 0x7feff8900 is not stack'd, malloc'd or (recently) free'd
  ==29404== 
  ==29404== Invalid write of size 4
  ==29404==    at 0x163212BD: ???
  ==29404==    by 0x16316F97: ???
  ==29404==    by 0x16311437: ???
  ==29404==    by 0x1554C68D: JavaCalls::call_helper(JavaValue*, methodHandle*, JavaCallArguments*, Thread*) (in /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server/libjvm.so)
  ==29404==    by 0x1554C134: JavaCalls::call(JavaValue*, methodHandle, JavaCallArguments*, Thread*) (in /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server/libjvm.so)
  ==29404==    by 0x1550ECA0: instanceKlass::call_class_initializer_impl(instanceKlassHandle, Thread*) (in /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server/libjvm.so)
  ==29404==    by 0x1550ED1C: instanceKlass::call_class_initializer(Thread*) (in /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server/libjvm.so)
  ==29404==    by 0x1550EEF0: instanceKlass::initialize_impl(instanceKlassHandle, Thread*) (in /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server/libjvm.so)
  ==29404==    by 0x1550F40A: instanceKlass::initialize(Thread*) (in /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server/libjvm.so)
  ==29404==    by 0x1582E6F5: Threads::create_vm(JavaVMInitArgs*, bool*) (in /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server/libjvm.so)
  ==29404==    by 0x15569D67: JNI_CreateJavaVM (in /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server/libjvm.so)
  ==29404==    by 0x14E2E0BC: initialize_jvm() (__java__.cc:527)
  ==29404==  Address 0x7feffda38 is not stack'd, malloc'd or (recently) free'd
  ==29404== 
  ==29404== Invalid write of size 4
  ==29404==    at 0x163212C4: ???
  ==29404==    by 0x16316F97: ???
  ==29404==    by 0x16311437: ???
  ==29404==    by 0x1554C68D: JavaCalls::call_helper(JavaValue*, methodHandle*, JavaCallArguments*, Thread*) (in /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server/libjvm.so)
  ==29404==    by 0x1554C134: JavaCalls::call(JavaValue*, methodHandle, JavaCallArguments*, Thread*) (in /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server/libjvm.so)
  ==29404==    by 0x1550ECA0: instanceKlass::call_class_initializer_impl(instanceKlassHandle, Thread*) (in /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server/libjvm.so)
  ==29404==    by 0x1550ED1C: instanceKlass::call_class_initializer(Thread*) (in /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server/libjvm.so)
  ==29404==    by 0x1550EEF0: instanceKlass::initialize_impl(instanceKlassHandle, Thread*) (in /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server/libjvm.so)
  ==29404==    by 0x1550F40A: instanceKlass::initialize(Thread*) (in /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server/libjvm.so)
  ==29404==    by 0x1582E6F5: Threads::create_vm(JavaVMInitArgs*, bool*) (in /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server/libjvm.so)
  ==29404==    by 0x15569D67: JNI_CreateJavaVM (in /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server/libjvm.so)
  ==29404==    by 0x14E2E0BC: initialize_jvm() (__java__.cc:527)
  ==29404==  Address 0x7feffca38 is not stack'd, malloc'd or (recently) free'd
  ==29404== 
  ==29404== Invalid write of size 4
  ==29404==    at 0x163212CB: ???
  ==29404==    by 0x16316F97: ???
  ==29404==    by 0x16311437: ???
  ==29404==    by 0x1554C68D: JavaCalls::call_helper(JavaValue*, methodHandle*, JavaCallArguments*, Thread*) (in /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server/libjvm.so)
  ==29404==    by 0x1554C134: JavaCalls::call(JavaValue*, methodHandle, JavaCallArguments*, Thread*) (in /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server/libjvm.so)
  ==29404==    by 0x1550ECA0: instanceKlass::call_class_initializer_impl(instanceKlassHandle, Thread*) (in /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server/libjvm.so)
  ==29404==    by 0x1550ED1C: instanceKlass::call_class_initializer(Thread*) (in /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server/libjvm.so)
  ==29404==    by 0x1550EEF0: instanceKlass::initialize_impl(instanceKlassHandle, Thread*) (in /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server/libjvm.so)
  ==29404==    by 0x1550F40A: instanceKlass::initialize(Thread*) (in /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server/libjvm.so)
  ==29404==    by 0x1582E6F5: Threads::create_vm(JavaVMInitArgs*, bool*) (in /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server/libjvm.so)
  ==29404==    by 0x15569D67: JNI_CreateJavaVM (in /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server/libjvm.so)
  ==29404==    by 0x14E2E0BC: initialize_jvm() (__java__.cc:527)
  ==29404==  Address 0x7feffba38 is not stack'd, malloc'd or (recently) free'd
  ==29404== 
  ==29404== Invalid write of size 4
  ==29404==    at 0x163212D2: ???
  ==29404==    by 0x16316F97: ???
  ==29404==    by 0x16311437: ???
  ==29404==    by 0x1554C68D: JavaCalls::call_helper(JavaValue*, methodHandle*, JavaCallArguments*, Thread*) (in /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server/libjvm.so)
  ==29404==    by 0x1554C134: JavaCalls::call(JavaValue*, methodHandle, JavaCallArguments*, Thread*) (in /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server/libjvm.so)
  ==29404==    by 0x1550ECA0: instanceKlass::call_class_initializer_impl(instanceKlassHandle, Thread*) (in /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server/libjvm.so)
  ==29404==    by 0x1550ED1C: instanceKlass::call_class_initializer(Thread*) (in /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server/libjvm.so)
  ==29404==    by 0x1550EEF0: instanceKlass::initialize_impl(instanceKlassHandle, Thread*) (in /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server/libjvm.so)
  ==29404==    by 0x1550F40A: instanceKlass::initialize(Thread*) (in /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server/libjvm.so)
  ==29404==    by 0x1582E6F5: Threads::create_vm(JavaVMInitArgs*, bool*) (in /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server/libjvm.so)
  ==29404==    by 0x15569D67: JNI_CreateJavaVM (in /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server/libjvm.so)
  ==29404==    by 0x14E2E0BC: initialize_jvm() (__java__.cc:527)
  ==29404==  Address 0x7feffaa38 is not stack'd, malloc'd or (recently) free'd
  ==29404== 
  ==29404== Invalid write of size 4
  ==29404==    at 0x163212D9: ???
  ==29404==    by 0x16316F97: ???
  ==29404==    by 0x16311437: ???
  ==29404==    by 0x1554C68D: JavaCalls::call_helper(JavaValue*, methodHandle*, JavaCallArguments*, Thread*) (in /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server/libjvm.so)
  ==29404==    by 0x1554C134: JavaCalls::call(JavaValue*, methodHandle, JavaCallArguments*, Thread*) (in /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server/libjvm.so)
  ==29404==    by 0x1550ECA0: instanceKlass::call_class_initializer_impl(instanceKlassHandle, Thread*) (in /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server/libjvm.so)
  ==29404==    by 0x1550ED1C: instanceKlass::call_class_initializer(Thread*) (in /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server/libjvm.so)
  ==29404==    by 0x1550EEF0: instanceKlass::initialize_impl(instanceKlassHandle, Thread*) (in /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server/libjvm.so)
  ==29404==    by 0x1550F40A: instanceKlass::initialize(Thread*) (in /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server/libjvm.so)
  ==29404==    by 0x1582E6F5: Threads::create_vm(JavaVMInitArgs*, bool*) (in /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server/libjvm.so)
  ==29404==    by 0x15569D67: JNI_CreateJavaVM (in /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server/libjvm.so)
  ==29404==    by 0x14E2E0BC: initialize_jvm() (__java__.cc:527)
  ==29404==  Address 0x7feff9a38 is not stack'd, malloc'd or (recently) free'd
  ...

and many more.  These all seem to be coming from the JNI_CreateJavaVM
function, but I don't see that we are calling it incorrectly.  I'm
also not sure whether these messages indicate real problems or if they
are false positives from valgrind.

Even the following much simpler program generates a similar quantity
of messages:

  #include <jni.h>
  int
  main (void)
  {
    JavaVM *jvm;
    JNIEnv *env;
    JavaVMInitArgs vm_args;
    vm_args.version = JNI_VERSION_1_6;
    vm_args.nOptions = 0;
    vm_args.options = 0;
    vm_args.ignoreUnrecognized = false;
    JNI_CreateJavaVM(&jvm, (void**)&env, &vm_args);
    return 0;
  }

Is there some error in this program that could cause these messages?

I compiled this simpler program with

  g++ -I/usr/lib/jvm/java-7-openjdk-amd64/include -I/usr/lib/jvm/java-7-openjdk-amd64/include/linux foojvm.cc -L/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server -ljvm

and ran it with

  LD_LIBRARY_PATH=/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server
  valgrind ./a.out

I see similar messages if I compile and run with java-6-openjdk-amd64
instead of java-7-openjdk-amd64.

What is the correct way to compile the simple example program above
with GCJ so I can see whether there is a difference?

jwe





More information about the Pkg-octave-devel mailing list