[Bug 606] New: CallStaticVoidMethod dumps every time

bugzilla-daemon at icedtea.classpath.org bugzilla-daemon at icedtea.classpath.org
Wed Dec 8 11:30:08 PST 2010


           Summary: CallStaticVoidMethod dumps every time
           Product: IcedTea
           Version: 6-1.0
          Platform: 64-bit
        OS/Version: Linux
            Status: NEW
          Severity: critical
          Priority: P2
         Component: AddVM
        AssignedTo: unassigned at icedtea.classpath.org
        ReportedBy: je.joakim at gmail.com


Tried to follow this JNI tutorial (call java code from native code). at

But it just crashes when it tries to call the java method, please investigate.

BR/ Joakim

# A fatal error has been detected by the Java Runtime Environment:
#  SIGSEGV (0xb) at pc=0x00007faa6b1f7e9a, pid=10419, tid=140369927882496
# JRE version: 6.0_20-b20
# Java VM: OpenJDK 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 )
# Derivative: IcedTea6 1.9.2
# Distribution: Custom build (Thu Dec  2 17:34:18 UTC 2010)
# Problematic frame:
# V  [libjvm.so+0x424e9a]
# If you would like to submit a bug report, please include
# instructions how to reproduce the bug and visit:
#   http://icedtea.classpath.org/bugzilla

---------------  T H R E A D  ---------------

Current thread (0x0000000000607000):  JavaThread "main" [_thread_in_vm,
id=10419, stack(0x00007fff94a82000,0x00007fff94b82000)]

siginfo:si_signo=SIGSEGV: si_errno=0, si_code=1 (SEGV_MAPERR),

RAX=0x00007fff94b80b30, RBX=0x00000000006071c8, RCX=0x00007fff94b80ad0,
RSP=0x00007fff94b80a50, RBP=0x00007fff94b80a60, RSI=0x0000000000607000,
R8 =0x00000000004007a9, R9 =0x00007faa589bab40, R10=0x00007fff94b80690,
R12=0x00007fff94b80ad0, R13=0x00007fff94b80a70, R14=0x0000000000607000,
RIP=0x00007faa6b1f7e9a, EFL=0x0000000000010287, CSGSFS=0x0000000000000033,

Top of Stack: (sp=0x00007fff94b80a50)
0x00007fff94b80a50:   00000000006071c8 0000000000000000
0x00007fff94b80a60:   00007fff94b80c00 00007faa6b1f57a5
0x00007fff94b80a70:   00007fff94b80ad0 00007faa6b1269bb
0x00007fff94b80a80:   0000000000000000 0000000000607b88
0x00007fff94b80a90:   0000000000000004 0000000000000000
0x00007fff94b80aa0:   0000000000607bd0 0000000000607000

/* --main.c-- */
#include <jni.h>
#include <stdio.h>

void main(void)
  JavaVM *jvm_p = NULL;
  JNIEnv *env_p = NULL;
  JavaVMInitArgs vm_args;
  JavaVMOption options[1];
  jclass cls;
  jmethodID mid;

  options[0].optionString="-Djava.class.path=."; /* path in example makes no
difference */

  vm_args.version = JNI_VERSION_1_6;
  vm_args.nOptions = 1;
  vm_args.options = options;
  vm_args.ignoreUnrecognized = 1;

  JNI_CreateJavaVM(&jvm_p, (void **)&env_p, &vm_args);

  cls = (*env_p)->FindClass(env_p, "Main");
  mid = (*env_p)->GetStaticMethodID(env_p, cls, "test", "()V");
  (*env_p)->CallStaticVoidMethod(env_p, cls, mid); /* <--- crash!! */

/* --Main.java-- */
class Main {

  public static void test() {

[build instructions (main.c, Main.java in the same folder]

$export LD_LIBRARY_PATH=/usr/lib64/jvm/java/jre/lib/amd64/server/
$gcc main.c -I$JAVA_HOME/include -I$JAVA_HOME/include/linux
-I$JAVA_HOME/include -L$JAVA_HOME/jre/lib/amd64/server/ -ljvm

Configure bugmail: http://icedtea.classpath.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

More information about the distro-pkg-dev mailing list