Segmentation fault when using jni application

Hi I have a segmentation fault whe i use jni with a c++ program, i don't know how to read hs_err_pid....log, can someone help me to analyse this file
# An unexpected error has been detected by HotSpot Virtual Machine:
# SIGSEGV (0xb) at pc=0x9704e824, pid=15092, tid=2983283632
# Java VM: Java HotSpot(TM) Client VM (1.5.0_15-b04 mixed mode, sharing)
# Problematic frame:
# C 0x9704e824
--------------- T H R E A D ---------------
Current thread (0x08379000): JavaThread "Xxxxxxxx main loop #1 (machine)" [_thread_in_native, id=15101]
siginfo:si_signo=11, si_errno=0, si_code=1, si_addr=0x9704e824
Registers:
EAX=0xb1f9c030, EBX=0xb1edafa0, ECX=0x48411fc8, EDX=0x08377218
ESP=0xb1d13bfc, EBP=0xb1d13c18, ESI=0xb1f1020a, EDI=0xb1edc5a8
EIP=0x9704e824, CR2=0x9704e824, EFLAGS=0x00010286
Top of Stack: (sp=0xb1d13bfc)
0xb1d13bfc: b1e78eb5 b1f9c030 48411fc8 b1e78e2b
0xb1d13c0c: b1f9b494 b1d13c50 b0786e50 b1d13c78
0xb1d13c1c: b1f6a332 b0786e50 48411fc8 b1d13c48
0xb1d13c2c: b7bca34c 083790c0 b1d13c40 08410e58
0xb1d13c3c: 00a0b574 b1f9c030 0838b2e0 b074ed18
0xb1d13c4c: b1fca214 b1f9c360 0838b2e0 b072e2d8
0xb1d13c5c: b1fb761c 08373ce8 b1d13c94 b1f6a16f
0xb1d13c6c: b1f9b494 08373c08 00000001 b1d13cc8
Instructions: (pc=0x9704e824)
0x9704e814:
[error occurred during error reporting, step 100, id 0xb]
Stack: [0xb1c94000,0xb1d15000), sp=0xb1d13bfc, free space=510k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C 0x9704e824
C [libxxxxxxxxxx.so.1.6+0x7d332] _ZN10MyApplication12Route4tickEj+0x1ce
C [libxxxxxxxxxx.so.1.6+0x34248] _ZN10MyApplication4Core8workEj+0x34
C [libyyyyyy.so+0x15457] ZN5CCore8mainLoopEP7JNIEnv+0x17f
C [libyyyyyy.so+0x1f299] Java_com_xx_xxxxxxxx_xxxxxxxximpl_jni_JCore_run+0x35
j com.xx.xxxxxxxx.xxxxxxxximpl.jni.JCore.run()V+0
v ~StubRoutines::call_stub
V [libjvm.so+0x17b2bc]
V [libjvm.so+0x28fed8]
V [libjvm.so+0x17ab15]
V [libjvm.so+0x17abae]
V [libjvm.so+0x1f2b15]
V [libjvm.so+0x2f9933]
V [libjvm.so+0x290ae8]
C [libpthread.so.0+0x5371]
Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j com.xx.xxxxxxxx.xxxxxxxximpl.jni.JCore.run()V+0
v ~StubRoutines::call_stub
--------------- P R O C E S S ---------------
Java Threads: ( => current thread )
=>0x08379000 JavaThread "Xxxxxxxx main loop #1 (machine)" [_thread_in_native, id=15101]
0x083634d8 JavaThread "Thread-0" [_thread_in_native, id=15100]
0x080a5c60 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=15098]
0x080a47a8 JavaThread "CompilerThread0" daemon [_thread_blocked, id=15097]
0x080a3850 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=15096]
0x0809dbe8 JavaThread "Finalizer" daemon [_thread_blocked, id=15095]
0x0809bdb8 JavaThread "Reference Handler" daemon [_thread_blocked, id=15094]
0x0805caa0 JavaThread "main" [_thread_in_native, id=15092]
Other Threads:
0x0809a940 VMThread [id=15093]
0x080a71d0 WatcherThread [id=15099]
VM state:not at safepoint (normal execution)
VM Mutex/Monitor currently owned by a thread: None
Heap
def new generation total 576K, used 515K [0x88bc0000, 0x88c60000, 0x890a0000)
eden space 512K, 95% used [0x88bc0000, 0x88c3a560, 0x88c40000)
from space 64K, 40% used [0x88c40000, 0x88c46888, 0x88c50000)
to space 64K, 0% used [0x88c50000, 0x88c50000, 0x88c60000)
tenured generation total 1408K, used 918K [0x890a0000, 0x89200000, 0x8cbc0000)
the space 1408K, 65% used [0x890a0000, 0x89185850, 0x89185a00, 0x89200000)
compacting perm gen total 8192K, used 500K [0x8cbc0000, 0x8d3c0000, 0x90bc0000)
the space 8192K, 6% used [0x8cbc0000, 0x8cc3d110, 0x8cc3d200, 0x8d3c0000)
ro space 8192K, 68% used [0x90bc0000, 0x91142e10, 0x91143000, 0x913c0000)
rw space 12288K, 48% used [0x913c0000, 0x91991640, 0x91991800, 0x91fc0000)
Dynamic libraries:
00113000-00121000 r-xp 00000000 03:01 6292457 /lib/tls/libpthread-2.3.4.so
00121000-00123000 rwxp 0000d000 03:01 6292457 /lib/tls/libpthread-2.3.4.so
00123000-00125000 rwxp 00123000 00:00 0
0022c000-0023b000 r-xp 00000000 03:01 6292459 /lib/libresolv-2.3.4.so
0023b000-0023d000 rwxp 0000f000 03:01 6292459 /lib/libresolv-2.3.4.so
0023d000-0023f000 rwxp 0023d000 00:00 0
002be000-002c5000 r-xp 00000000 03:01 6292458 /lib/libgcc_s-3.4.6-20060404.so.1
002c5000-002c6000 rwxp 00007000 03:01 6292458 /lib/libgcc_s-3.4.6-20060404.so.1
002e8000-003a8000 r-xp 00000000 03:01 10722848 /usr/lib/libstdc++.so.6.0.3
003a8000-003ad000 rwxp 000bf000 03:01 10722848 /usr/lib/libstdc++.so.6.0.3
003ad000-003b3000 rwxp 003ad000 00:00 0
0087d000-0088f000 r-xp 00000000 03:01 6292465 /lib/libnsl-2.3.4.so
0088f000-00891000 rwxp 00011000 03:01 6292465 /lib/libnsl-2.3.4.so
00891000-00893000 rwxp 00891000 00:00 0
00b99000-00bae000 r-xp 00000000 03:01 6292453 /lib/ld-2.3.4.so
00bae000-00baf000 r-xp 00015000 03:01 6292453 /lib/ld-2.3.4.so
00baf000-00bb0000 rwxp 00016000 03:01 6292453 /lib/ld-2.3.4.so
00bb7000-00cdc000 r-xp 00000000 03:01 6292454 /lib/tls/libc-2.3.4.so
00cdc000-00cdd000 r-xp 00124000 03:01 6292454 /lib/tls/libc-2.3.4.so
00cdd000-00ce0000 rwxp 00125000 03:01 6292454 /lib/tls/libc-2.3.4.so
00ce0000-00ce2000 rwxp 00ce0000 00:00 0
00ce4000-00d05000 r-xp 00000000 03:01 6292455 /lib/tls/libm-2.3.4.so
00d05000-00d07000 rwxp 00020000 03:01 6292455 /lib/tls/libm-2.3.4.so
00d09000-00d0b000 r-xp 00000000 03:01 6292456 /lib/libdl-2.3.4.so
00d0b000-00d0d000 rwxp 00001000 03:01 6292456 /lib/libdl-2.3.4.so
08048000-08057000 r-xp 00000000 03:01 11715142 /usr/java/jdk1.5.0_15/bin/java
08057000-08059000 rwxp 0000e000 03:01 11715142 /usr/java/jdk1.5.0_15/bin/java
08059000-086b9000 rwxp 08059000 00:00 0
88bc0000-88c60000 rwxp 88bc0000 00:00 0
88c60000-890a0000 rwxp 88c60000 00:00 0
890a0000-89200000 rwxp 890a0000 00:00 0
89200000-8cbc0000 rwxp 89200000 00:00 0
8cbc0000-8d3c0000 rwxp 8cbc0000 00:00 0
8d3c0000-90bc0000 rwxp 8d3c0000 00:00 0
90bc0000-91143000 r-xs 00001000 03:01 11698348 /usr/java/jdk1.5.0_15/jre/lib/i386/client/classes.jsa
91143000-913c0000 rwxp 91143000 00:00 0
913c0000-91992000 rwxp 00584000 03:01 11698348 /usr/java/jdk1.5.0_15/jre/lib/i386/client/classes.jsa
91992000-91fc0000 rwxp 91992000 00:00 0
91fc0000-92090000 rwxp 00b56000 03:01 11698348 /usr/java/jdk1.5.0_15/jre/lib/i386/client/classes.jsa
92090000-923c0000 rwxp 92090000 00:00 0
923c0000-923c4000 r-xs 00c26000 03:01 11698348 /usr/java/jdk1.5.0_15/jre/lib/i386/client/classes.jsa
923c4000-927c0000 rwxp 923c4000 00:00 0
b0500000-b0521000 rwxp b0500000 00:00 0
b0521000-b0600000 --xp b0521000 00:00 0
b0600000-b0636000 rwxp b0600000 00:00 0
b0636000-b0700000 --xp b0636000 00:00 0
b0700000-b0800000 rwxp b0700000 00:00 0
b0873000-b0874000 --xp b0873000 00:00 0
b0874000-b1c74000 rwxp b0874000 00:00 0
b1c74000-b1c78000 r-xp 00000000 03:01 6291503 /lib/libnss_dns-2.3.4.so
b1c78000-b1c7a000 rwxp 00003000 03:01 6291503 /lib/libnss_dns-2.3.4.so
b1c94000-b1c97000 --xp b1c94000 00:00 0
b1c97000-b1d15000 rwxp b1c97000 00:00 0
b1d15000-b1d1b000 r-xs 00000000 03:01 10748120 /usr/lib/gconv/gconv-modules.cache
b1fcb000-b1fdd000 r-xp 00000000 03:01 11603256 /usr/java/jdk1.5.0_15/jre/lib/i386/libnet.so
b1fdd000-b1fde000 rwxp 00011000 03:01 11603256 /usr/java/jdk1.5.0_15/jre/lib/i386/libnet.so
b1fde000-b1fe1000 --xp b1fde000 00:00 0
b1fe1000-b205f000 rwxp b1fe1000 00:00 0
b2089000-b214f000 r-xs 00000000 03:01 11698359 /usr/java/jdk1.5.0_15/jre/lib/ext/localedata.jar
b214f000-b2152000 r-xs 00000000 03:01 11698358 /usr/java/jdk1.5.0_15/jre/lib/ext/dnsns.jar
b2152000-b217d000 r-xs 00000000 03:01 11698357 /usr/java/jdk1.5.0_15/jre/lib/ext/sunpkcs11.jar
b217d000-b21a4000 r-xs 00000000 03:01 11698356 /usr/java/jdk1.5.0_15/jre/lib/ext/sunjce_provider.jar
b21a4000-b21a5000 --xp b21a4000 00:00 0
b21a5000-b2225000 rwxp b21a5000 00:00 0
b2225000-b2228000 --xp b2225000 00:00 0
b2228000-b22a6000 rwxp b2228000 00:00 0
b22a6000-b22a9000 --xp b22a6000 00:00 0
b22a9000-b2327000 rwxp b22a9000 00:00 0
b2327000-b232a000 --xp b2327000 00:00 0
b232a000-b23a8000 rwxp b232a000 00:00 0
b23a8000-b25a8000 r-xp 00000000 03:01 10717357 /usr/lib/locale/locale-archive
b25a8000-b25ab000 --xp b25a8000 00:00 0
b25ab000-b2629000 rwxp b25ab000 00:00 0
b2629000-b262c000 --xp b2629000 00:00 0
b262c000-b26aa000 rwxp b262c000 00:00 0
b26aa000-b26ab000 --xp b26aa000 00:00 0
b26ab000-b273c000 rwxp b26ab000 00:00 0
b273c000-b2758000 rwxp b273c000 00:00 0
b2758000-b2759000 rwxp b2758000 00:00 0
b2759000-b2776000 rwxp b2759000 00:00 0
b2776000-b2777000 rwxp b2776000 00:00 0
b2777000-b2778000 rwxp b2777000 00:00 0
b2778000-b277a000 rwxp b2778000 00:00 0
b277a000-b2796000 rwxp b277a000 00:00 0
b2796000-b279a000 rwxp b2796000 00:00 0
b279a000-b27b6000 rwxp b279a000 00:00 0
b27b6000-b27c5000 rwxp b27b6000 00:00 0
b27c5000-b2841000 rwxp b27c5000 00:00 0
b2841000-b2941000 rwxp b2841000 00:00 0
b2941000-b4841000 rwxp b2941000 00:00 0
b4841000-b50b0000 r-xs 00000000 03:01 11603318 /usr/java/jdk1.5.0_15/jre/lib/charsets.jar
b50b0000-b50c5000 r-xs 00000000 03:01 11603283 /usr/java/jdk1.5.0_15/jre/lib/jce.jar
b50c5000-b514a000 r-xs 00000000 03:01 11603316 /usr/java/jdk1.5.0_15/jre/lib/jsse.jar
b514a000-b51b3000 rwxp b514a000 00:00 0
b51b3000-b77db000 r-xs 00000000 03:01 11603320 /usr/java/jdk1.5.0_15/jre/lib/rt.jar
b77db000-b77ea000 r-xp 00000000 03:01 11603253 /usr/java/jdk1.5.0_15/jre/lib/i386/libzip.so
b77ea000-b77ec000 rwxp 0000e000 03:01 11603253 /usr/java/jdk1.5.0_15/jre/lib/i386/libzip.so
b77ec000-b780d000 r-xp 00000000 03:01 11603251 /usr/java/jdk1.5.0_15/jre/lib/i386/libjava.so
b780d000-b780f000 rwxp 00020000 03:01 11603251 /usr/java/jdk1.5.0_15/jre/lib/i386/libjava.so
b780f000-b7818000 r-xp 00000000 03:01 6291506 /lib/libnss_files-2.3.4.so
b7818000-b781a000 rwxp 00008000 03:01 6291506 /lib/libnss_files-2.3.4.so
b7820000-b782b000 r-xp 00000000 03:01 11603250 /usr/java/jdk1.5.0_15/jre/lib/i386/libverify.so
b782b000-b782c000 rwxp 0000b000 03:01 11603250 /usr/java/jdk1.5.0_15/jre/lib/i386/libverify.so
b782c000-b7834000 rwxs 00000000 03:01 6619137 /tmp/hsperfdata_myname/15092
b7834000-b783a000 r-xp 00000000 03:01 11603246 /usr/java/jdk1.5.0_15/jre/lib/i386/native_threads/libhpi.so
b783a000-b783b000 rwxp 00006000 03:01 11603246 /usr/java/jdk1.5.0_15/jre/lib/i386/native_threads/libhpi.so
b783b000-b783c000 rwxp b783b000 00:00 0
b783c000-b783d000 r-xp b783c000 00:00 0
b783d000-b7baf000 r-xp 00000000 03:01 11698345 /usr/java/jdk1.5.0_15/jre/lib/i386/client/libjvm.so
b7baf000-b7bcd000 rwxp 00372000 03:01 11698345 /usr/java/jdk1.5.0_15/jre/lib/i386/client/libjvm.so
b7bcd000-b7fe6000 rwxp b7bcd000 00:00 0
bfe00000-bfe03000 --xp bfe00000 00:00 0
bfe03000-c0000000 rwxp bfe03000 00:00 0
ffffe000-fffff000 ---p 00000000 00:00 0
VM Arguments:
jvm_args: -Xcheck:jni -XX:+PrintCompilation
java_command: myapplication
Launcher Type: SUN_STANDARD
Environment Variables:
PATH=/home/myname/XXXXXXXX_PERF/bin:/usr/java/jdk1.5.0_15/bin:/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin:/home/myname/bin
LD_LIBRARY_PATH=/usr/java/jdk1.5.0_15/jre/lib/i386/client:/usr/java/jdk1.5.0_15/jre/lib/i386:/usr/java/jdk1.5.0_15/jre/../lib/i386:/home/myname/XXXXXXXX/lib
SHELL=/bin/bash
DISPLAY=XXX.XXX.X.XXX:0.0
Signal Handlers:
SIGSEGV: [libjvm.so+0x32b740], sa_mask[0]=0x7ffbfeff, sa_flags=0x14000004
SIGBUS: [libjvm.so+0x32b740], sa_mask[0]=0x7ffbfeff, sa_flags=0x14000004
SIGFPE: [libjvm.so+0x28ef10], sa_mask[0]=0x7ffbfeff, sa_flags=0x14000004
SIGPIPE: [libjvm.so+0x28ef10], sa_mask[0]=0x7ffbfeff, sa_flags=0x14000004
SIGILL: [libjvm.so+0x28ef10], sa_mask[0]=0x7ffbfeff, sa_flags=0x14000004
SIGUSR1: SIG_DFL, sa_mask[0]=0x00000000, sa_flags=0x00000000
SIGUSR2: [libjvm.so+0x291360], sa_mask[0]=0x00000000, sa_flags=0x14000004
SIGHUP: [libjvm.so+0x290d90], sa_mask[0]=0x7ffbfeff, sa_flags=0x14000004
SIGINT: [libjvm.so+0x290d90], sa_mask[0]=0x7ffbfeff, sa_flags=0x14000004
SIGQUIT: [libjvm.so+0x290d90], sa_mask[0]=0x7ffbfeff, sa_flags=0x14000004
SIGTERM: [libjvm.so+0x290d90], sa_mask[0]=0x7ffbfeff, sa_flags=0x14000004
--------------- S Y S T E M ---------------
OS:Red Hat Enterprise Linux WS release 4 (Nahant Update 4)
uname:Linux 2.6.9-42.ELsmp #1 SMP Wed Jul 12 23:27:17 EDT 2006 i686
libc:glibc 2.3.4 NPTL 2.3.4
rlimit: STACK 20480k, CORE 0k, NPROC 16375, NOFILE 1024, AS infinity
load average:3.46 1.36 0.50
CPU:total 2 (cores per cpu 1, threads per core 2) family 15 model 4 stepping 1, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ht
Memory: 4k page, physical 1034096k(389000k free), swap 0k(0k free)
vm_info: Java HotSpot(TM) Client VM (1.5.0_15-b04) for linux-x86, built on Feb 9 2008 01:37:00 by java_re with gcc 3.2.1-7a (J2SE release)
Regards
Fr�d�ric

Simple - something is wrong with your C/C++ code.
You have a pointer/memory bug.

Similar Messages

  • Segmentation fault when using snapshot isolation with Berkeley DB 6.1.19 and 5.1.29

    Hello,
    I have been experimenting with snapshot isolation with Berkeley DB, but I find that it frequently triggers a segmentation fault when write transactions are in progress.  The following test program reliably demonstrates the problem in Linux using either 5.1.29 or 6.1.19. 
    https://anl.app.box.com/s/3qq2yiij2676cg3vkgik
    Compilation instructions are at the top of the file.  The test program creates a temporary directory in /tmp, opens a new environment with the DB_MULTIVERSION flag, and spawns 8 threads.  Each thread performs 100 transactional put operations using DB_TXN_SNAPSHOT.  The stack trace when the program crashes generally looks like this:
    Program received signal SIGSEGV, Segmentation fault.
    [Switching to Thread 0x7ffff7483700 (LWP 11871)]
    0x00007ffff795e190 in __memp_fput ()
       from /usr/lib/x86_64-linux-gnu/libdb-5.1.so
    (gdb) where
    #0  0x00007ffff795e190 in __memp_fput ()
       from /usr/lib/x86_64-linux-gnu/libdb-5.1.so
    #1  0x00007ffff7883c30 in __bam_get_root ()
       from /usr/lib/x86_64-linux-gnu/libdb-5.1.so
    #2  0x00007ffff7883dca in __bam_search ()
       from /usr/lib/x86_64-linux-gnu/libdb-5.1.so
    #3  0x00007ffff7870246 in ?? () from /usr/lib/x86_64-linux-gnu/libdb-5.1.so
    #4  0x00007ffff787468f in ?? () from /usr/lib/x86_64-linux-gnu/libdb-5.1.so
    #5  0x00007ffff79099f4 in __dbc_iput ()
       from /usr/lib/x86_64-linux-gnu/libdb-5.1.so
    #6  0x00007ffff7906c10 in __db_put ()
       from /usr/lib/x86_64-linux-gnu/libdb-5.1.so
    #7  0x00007ffff79191eb in __db_put_pp ()
       from /usr/lib/x86_64-linux-gnu/libdb-5.1.so
    #8  0x0000000000400f14 in thread_fn (foo=0x0)
        at ../tests/transactional-osd/bdb-snapshot-write.c:154
    #9  0x00007ffff7bc4182 in start_thread (arg=0x7ffff7483700)
        at pthread_create.c:312
    #10 0x00007ffff757f38d in clone ()
        at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111
    I understand that this test program, with 8 concurrent (and deliberately conflicting) writers, is not an ideal use case for snapshot isolation, but this can be triggered in other scenarios as well.
    You can disable snapshot isolation by toggling the value of the USE_SNAP #define near the top of the source, and the test program then runs fine without it.
    Can someone help me to identify the problem?
    many thanks,
    -Phil

    Hi Phil,
       We have taken a look at this in more detail and there was a bug in the code.   We have fixed the bug.     We will roll it into our next 6.1 release that we do.   If you would like an early patch that will go on top of 6.1.19, please email me at [email protected], reference this forum post and I can get a patch sent out to you.   It will be a .diff file that apply on the source code and then rebuild the library.  Once again thanks for finding the issue, and providing a great test program which tremendously helped in getting this resolved.
    thanks
    mike

  • Nodejs segmentation fault when using npm

    I am using nodejs-0.8.14-1 and v8-3.14.0-1 on Raspberry Pi when I try to npm install a package I get a seg fault
    [root@alarmpi ~]# npm install express
    npm http GET https://registry.npmjs.org/express
    npm http 304 https://registry.npmjs.org/express
    Segmentation fault
    I see this thread: https://bbs.archlinux.org/viewtopic.php?id=151400
    That claims the problem is solved but it does not appear to be fixed for me. Any idea on what I can do to get this working?
    Edit: If I keep on trying (npm install express) like 7 or 8 times it will finally install.
    Last edited by kaptk2 (2012-11-21 03:28:37)

    This seems to have cleared itself up over the long weekend. So I guess this is solved, not sure what is wrong or what fixed it though.

  • Collect causes segmentation fault when profiling L2 data cache misses on T1

    I am attempting to profile L2 data cache misses on a SUN T1000 server, but collect causes a segmentation fault when I choose to profile L2 data cache misses.
    Is it possible to profile L2 data misses on the T1 processor?
    Thanks!
    -John
    A simple hello world application and the failed profiling:
    %] collect -p +on -h ecdm hello
    Segmentation fault
    I compiled with
    CC -xhwcprof -xdebugformat=dwarf -g -03 -o hello hello.c

    No it is not possible to profile L2 cache misses -- the chip does not generate
    interrupts on performance register 0 (only register 1, which is hard-wired
    to instruction count).
    That said, we should not generate a segmentation fault. Exactly
    which version of collect are you using? We did patch Studio 11
    to correctly handle the US-T1, and Studio 12 express also
    correctly handles it.
    Is the SEGV on the collect command, or on the target it launches?
    Marty Itzkowitz,
    Project Lead, Sun Studio Analyzer

  • AV when using JNI

    Hi,
    We have faced a problem that is very similar to the one reported in this thread:
    http://forums.bea.com/bea/message.jspa?messageID=200010160&tstart=0
    Has the problem been fixed in a later release?
    We are using BEA JRockit 5.0 R26.4.0-63 under Windows XP Professional 32-bit SP2 and still get Access Violations when using java.lang.Class.getDeclaredMethods() or java.lang.Class.getDeclaredFields(). The exception does not occur when we use the same module with Sun JVM and MS JVM.
    If the problem is supposed to be fixed, I can provide more details.
    Best regards,
    Alex
    ~~~~~~~~~~~~~~~~~~~~~

    Hello Staffan,
    Thanks for your reply. Here is a description of the first problem we have faced:
    When using JNI to call the java.lang.Class.getDeclaredMethods() or java.lang.Class.getDeclaredFields() method, we get the java.lang.NullPointerException exception in some cases. If we debug the java.exe process in Visual Studio 2005, we can see that the following exception occurs:
    First-chance exception at 0x7d612b73 in java.exe: 0xC0000005: Access violation reading location 0x00000010.
    Here is a part of the exception call stack:
    7d612b73()
    jvm.dll!_stubsCallC2JavaStub() + 0x24 bytes
    jvm.dll!_callC2Java() + 0x309 bytes
    jvm.dll!_jniCheckExceptionsForCall() + 0x12e bytes
    jvm.dll!_jniCallObjectMethodA@16() + 0x3b bytes
    jvm.dll!_jniGetVersion@4() + 0x993 bytes
    tcJavaHook.dll!JNIEnv_::CallObjectMethodA(_jobject * obj=0x34960204, _jmethodID * methodID=0x77b84b08, const jvalue * args=0x00000000)  Line 879 + 0x1f bytes C++
    We have done some investigations and found out that the problem occurs for the following classes:
    java.lang.Class, javax.swing.JPanel, javax.swing.JLayeredPane, javax.swing.JToolBar, javax.swing.AbstractButton, javax.swing.JLabel,
    javax.swing.JScrollPane, javax.swing.JViewport, javax.swing.JTable, javax.swing.CellRendererPane, javax.swing.JScrollBar, javax.swing.table.JTableHeader, javax.swing.JMenuBar, javax.swing.JComboBox, javax.swing.JSpinner, javax.swing.text.JTextComponent
    While the exception does not occur when calling methods of the following classes:
    javax.swing.JFrame, java.awt.Frame, javax.swing.JComponent, javax.swing.JRootPane, java.lang.Object, java.awt.Component, java.awt.Container, java.awt.Window, java.awt.Dialog, javax.swing.JDialog
    We were able to reproduce the problem with Eclipse 3.1.2 launched in the following way:
    I:\Java\jrockit-R26.4.0-jdk1.5.0_06\jre\bin\java.exe -Xms40m -Xmx256m -jar D:\Eclipse\startup.jar -os win32 -ws win32 -arch x86 -launcher D:\Eclipse\eclipse.exe -name Eclipse -showsplash 600 -exitdata 14a8_60 -vm I:\Java\jrockit-R26.4.0-jdk1.5.0_06\jre\bin\java.exe -vmargs -Xms40m -Xmx256m -jar D:\Eclipse\startup.jar
    I:\Java\jrockit-R26.4.0-jdk1.5.0_06\ - the installation folder of JRockit JDK
    D:\Eclipse\ - the root folder of Eclipse
    In this case, even trying to get information about the java.lang.Object class fields and methods causes the problem.
    Can you say anything based on the above call stack?
    Please let me know if you need any details about the problem.
    Best regards,
    Alex
    ~~~~~~~~~~~~~~~~~~~~~

  • Segmentation fault when calling dbms_alert.register() procedure from OCCI

    I am trying to call the dbms_alert.register() from the OCCI but I get segmentation fault when I run the program, here is the code snippet. I am gettin segmentation fault immediately after calling setSQL() method.
    Environment *occiEnvironment_;
    Connection *occiConnection_ ;
    string userName("SCOTT");
    string userPasswd("tiger");
    string url("");
    occiEnvironment_ = Environment::createEnvironment();
    try{
    occiConnection_ = occiEnvironment_->createConnection(userName,userPasswd,url);
    Statement *occiStatement1;
    cout << "Before setSQL" << endl;
    occiStatement1->setSQL("BEGIN dbms_alert.register(:1); END;");
    cout << "After setSQL" << endl;
    string alert1("MY_ALERT");
    occiStatement1->setString(1,alert1);
    occiStatement1->execute();
    catch (SQLException ea)
    cout << ea.what();
    }

    Thanks for the reply, now I dont see segmentation fault.
    I tried to exted the code further to wait for the registered events, I added the following code, I do get and event but then get the exception:
    Statement *occiStatement1 = occiConnection_->createStatement();
    Statement *occiStatement2 = occiConnection_->createStatement();
    string alert, msg;
    int status;
    occiStatement1->setSQL("BEGIN dbms_alert.register(:1); END;");
    string alert1("MY_ALERT");
    occiStatement1->setString(1,alert1);
    occiStatement1->execute();
    occiStatement2->setSQL("BEGIN dbms_alert.waitany(:alert,:msg,:status); END;");
    occiStatement2->registerOutParam(1, OCCICHAR, sizeof(alert));
    occiStatement2->registerOutParam(2, OCCICHAR, sizeof(msg));
    occiStatement2->registerOutParam(3, OCCIINT, sizeof(int));
    occiStatement2->execute();
    ===========================================================
    ORA-06502: PL/SQL: numeric or value error
    ORA-06512: at "SYS.DBMS_ALERT", line 252
    ORA-06512: at line 1
    ORA-06502: PL/SQL: numeric or value error
    ORA-06512: at "SYS.DBMS_ALERT", line 252
    ORA-06512: at line 1
    *** glibc detected *** free(): invalid pointer: 0x08619c48 ***
    Aborted

  • Segmentation Fault when connecting to SQL*Plus from Applications tier

    Hi Everyone -
    I am currently in the process of upgrading a client from 11.5.10.2 to 12.1.1 (eventually 12.1.3) on a OEL x86-64 server. I have laid down the software stack and followed all of the requirements as per the Installation manuals and 761566.1. I also have an open SR right now on this issue - but I wanted to see if any of you have ever run into the issue that I am encountering.
    When I try to run adadmin/adpatch - I get to the prompt of providing the system user password and the utility simply exits. No errors in adpatch.log or adadmin.log (both are 0 bytes in size).
    When I try to connect using SQL*Plus from the applications tier using either:
    sqlplus apps/****@SID
    sqlplus system/****@SID
    I get a Segmentation Fault error. There are also no errors in my alert log file on the database tier. I found this error while attempting to apply the upgrade merge patch.
    Has anyone ever seen s Segmentation Fault error? I have search MOS, found a couple of potential solutions - but nothing has solved the issue so far.
    Thanks in advance...
    Brenna

    >
    Are you on 11.1.0.5.0? Is this the database version?
    No, my database tier is 11.2.0.3 (the database version displayed above was the client version running on the Application Tier.
    Who is the owner of the application tier files? If it is applmgr user, please make sure you login as that user and source the application env file before running sqlplus -- Please issue "echo $ORACLE_HOME" and "which sqlplus" and post the output here.
    My owner of the application tier is oracle. I have sourced the environment using $APPL_TOP/APPSR12Dev1_******.env
    [oracle@****** log]$ echo $ORACLE_HOME
    /u01/app/oracle/R12Dev1/apps/tech_st/10.1.2
    [oracle@****** log]$ which sqlplus
    /u01/app/oracle/R12Dev1/apps/tech_st/10.1.2/bin/sqlplus
    >
    Please relink sqlplus by issuing "$ORACLE_HOME/bin/relink all > relink.txt 2>&1" and check the relink.txt file for any error
    A number of errors occur during the relink, here are some of them:
    /u01/app/oracle/R12Dev1/apps/tech_st/10.1.2/bin/genclntsh
    /usr/bin/ld: warning: i386:x86-64 architecture of input file `/u01/app/oracle/R12Dev1/apps/tech_st/10.1.2/lib/libn10.a(nnfgt.o)' is incompatible with i386 output
    /usr/bin/ld: warning: i386:x86-64 architecture of input file `/u01/app/oracle/R12Dev1/apps/tech_st/10.1.2/lib/libn10.a(ntcontab.o)' is incompatible with i386 output
    /u01/app/oracle/R12Dev1/apps/tech_st/10.1.2/bin/genagtsh /u01/app/oracle/R12Dev1/apps/tech_st/10.1.2/lib/libagtsh.so 1.0
    /usr/bin/ld: warning: i386:x86-64 architecture of input file `/u01/app/oracle/R12Dev1/apps/tech_st/10.1.2/lib/libn10.a(nnfgt.o)' is incompatible with i386 output
    /usr/bin/ld: warning: i386:x86-64 architecture of input file `/u01/app/oracle/R12Dev1/apps/tech_st/10.1.2/lib/libn10.a(ntcontab.o)' is incompatible with i386 output
    /u01/app/oracle/R12Dev1/apps/tech_st/10.1.2/lib/libn10.a(nnfgt.o):(.rodata+0xc8): undefined reference to `nnflboot'
    /u01/app/oracle/R12Dev1/apps/tech_st/10.1.2/lib/libn10.a(ntcontab.o):(.data+0x8): undefined reference to `nttini'
    /u01/app/oracle/R12Dev1/apps/tech_st/10.1.2/lib/libn10.a(ntcontab.o):(.data+0x28): undefined reference to `ntzini'
    /u01/app/oracle/R12Dev1/apps/tech_st/10.1.2/lib/libn10.a(ntcontab.o):(.data+0x68): undefined reference to `ntpini'
    /u01/app/oracle/R12Dev1/apps/tech_st/10.1.2/lib/libn10.a(ntcontab.o):(.data+0x88): undefined reference to `ntusini'
    collect2: ld returned 1 exit status
    Thanks again...

  • Application crashes when using JNI with Jdk 1,2, 1.3 and 1.4

    Hi!
    I have this application that has a GUI written in Java and a file parser written in C. JNI is used to connect these parts together. The problem is that the application only works when I am using jdk 1.1.8 but not when using jdk1.2, jdk1.3 or jdk1.4. I am running the application on a Solaris 8 machine.
    I have not written the application myself but I am going to be working with it from now on. But I have today little knowledge with JNI and I have tried different approaches to solve the problem. For example I have tried to used DDD together with GDB to find out what the problem is but with no luck. When I run the application using jdk1.4 I get the following error when the JVM crashes:
    An unexpected exception has been detected in native code outside the VM.
    Unexpected Signal : 10 occurred at PC=0xFA023164
    Function=Java_Bitmap_setDebug+0x1C
    Library=/usr/u/lal/micview/micview2_1_0_beta1/libBitmapImpl.so
    Current Java thread:
    at Bitmap.setDebug(Native Method)
    at DisplayPanel.loadFile(DisplayPanel.java:396)
    at MicPlot.loadFile(MicPlot.java:1452)
    at MicPlot.loadFile(MicPlot.java:1441)
    at MicPlot.miOpen_Action(MicPlot.java:1267)
    at MicPlot$SymAction.actionPerformed(MicPlot.java:1184)
    at java.awt.MenuItem.processActionEvent(MenuItem.java:588)
    at java.awt.MenuItem.processEvent(MenuItem.java:548)
    at java.awt.MenuComponent.dispatchEventImpl(MenuComponent.java:285)
    at java.awt.MenuComponent.dispatchEvent(MenuComponent.java:273)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:452)
    at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:197)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:144)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:136)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:99)
    Dynamic libraries:
    0x10000 /opt/java/jdk1.4/bin/java
    0xff360000 /usr/lib/libthread.so.1
    0xff3a0000 /usr/lib/libdl.so.1
    0xff280000 /usr/lib/libc.so.1
    0xff270000 /usr/platform/SUNW,Ultra-4/lib/libc_psr.so.1
    0xfe000000 /opt/java/j2sdk1.4.1/jre/lib/sparc/client/libjvm.so
    0xff220000 /usr/lib/libCrun.so.1
    0xff200000 /usr/lib/libsocket.so.1
    0xff100000 /usr/lib/libnsl.so.1
    0xff1d0000 /usr/lib/libm.so.1
    0xff250000 /usr/lib/libw.so.1
    0xff0e0000 /usr/lib/libmp.so.2
    0xff0b0000 /opt/java/j2sdk1.4.1/jre/lib/sparc/native_threads/libhpi.so
    0xff080000 /opt/java/j2sdk1.4.1/jre/lib/sparc/libverify.so
    0xff030000 /opt/java/j2sdk1.4.1/jre/lib/sparc/libjava.so
    0xfe7e0000 /opt/java/j2sdk1.4.1/jre/lib/sparc/libzip.so
    0xfe4e0000 /usr/lib/locale/en_US.ISO8859-1/en_US.ISO8859-1.so.2
    0xedd00000 /opt/java/j2sdk1.4.1/jre/lib/sparc/libawt.so
    0xfc480000 /opt/java/j2sdk1.4.1/jre/lib/sparc/libmlib_image.so
    0xfc410000 /opt/java/j2sdk1.4.1/jre/lib/sparc/motif21/libmawt.so
    0xeda80000 /usr/dt/lib/libXm.so.4
    0xfa090000 /usr/openwin/lib/libXt.so.4
    0xfa3d0000 /usr/openwin/lib/libXext.so.0
    0xfc7e0000 /usr/openwin/lib/libXtst.so.1
    0xed980000 /usr/openwin/lib/libX11.so.4
    0xfa2a0000 /usr/openwin/lib/libdps.so.5
    0xfa3b0000 /usr/openwin/lib/libSM.so.6
    0xfa1d0000 /usr/openwin/lib/libICE.so.6
    0xed880000 /opt/java/j2sdk1.4.1/jre/lib/sparc/libfontmanager.so
    0xfa390000 /usr/openwin/lib/locale/common/xlibi18n.so.2
    0xfa1b0000 /usr/openwin/lib/locale/iso8859-1/xomEuro.so.2
    0xfa190000 /usr/lib//liblayout.so
    0xfa050000 /usr/openwin/lib/locale/common/ximlocal.so.2
    0xfa010000 /usr/u/lal/micview/micview2_1_0_beta1/libBitmapImpl.so
    Local Time = Thu Oct 3 13:32:47 2002
    Elapsed Time = 35
    # The exception above was detected in native code outside the VM
    # Java VM: Java HotSpot(TM) Client VM (1.4.1-beta-b14 mixed mode)
    # An error report file has been saved as hs_err_pid27692.log.
    # Please refer to the file for further information.
    Abort
    From this information I think that the problem should be in the native method setDebug. But I have tried to set a breakpoint at the beginning of that function in the C part but with no luck. The application crashes before it reaches that position in the C file.
    What could possibly go wrong between the setDebug function in the C part and the function call in the Java part?
    When using GDB, GDB cannot figure out what is wrong it just returns a hex address, no function name.
    I would really appreciate some help. I have tried everything that I can come up with!
    Best regards
    Lars

    I have figured out that the application fails on its first call to the native methods.
    So I have this Bitmap class that contains all the native calls and it is defined shortly as follow:
    public class Bitmap {
    static {
    System.loadLibrary("BitmapImpl");
    native void setDebug(int debuglevel, int statistics);
    There are many more native methods defined in Bitmap, but I only show the setDebug method because that is the first one that is executed and also the one that immediately fails.
    My setDebug C function is defined as follow in BitmapImpl.c
    #include <time.h>
    #include <stdio.h>
    #include <limits.h>
    #include <fcntl.h>
    #include <jni.h>
    #include <math.h>
    #include <errno.h>
    #include "Bitmap.h"
    #include "data.h"
    jint debug = 0;
    jint statistics = 1;
    JNIEXPORT void JNICALL Java_Bitmap_setDebug
    (JNIEnv *jenv, jobject jo, jint d, jint s)
    debug = d;
    statistics = s;
    My libBitmapImpl.so file is compiled using the following Makefile and using GNU gcc:
    JAVAPATH=$(JAVAINCLUDEPATH)
    LMACRO=-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DSOLARIS
    CSOURCE=BitmapImpl.c
    all:
    gcc -O3 -G $(LMACRO) -I$(JAVAPATH) -I$(JAVAPATH)/solaris \
    $(CSOURCE) -o libBitmapImpl.so
    It is still a total mystory why the application fails. I have tried it on a RedHat Linux machine and there it works fine. But not on Solaris. Only if I use the jdk1.1.8 but not a later one.
    Would really appreiciate some help!
    Best regards
    Lars

  • App crash when using JNI callbacks

    Hi all,
    I have a solaris application which crashes when I try to callback the JNI methods from the native code. The description of the problem is below
    Written a native library, the library is multithreaded (i.e) I create a thread using pthread_create() in the native code which performs the operation of calling a JAVA method from the native code. The routine of calling the JAVA method works perfectly from elsewhere.
    There are two scenarios I've tested it in
    1. I created a thread (say X) from the main thread (say Y) and made the y to wait until the X is complete using the pthread_join(). The JAVA callbacks work fine when called from Y but the app crashes if done from X.
    2. Did not make the Y to wait until the X is complete, hoping that both will run paralelly and even the the App crashes.
    And to be precise the Y is the thread where the native method is called from JAVA.
    I have tested for any memory leaks or stack corruption by removing the JAVA callbacks and bulding a executable and using purify, the report doesnot hint any such occurances.
    The linker options used for building the shared library is as follows
    ${GPP} ${INC} -G ${LIB} -mt -g -lCstd -lCrun -lpthread ${OBJS} -o <lib-name>
    I wonder if we can create threads in the native code when using JAVA callbacks and even if we can whether it would be appropiate to use the callbacks with in the threads
    Looking forward for any help.
    Regards,
    Vamsi

    Guys... can't any one help me with this problem :(

  • Segmentation fault when enabling replication with SQL API

    Hi,
    I've compiled BDB 5.3.21 on Ubuntu 11.04 (x86) with the following configure options:
    ../dist/configure enable-sql enable-sql_compat enable-debug enable-tcl --with-tcl=/usr/lib
    I was able to follow the Replication Usage Examples given in "Getting Started with the SQL APIs" to set up a set of replicated master/client databases.
    However, after I exited out of the dbsql session that started replication on the master database and re-opened the master database with dbsql, executing "pragma replication_initial_master=ON;" followed by "pragma replication=ON;" led to a segmentation fault. gdb showed that the segmentation fault occurred at:
    dbsql> pragma replication=ON;
    Program received signal SIGSEGV, Segmentation fault.
    0x0032d42b in __env_ref_get (dbenv=0x8056ad8, countp=0xbfffd498)
    at ../src/env/env_region.c:772
    772          renv = infop->primary;
    (gdb) list
    767          REGENV *renv;
    768          REGINFO *infop;
    769     
    770          env = dbenv->env;
    771          infop = env->reginfo;
    772          renv = infop->primary;
    773          *countp = renv->refcnt;
    774          return (0);
    775     }
    776     
    (gdb)
    Does anybody know of a solution to this or could this be a bug? Thanks in advance.
    P.S. here's a stack trace:
    (gdb) bt
    #0 0x0032d42b in __env_ref_get (dbenv=0x8056ad8, countp=0xbfffd498)
    at ../src/env/env_region.c:772
    #1 0x001786fc in hasDatabaseConnections (p=0x8056708)
    at ../lang/sql/generated/sqlite3.c:44420
    #2 0x00178a11 in bdbsqlPragmaStartReplication (pParse=0x80648e0,
    pDb=0x80561cc) at ../lang/sql/generated/sqlite3.c:44533
    #3 0x001797f5 in bdbsqlPragma (pParse=0x80648e0,
    zLeft=0x8062e20 "replication", zRight=0x8062dc0 "ON", iDb=0)
    at ../lang/sql/generated/sqlite3.c:44812
    #4 0x001c215d in sqlite3Pragma (pParse=0x80648e0, pId1=0x8064b60,
    pId2=0x8064b70, pValue=0x8064b90, minusFlag=0)
    at ../lang/sql/generated/sqlite3.c:78941
    #5 0x001e5c83 in yy_reduce (yypParser=0x8064b20, yyruleno=256)
    at ../lang/sql/generated/sqlite3.c:96668
    #6 0x001e6761 in sqlite3Parser (yyp=0x8064b20, yymajor=1, yyminor=...,
    pParse=0x80648e0) at ../lang/sql/generated/sqlite3.c:97051
    #7 0x001e7537 in sqlite3RunParser (pParse=0x80648e0,
    zSql=0x80648b8 "pragma replication=ON;", pzErrMsg=0xbfffdba0)
    at ../lang/sql/generated/sqlite3.c:97877
    #8 0x001c730e in sqlite3Prepare (db=0x8056010,
    zSql=0x80648b8 "pragma replication=ON;", nBytes=-1, saveSqlFlag=1,
    ---Type <return> to continue, or q <return> to quit---
    pReprepare=0x0, ppStmt=0xbfffdc8c, pzTail=0xbfffdc88)
    at ../lang/sql/generated/sqlite3.c:80736
    #9 0x001c7739 in sqlite3LockAndPrepare (db=0x8056010,
    zSql=0x80648b8 "pragma replication=ON;", nBytes=-1, saveSqlFlag=1,
    pOld=0x0, ppStmt=0xbfffdc8c, pzTail=0xbfffdc88)
    at ../lang/sql/generated/sqlite3.c:80828
    #10 0x001c7a5e in sqlite3_prepare_v2 (db=0x8056010,
    zSql=0x80648b8 "pragma replication=ON;", nBytes=-1, ppStmt=0xbfffdc8c,
    pzTail=0xbfffdc88) at ../lang/sql/generated/sqlite3.c:80903
    #11 0x0804baf6 in shell_exec (db=0x8056010,
    zSql=0x80648b8 "pragma replication=ON;",
    xCallback=0x804a3c4 <shell_callback>, pArg=0xbfffde14, pzErrMsg=0xbfffdcfc)
    at ../lang/sql/sqlite/src/shell.c:1092
    #12 0x0805030e in process_input (p=0xbfffde14, in=0x0)
    at ../lang/sql/sqlite/src/shell.c:2515
    #13 0x08051453 in main (argc=2, argv=0xbffff3f4)
    at ../lang/sql/sqlite/src/shell.c:2946
    -Irving
    Edited by: snowcrash on Jan 15, 2013 2:16 PM

    Thank you for reporting this. I have been able to reproduce this crash in-house.
    You need to specify the replication_initial_master and replication pragmas as part of initially creating your SQL database. The replication_initial_master pragma is not used or needed after the initial database creation at the initial master site. The replication=on pragma is a persistent setting that we remember internally the first time you specify it. This means that after specifying replication=on for the first time on a site, we will automatically restart replication for you in future dbsql sessions when we open the underlying Berkeley DB environment.
    This gives you a very simple workaround: don't respecify replication=on when you reenter dbsql.
    Of course, we shouldn't be crashing on an unnecessary pragma. I have added this to our list of fixes to consider for the future.
    Thanks,
    Paula Bingham
    Oracle

  • Segmentation fault when calling gpctr function from matlab mex file

    I am trying to write a simple mex file for square wave generation using counter1 of PCI-6035E. I am using matlab's native compiler to compile and link with the nidaq32 library, ver.6.9.3, with no errors. When the mex function is called from a matlab script, however, the program crashes at the first call, to reset the counter. (I can generate a square wave with the test panel.)

    Sorry for the delay in responding. I got caught up in other stuff. I am attaching my little program as requested. As you can see, I have just wrapped a mexFunction call round the example code for square wave generation. After I posted this, I tracked down a copy of BorlandC++, installed it on my computer and recompiled using that compiler and *b.* libraries. And would you know it, the program works. The question remains, though, why it doesn't work with Matlab's native lcc compiler. Plus, I have limited disk space, so if I can do without BorlandC, I can use the extra room. The runtime error was a Segmentation fault that I traced to the first call to GPCTR_Control.
    Attachments:
    pulsegen.c ‏4 KB

  • I have problem when use 'JNI'

    Hello every body,
    I have an application language "C", which, I must make a wrapper java.
    To do this using "JNI".
    First I try to understand the functioning of JNI, I try it for the first example helloWorld.
    all steps works well, and dynamic library was well create: libHelloWorld.so
    The execution, it does'nt work
    When I try to java Helloworld, here's what I see:
    Exception in thread "main" java.lang.UnsatisfiedLinkError: /home/java/jniexamples/HelloWorld/libHelloWorld.so: Can't load IA 32-bit .so on a IA 32-bit platform
    at java.lang.ClassLoader$NativeLibrary.load(Native Method)
    at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751)
    at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1676)
    at java.lang.Runtime.loadLibrary0(Runtime.java:822)
    at java.lang.System.loadLibrary(System.java:993)
    at HelloWorld.<clinit>(HelloWorld.java:7)
    Although I added the link to my library like this:
    export LD_LIBRARY_PATH = $ LD_LIBRARY_PATH: / home / Install / java / jniexamples / HelloWorld
    I dont understand where is the problem may be in the version I use of java, I use jdk-1.5.0-13?
    Thank you in advance for your help
    Regards
    Daniel

    Exception in thread "main" java.lang.UnsatisfiedLinkError: /home/java/jniexamples/HelloWorld/libHelloWorld.so: Can't load IA 32-bit .so As a guess that would suggest that it found a file (thus the name is correct) but that the contents do not represent a shared library that the VM will load.
    That is usually because the compile/link options are wrong for the target VM.

  • Streamer gives segmentation fault when trying to grab a picture.

    I'm testing streamer to grab output from my web camera.
    Creating video works fine.
    # streamer -q -c /dev/video0 -f rgb24 -r 3 -t 00:30:00 -o outfile.avi
    But grabbing an image, gives segmentation fault.
    # streamer -c /dev/video0 -b 16 -o outfile.jpeg
    files / video: JPEG (JFIF) / audio: none
    Segmentation fault
    I got the commands from http://tldp.org/HOWTO/html_single/Webcam-HOWTO/#COMMAND
    Am I doing something wrong?

    Some extra information: If I run xawtv I get a blank screen but I can take a snapshot by pressing 'j' or by using the remote:
    $ xawtv-remote snap jpeg full picture.jpeg
    This actually gets an image from the camera. When I take a picture or close the xawtv client it briefly flashes an image of what the camera is seeing before returning back to black/closing.
    I also get exactly the same error as on the link above.

  • PCManFM Segmentation fault when trying to open two windows

    Hi
    It seems to be a bug, but I don't know if it's Arch, or upstream related, so first of all I will post here.
    What happens: When trying to open two different windows of the file manager PCManFM, it crashes systematically.
    How to reproduce: Open an terminal, type "pcmanfm"; pcmanfm is now open. Open another terminal, or another tab, type "pcmanfm"; pcmanfm is now closed. Go back to the first term, and you'll see "Segmentation fault"

    ozar wrote:While PCManFM is broken and rather annoying, note that you can open new tabs and windows from within the PCManFM window that already have open.
    Yep, I'm using this function since I noticed that bug but it'll be cool if this problem could be fixed in the near future ^^

  • JVM Crash When Using JNI and COM

    I'm trying to call a DLL compiled from VB6 source code that I do not have access to. The VB6 code simply retrieves data from a DB2 database using ADO and my client code grabs that data and marshals it to my Java code. I'm attempting to achieve this using JNI and COM (without a third-party bridge). It works 75% of the time, but the other 25% of the time, the JVM crashes with the usual Hotspot crash log containing an access violation exception. However, I don't know what in my C++ code (VC++ 8) could be causing this except for passing a "wild" pointer to the code lying underneath the COM object interface. If that is the case, I don't know how I am doing that.
    The Java code that is calling my native method is running on Tomcat 5.5.25 and just to be safe, I am not allowing multiple threads to concurrently call the method in my JNI DLL (though I realize that this will kill performance). Once I can get past this problem, I'll do the COM interfacing on a worker thread in my native code so I don't screw up CoInitialize and CoUninitialize calls in the case the same thread is concurrently executing multiple calls to my native code.
    I've noticed that in most cases, the JVM crashes during my call to the pClsAccount->OpenConnection method. However, my DLL isn't what is listed on the top of the call stack, which is why I suspect the passing of a wild pointer, though I'm just taking a guess at that. Does anyone have an idea as to what's going on ?
    JNIEXPORT jobject JNICALL Java_CustomerInfo_nGetCustomerAccountInfo(JNIEnv *env, jobject customerInfo, jstring accountNumber, jstring iniFileName)
    jboolean isCopy;
    // Account info class and instance to be instantiated
    jclass accountInfoCls = NULL;
    jobject accountInfoObj = NULL;
    // The constructor ID of the accountInfoCls
    jmethodID ctorID = NULL;
    // Pointer to the interface for the ClsAccount COM object
    _clsAccount *pClsAccount = NULL;
    HRESULT hr;
    BSTR bstrIniFileName(L"");
    try
    const char *nativeAccountNumber = NULL;
    if (accountNumber != NULL)
    nativeAccountNumber = env->GetStringUTFChars(accountNumber, &isCopy);
    else
    jclass newExcCls;
    env->ExceptionDescribe();
    env->ExceptionClear();
    newExcCls = env->FindClass("java/lang/IllegalArgumentException");
    env->ThrowNew(newExcCls, "accountNumber passed in was null !");
    return NULL;
    // Initialization
    variantt varConnectionSucceeded = variantt(false);
    variantt varGetAccountInfoSucceeded = variantt(false);
    variantt varAccountNumber = variantt(nativeAccountNumber);
    bstrt bstrLastPaymentDate = bstrt();
    bstrt bstrLastErrorMessage = bstrt();
    bstrt bstrLastErrorNumber = bstrt();
    jlong jTotalDue = NULL;
    jlong jEstablishedDueDay = NULL;
    jlong jLastPaymentAmount = NULL;
    jstring jLastPaymentDate = NULL;
    jstring jLastErrorMessage = NULL;
    jstring jLastErrorNumber = NULL;
    jthrowable jException = NULL;
    const char *chLastPaymentDate = NULL;
    const char *chLastErrorMessage = NULL;
    const char *chLastErrorNumber = NULL;
    long long totalDue;
    long long lastPaymentAmount;
    long establishedDueDateDay;
    //Convert string from Java string to C string to VB string
    const char *nativeIniFileName = NULL;
    if (iniFileName != NULL)
    nativeIniFileName = env->GetStringUTFChars(iniFileName, &isCopy);
    else
    jclass newExcCls;
    env->ExceptionDescribe();
    env->ExceptionClear();
    newExcCls = env->FindClass("java/lang/IllegalArgumentException");
    env->ThrowNew(newExcCls, "iniFileName passed in was null");
    return NULL;
    bstrIniFileName = comutil::ConvertStringToBSTR(nativeIniFileName);
    CoInitialize(NULL);
    // Create an instance of the COClass with the interface over it
    hr = CoCreateInstance(__uuidof(clsAccount), NULL, CLSCTX_INPROC_SERVER, __uuidof(_clsAccount), (void **)&pClsAccount);
    if (hr == S_OK)
    varConnectionSucceeded.boolVal = pClsAccount->OpenConnection(&bstrIniFileName);
    &#12288;
    if (varConnectionSucceeded.boolVal == -1)
    varGetAccountInfoSucceeded.boolVal = pClsAccount->GetAccountPaymentInformation(&(varAccountNumber.GetVARIANT()));
    env->ReleaseStringUTFChars(accountNumber, nativeAccountNumber);
    // Extract all available account information from the ClsAccount object
    if (varGetAccountInfoSucceeded.boolVal == -1)
    totalDue = pClsAccount->TotalDue.int64;
    establishedDueDateDay = pClsAccount->EstablishedDueDateDay;
    lastPaymentAmount = pClsAccount->LastPaymentAmount.int64;
    bstrLastPaymentDate = pClsAccount->LastPaymentDate;
    chLastPaymentDate = comutil::ConvertBSTRToString(bstrLastPaymentDate.GetBSTR());
    jTotalDue = (jlong)totalDue;
    jEstablishedDueDay = (jlong)establishedDueDateDay;
    jLastPaymentAmount = (jlong)lastPaymentAmount;
    jLastPaymentDate = env->NewStringUTF(chLastPaymentDate);
    delete[] chLastPaymentDate;
    pClsAccount->CloseConnection();
    // Populate error fields if any errors occur
    bstrLastErrorMessage = pClsAccount->LastErrMessage;
    chLastErrorMessage = comutil::ConvertBSTRToString(bstrLastErrorMessage.GetBSTR());
    bstrLastErrorNumber = pClsAccount->LastErrNumber;
    chLastErrorNumber = comutil::ConvertBSTRToString(bstrLastErrorNumber.GetBSTR());
    jLastErrorMessage = env->NewStringUTF(chLastErrorMessage);
    jLastErrorNumber = env->NewStringUTF(chLastErrorNumber);
    delete[] chLastErrorMessage;
    delete[] chLastErrorNumber;
    const char* clsName = "com/nuance/merchantsmutual/businessentities/CustomerAccountInfo";
    // Find the Java class and the ID of its constructor
    accountInfoCls = env->FindClass(clsName);
    ctorID = env->GetMethodID(accountInfoCls, "<init>", "(JJJLjava/lang/String;Ljava/lang/String;Ljava/lang/String;)V");
    jException = env->ExceptionOccurred();
    if (jException != NULL)
    env->ExceptionDescribe();
    env->ExceptionClear();
    //Release all resources associated with the ClsAccount instance
    pClsAccount->Release();
    //Instantiate the class with the given parameters
    accountInfoObj = env->NewObject(accountInfoCls, ctorID, jTotalDue, jEstablishedDueDay, jLastPaymentAmount, jLastPaymentDate, jLastErrorMessage, jLastErrorNumber);
    jException = env->ExceptionOccurred();
    if (jException != NULL)
    env->ExceptionDescribe();
    env->ExceptionClear();
    else if (hr == REGDB_E_CLASSNOTREG)
    cout << "COM class not registered" << endl;
    else if ( hr == CLASS_E_NOAGGREGATION)
    cout << "COM class can't be aggregated" << endl;
    else if (hr == E_NOINTERFACE)
    cout << "No interface for COM class clsAccount" << endl;
    else if (hr == E_POINTER)
    cout << "*ppv pointer was NULL !" << endl;
    else
    cout << "Error occurred while creating COM object. HR is [" << hr << "]" << endl;
    // Free the BSTR because a new one was returned with a call to comutil::ConvertStringToBSTR
    SysFreeString(bstrIniFileName);
    // Release the string when it's no longer needed. MUST call if string won't be used
    // anymore or else a memory leak will occur
    env->ReleaseStringUTFChars(iniFileName, nativeIniFileName);
    CoUninitialize();
    &#12288;
    catch (_com_error &e)
    cout << "Encountered an exception in GetCustomerAccountInfo: Error was " << e.ErrorMessage();
    pClsAccount->Release();
    catch (...)
    pClsAccount->Release();
    return accountInfoObj;
    Edited by: Cthulhu76 on Jan 5, 2010 9:18 AM

    0x49202400 JavaThread "ContainerBackgroundProcessor[StandardEngine[Catalina]]" daemon [_thread_blocked, id=5340, stack(0x49bf0000,0x49c40000)]
    0x48a7e800 JavaThread "Thread-1" [_thread_in_native, id=5976, stack(0x48f00000,0x48f50000)]
    0x48a0dc00 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=3072, stack(0x48c60000,0x48cb0000)]
    0x48a09000 JavaThread "CompilerThread0" daemon [_thread_blocked, id=4988, stack(0x48c10000,0x48c60000)]
    0x48a07c00 JavaThread "Attach Listener" daemon [_thread_blocked, id=3124, stack(0x48bc0000,0x48c10000)]
    0x48a07000 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=2572, stack(0x48b70000,0x48bc0000)]
    0x489f5c00 JavaThread "Finalizer" daemon [_thread_blocked, id=5752, stack(0x48b20000,0x48b70000)]
    0x489f4c00 JavaThread "Reference Handler" daemon [_thread_blocked, id=2596, stack(0x48ad0000,0x48b20000)]
    0x003c6000 JavaThread "main" [_thread_in_native, id=4252, stack(0x00820000,0x00870000)]
    Other Threads:
    0x489f0400 VMThread [stack: 0x48a80000,0x48ad0000] [id=5624]
    0x48a18800 WatcherThread [stack: 0x48cb0000,0x48d00000] [id=1192]
    VM state:not at safepoint (normal execution)
    VM Mutex/Monitor currently owned by a thread: None
    Heap
    def new generation total 36288K, used 12762K [0x02940000, 0x050a0000, 0x07800000)
    eden space 32256K, 34% used [0x02940000, 0x0343af58, 0x048c0000)
    from space 4032K, 37% used [0x04cb0000, 0x04e2ba28, 0x050a0000)
    to space 4032K, 0% used [0x048c0000, 0x048c0000, 0x04cb0000)
    tenured generation total 483968K, used 7518K [0x07800000, 0x250a0000, 0x42940000)
    the space 483968K, 1% used [0x07800000, 0x07f57958, 0x07f57a00, 0x250a0000)
    compacting perm gen total 14080K, used 14016K [0x42940000, 0x43700000, 0x46940000)
    the space 14080K, 99% used [0x42940000, 0x436f0320, 0x436f0400, 0x43700000)
    No shared spaces configured.
    Dynamic libraries:
    0x00400000 - 0x0040f000      C:\Program Files\Apache Software Foundation\Tomcat 5.5\bin\tomcat5.exe
    0x7c800000 - 0x7c8c0000      C:\WINDOWS\system32\ntdll.dll
    0x77e40000 - 0x77f42000      C:\WINDOWS\system32\kernel32.dll
    0x77380000 - 0x77411000      C:\WINDOWS\system32\USER32.dll
    0x77c00000 - 0x77c48000      C:\WINDOWS\system32\GDI32.dll
    0x77f50000 - 0x77feb000      C:\WINDOWS\system32\ADVAPI32.dll
    0x77c50000 - 0x77cef000      C:\WINDOWS\system32\RPCRT4.dll
    0x76f50000 - 0x76f63000      C:\WINDOWS\system32\Secur32.dll
    0x77ba0000 - 0x77bfa000      C:\WINDOWS\system32\MSVCRT.dll
    0x7c8d0000 - 0x7d0cf000      C:\WINDOWS\system32\SHELL32.dll
    0x77da0000 - 0x77df2000      C:\WINDOWS\system32\SHLWAPI.dll
    0x76290000 - 0x762ad000      C:\WINDOWS\system32\IMM32.DLL
    0x77420000 - 0x77523000      C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.3790.3959_x-ww_D8713E55\comctl32.dll
    0x6d7c0000 - 0x6da10000      C:\Program Files\Java\jre1.6.0_07\bin\client\jvm.dll
    0x76aa0000 - 0x76acd000      C:\WINDOWS\system32\WINMM.dll
    0x7c340000 - 0x7c396000      C:\WINDOWS\system32\MSVCR71.dll
    0x6d270000 - 0x6d278000      C:\Program Files\Java\jre1.6.0_07\bin\hpi.dll
    0x76b70000 - 0x76b7b000      C:\WINDOWS\system32\PSAPI.DLL
    0x6d770000 - 0x6d77c000      C:\Program Files\Java\jre1.6.0_07\bin\verify.dll
    0x6d310000 - 0x6d32f000      C:\Program Files\Java\jre1.6.0_07\bin\java.dll
    0x6d7b0000 - 0x6d7bf000      C:\Program Files\Java\jre1.6.0_07\bin\zip.dll
    0x6d570000 - 0x6d583000      C:\Program Files\Java\jre1.6.0_07\bin\net.dll
    0x71c00000 - 0x71c17000      C:\WINDOWS\system32\WS2_32.dll
    0x71bf0000 - 0x71bf8000      C:\WINDOWS\system32\WS2HELP.dll
    0x71b20000 - 0x71b61000      C:\WINDOWS\system32\mswsock.dll
    0x5f270000 - 0x5f2ca000      C:\WINDOWS\system32\hnetcfg.dll
    0x71ae0000 - 0x71ae8000      C:\WINDOWS\System32\wshtcpip.dll
    0x76ed0000 - 0x76efa000      C:\WINDOWS\system32\DNSAPI.dll
    0x76f70000 - 0x76f77000      C:\WINDOWS\System32\winrnr.dll
    0x76f10000 - 0x76f3e000      C:\WINDOWS\system32\WLDAP32.dll
    0x76f80000 - 0x76f85000      C:\WINDOWS\system32\rasadhlp.dll
    0x4a6a0000 - 0x4a6ac000      C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\MMI\WEB-INF\lib\CustomerInfoProxy.dll
    0x77670000 - 0x777a9000      C:\WINDOWS\system32\ole32.dll
    0x77d00000 - 0x77d8b000      C:\WINDOWS\system32\OLEAUT32.dll
    0x7c420000 - 0x7c4a7000      C:\WINDOWS\WinSxS\x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.4053_x-ww_E6967989\MSVCP80.dll
    0x78130000 - 0x781cb000      C:\WINDOWS\WinSxS\x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.4053_x-ww_E6967989\MSVCR80.dll
    0x777b0000 - 0x77833000      C:\WINDOWS\system32\CLBCatQ.DLL
    0x77010000 - 0x770d6000      C:\WINDOWS\system32\COMRes.dll
    0x77b90000 - 0x77b98000      C:\WINDOWS\system32\VERSION.dll
    0x75da0000 - 0x75e5d000      C:\WINDOWS\system32\SXS.DLL
    0x75e60000 - 0x75e87000      C:\WINDOWS\system32\apphelp.dll
    0x4dc30000 - 0x4dc5e000      C:\WINDOWS\system32\msctfime.ime
    0x4b0d0000 - 0x4b395000      C:\WINDOWS\system32\xpsp2res.dll
    0x71bb0000 - 0x71bb9000      C:\WINDOWS\system32\WSOCK32.dll
    0x4bbe0000 - 0x4bbea000      C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\MMI\WEB-INF\lib\ClearTranProxy.dll
    0x745e0000 - 0x7489e000      C:\WINDOWS\system32\msi.dll
    0x71c40000 - 0x71c97000      C:\WINDOWS\system32\NETAPI32.dll
    0x4bc50000 - 0x4bc6c000      C:\WINDOWS\system32\DBNETLIB.DLL
    0x71f60000 - 0x71f64000      C:\WINDOWS\system32\security.dll
    0x76c90000 - 0x76cb7000      C:\WINDOWS\system32\msv1_0.dll
    0x76cf0000 - 0x76d0a000      C:\WINDOWS\system32\iphlpapi.dll
    0x761b0000 - 0x76243000      C:\WINDOWS\system32\crypt32.dll
    0x76190000 - 0x761a2000      C:\WINDOWS\system32\MSASN1.dll
    0x4bcf0000 - 0x4bcff000      C:\Program Files\Common Files\System\Ole DB\SQLOLEDB.RLL
    0x4a8a0000 - 0x4a8aa000      C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\MMI\WEB-INF\lib\MIGI.DLL
    0x73570000 - 0x736c2000      C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\MMI\WEB-INF\lib\MSVBVM60.DLL
    0x4a950000 - 0x4a9e2000      C:\Program Files\Common Files\System\ado\msado15.dll
    0x74a50000 - 0x74a6a000      C:\WINDOWS\system32\MSDART.DLL
    0x4c850000 - 0x4c8c9000      C:\Program Files\Common Files\System\Ole DB\oledb32.dll
    0x4dbb0000 - 0x4dbc1000      C:\Program Files\Common Files\System\Ole DB\OLEDB32R.DLL
    VM Arguments:
    jvm_args: -Dcatalina.home=C:\Program Files\Apache Software Foundation\Tomcat 5.5 -Dcatalina.base=C:\Program Files\Apache Software Foundation\Tomcat 5.5 -Djava.endorsed.dirs=C:\Program Files\Apache Software Foundation\Tomcat 5.5\common\endorsed -Djava.io.tmpdir=C:\Program Files\Apache Software Foundation\Tomcat 5.5\temp -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.util.logging.config.file=C:\Program Files\Apache Software Foundation\Tomcat 5.5\conf\logging.properties -Djava.library.path=C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\MMI\WEB-INF\lib vfprintf -Xms512m -Xmx1024m
    java_command: <unknown>
    Launcher Type: generic
    Environment Variables:
    JAVA_HOME=C:\Program Files\Java\jdk1.6.0_07
    [error occurred during error reporting (printing environment variables), id 0xc0000005]
    --------------- S Y S T E M ---------------
    OS: Windows Server 2003 family Build 3790 Service Pack 2
    CPU:total 4 (4 cores per cpu, 1 threads per core) family 6 model 7 stepping 6, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3
    Memory: 4k page, physical 2097151k(2097151k free), swap 4194303k(4194303k free)
    vm_info: Java HotSpot(TM) Client VM (10.0-b23) for windows-x86 JRE (1.6.0_07-b06), built on Jun 10 2008 01:14:11 by "java_re" with MS VC++ 7.1
    time: Mon Dec 28 15:24:00 2009
    elapsed time: 600 seconds

Maybe you are looking for

  • Module pool programming..

    hi Gurus, while working on module pool, i am facing little problem when we execute it through t-code se51. sometime it shows 'restricted logic and complete logic'. but it doesn't appear sometime. what is the exact problem ? is there any problem with

  • Table for field  MATNR

    i am using MD61 Transaction. when i am pressing  F1 on the field Material it is giving Technical name PBPT-MATNR. PBPT is a structure. How can i get table name for this MATNR. similary for RM60X-PLN01 . how can i get for PLN01 from which table.

  • Skipping disabled step in GAF

    Hello All, I am disabling a main step in a GAF FPM at runtime by calling method IF_FPM_GAF->enable_mainstep in the OVERRIDE_EVENT_GAF method of interface IF_FPM_GAF_CONF_EXIT. However, the step is still being called when it is reached. Moreover, the

  • Order of applications

    Let me suppose that I am opening three 'Finder' and one 'Safari' on my MAC PC  and these applications are in the following order on the screen: Finder1, Finder2, Safari, Finder3 In this situation, if I delete Finder3, which is in front on the screen,

  • Unlockable file - The nightmare scenario

    For some months now I've been trying to delete a folder containing an application (FWIW "Classic Menu"), but without success. The folder icon shows that it's locked, as are the files within it (and the files within the application "package"). The Get