Solaris/JVM/JNI crashes

Hello,
I am experiencing periodic crashes in an application while using Solaris 2.8 and JVM 1.3.0. The application is invoking multi-threaded java code from C++ and the conflict causing the crashes seems to be in how the threads are being handled. Is anybody aware of problems using Solaris 2.8 with JVM 1.3 for this purpose?
Thanks.

By the way that presumes that your JNI code is actually robust (either long time use or extensive testin/profiling) to rule out a problem with it. If not then the problem is probably with the JNI code and has nothing to do with java.

Similar Messages

  • Segmentation Fault on Solaris JVM

    Hi,
    We have a Java application that executes all 'C' code through JNI code.
    It works fine on NT but on solaris, the JVM suddenly crashes with a
    segmentation fault. The crashes are random. We did a lot of debugging to ensure that the JVM doesn't crash when we are in the 'C' code.
    We are using jdk1.4.0-b92. Any ideas?
    Here's the stack trace from gdb:
    Program received signal SIGSEGV, Segmentation fault.
    0xfa535000 in ?? ()
    (gdb) bt
    #0 0xfa535000 in ?? ()
    #1 0xfa53908c in ?? ()
    #2 0xfa538f50 in ?? ()
    #3 0xfa534480 in ?? ()
    #4 0xfa52d560 in ?? ()
    #5 0xfa405c54 in ?? ()
    #6 0xfa405b88 in ?? ()
    #7 0xfa405da8 in ?? ()
    #8 0xfa405da8 in ?? ()
    #9 0xfa405da8 in ?? ()
    #10 0xfa400440 in ?? ()
    #11 0xfe0fd9ac in __1cJJavaCallsLcall_helper6FpnJJavaValue_pnMmethodHandle_pnRJavaCallArguments_pnGThread__v_ ()
    #12 0xfe10f644 in __1cJJavaCallsMcall_virtual6FpnJJavaValue_nLKlassHandle_nMsymbolHandle_4pnRJavaCallArguments_pnGThread__v_ ()
    #13 0xfe10f4a4 in __1cJJavaCallsMcall_virtual6FpnJJavaValue_nGHandle_nLKlassHandle_nMsymbolHandle_5pnGThread__v_ ()
    #14 0xfe10f42c in __1cMthread_entry6FpnKJavaThread_pnGThread__v_ ()
    #15 0xfe10f13c in __1cKJavaThreadDrun6M_v_ ()
    #16 0xfe0fc284 in _start ()

    I had same segmentation fault and found out some char array variable's value length is over the size of char array variable. After fixed it, then it doesn't have that segmentation fault.
    In Solaris, when I use java JFileChooser to select a file, the file path usually including a lot of "../" which causes a path over 200 char long. When I assigned that path to a char array variable which only have 200 char length, the segmentation fault happened.

  • Frequent JVM freeze/crash

    From time to time our system freezes (can be after days or hours).
    We have been running on 1.5.0_04 and 1.5.0_05 both client and server (on x86 machine).
    We have a lot of file IO and other JNI (custom) calls.
    We've been trying many thing to get it going again...
    One thing (killing of the external JNI related tasks) sometimes causes the JVM to crash (not every time - sometimes it actually gets going again - and sometimes it just keeps on freezing).
    All crash logs say the same:
    EXCEPTION_ACCESS_VIOLATION (0xc0000005)
    Which isn't the most descriptive message :-(
    The stack trace (when running in client mode) is as follows:
    C 0x080c45f6 (differs from occurence to occourence)
    V [jvm.dll+0x11d08a]
    V [jvm.dll+0x11d22a]
    V [jvm.dll+0x11cfbf]
    C [MSVCRT.dll+0x2a3b0]
    C [kernel32.dll+0xb50b]
    Every thread is threadblocked, except "main" which is threadin_native.
    The active thread is the VMThread.
    Does anybody have a clue to what the problem could be, or how to debug the jvm.dll (at least just to find out what the calls referenced in the stacktrace are)?

    Did you try JCopnsole to inspect the running JVM?
    You need to start the server with
    -Dcom.sun.management.jmxremote
    -Dcom.sun.management.jmxremote.port=998
    -Dcom.sun.management.jmxremote.authenticate=false
    -Dcom.sun.management.jmxremote.ssl=falseto be able to connect to a remote JVM.
    With JConsole you can inspect all running threads if they are blocked and who they are waiting for. You might find the cause of your freezes there ...
    If this doesn't help, use your application log (hope, your application uses some kind of logging like Java logging or Log4J ...) to inject more log messages at the suspicious classes/methods. This way you will find more infos in your log when the app freezes again.

  • About JVM got crash after every 3 hours.

    I am working on a web-application in which i am using tomcat web-server 4.2 and jdk 1.6. i have got memory problems.
    when i starts tomcat server many clients gets login and then memrory used by java process goes on increase continously, it reachs around 3GB and then JVM got crash. i am using JNI bcoz backend for my project is c-database, so i have to allocates lots of memrory in JNI also. so where is actually memory problem comes, in JNI memrory or in Java (JVM) memrory. looking for your positive reply.
    Thanks
    Vishal Andre.

    See, for example http://java.sun.com/docs/hotspot/gc1.4.2/example.html for how to turn on the appropriate flags for diagnosing Java garbage collection problems, and what to look for. That document was written for JDK-1.4.2, but the flags and techniques still apply in later JVM's.
    If you are leaking, or mangling, native memory from your native C libraries, then looking at the Java GC output won't help. Posting any error messages you get would help people help you diagnose the problem.

  • How to register and unregister Mbean server when jvm is crashed.

    Hi All,
    how to register and unregister Mbean server when jvm is crashed with specifying like internal error(xxxxxxxxxxxsome number)
    I am getting error NameAlreadyBindExcetion when i call the below method in my program, how to unregister and register again, can any one can help on this topic?
    internalConnectorService.start();
    regards
    Prasad.Nadendla

    Looks like your server object is already bound and registered and your trying to re-register the same...
    is that a corba server? if yes, you'd be able to check that with the NamingService tools

  • File comparaison works on win32 JVM, not on 64bit solaris JVM

    Hi all!
    I have the following code comparing 2 files. It works on win2000 but doesnt work on unix solaris. (same JVM version)
    win32 JVM is 32 bit, solaris JVM 64 bit
    private boolean fichierIdentiqueBytePourByte( InputStream in1, InputStream in2 ) throws IOException{
              int a = 0, b = 0;
              while(true){
                // read next byte from both stream
                a = in1.read();
                b = in2.read();
                // if its different then files are different and we are done
                if (a!=b) return false;
                // if both are at eof then all checked must be the same
                if (a==-1&&b==-1) return true;
                // if either are at eof then they are different sizes
                if (a==-1||b==-1) return false;
         }any ideas of what the problem might be?
    Thanks

    Presumably when you say it didn't work you mean that in one case it returned true and in the other it returned false.
    If something else then you need to explain what it is.
    Naturally one obvious source of the problem is that in fact the files are not the same on the 64 bit machine. For example they were transferred using ftp and one was transferred using ftp text and other via ftp binary. Then the lengths would be different.
    Another possibility is that you are not running the code that you think you are.
    If the files are very large then it is possible there is some difference there.

  • Solaris JVM question

    Hi,
    I am a newbie on Solaris and have found that there is a significant degredation in performance when my java application is run on a Solaris JVM as opposed to a Windows JVM.
    I'm running with the -server option which has helped, but was wondering if there is some other tuning that I could do in order to make the HotSpot JVM as fast as possible.
    Thanks,
    Tom

    Check your JVM settings, they make a lot of difference to the performance. It also depends on the load you have on the system. Windows does not do as well when compared with Sun when there is a high load.

  • EAS- [JRockit] ERROR: The JVM has crashed

    Hi Experts,
    EAS crashed with error-
    !!!Setting HBR appname to : HBR:HBRAPP
    [JRockit] ERROR: The JVM has crashed. Writing crash information to..........*.dump
    Error Message: Illegal memory access. [54]
    Signal info : si_signo=11, si_code=128 si_addr=(nil)
    Version : Oracle JRockit(R) R28.0.2-11-135406-1.6.0_20-20100624-2119-linux-x86_64
    Please suggest .
    Regards
    Kumar
    Edited by: Kumar 1 on Nov 17, 2012 10:32 PM

    Thanks John for the help.
    I see load on server is normal and activities are also seems regular (not unusual).
    I found Doc @ metalink; Please I would like your view as your advice which is inavaluable.
    Doc "JRockit JVM Crash - R28.0.1 with "Illegal memory access" error message (Doc ID 1295504.1)"
    If not then what need to monitor closely???
    Regards
    Kumar

  • JVM getting crashed

    Hi!
    I have an application where i serialize the object and write it to a file using objectOutputStream .I use "showOpenDialog()" of fileChoser.But when my code tries to access th UI Manager or open the file Dialog,The JVM sometimes crashes and the log file it creates throws error saying :
    An unexpected error has been detected by HotSpot Virtual Machine:
    # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x0333490d, pid=1112, tid=3852
    # Java VM: Java HotSpot(TM) Client VM (1.4.2_12-b03 mixed mode)
    # Problematic frame:
    # C [fontmanager.dll+0x3490d]
    If some one can elaborate on what to do for this,would be helpful and lot many other things are printed in the log file.I would provide the details if required to understand the problem.

    The cause is that fontmanager.dll crashes whenever it opens a bad font file.
    So you have to get rid of all your corrupt font files.
    This is a bug in java 1.4. and it seems that the fonts which are creating the bug are all from the same source: @ 1991 Digital Typeface Corp.
    Here you can find some solutions posted by java developers/users (see comments, at the bottom of page from this link):
    http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4762039

  • JVM 1.3.1_06 Solaris 8 (sparc) multiple jvm's crash at the same time

    Hi All,
    I had multiple jvms crash all at the same time today morning, i was wondering if anyone had any similar issues with 1.3.1_06:
    Only a few jvms left an hs_errpid.log: here is the one with the most info:
    An unexpected exception has been detected in native code outside the VM.
    Unexpected Signal : 10 occurred at PC=0xff02f8f8
    Function name=VerifyClassCodes
    Library=/www/gmgwh/weblogic/jdk/j2sdk1_3_1_06/jre/lib/sparc/libjava.so
    Current Java thread:
    at java.lang.Shutdown.halt(Native Method)
    at java.lang.Shutdown.exit(Shutdown.java:209)
    at java.lang.Terminator$1.handle(Terminator.java:33)
    at sun.misc.Signal$1.run(Signal.java:193)
    at java.lang.Thread.run(Thread.java:479)
    Dynamic libraries:
    0x10000 /www/gmgwh/weblogic/jdk/j2sdk1_3_1_06/jre/bin/../bin/sparc/native_threads/java
    0xff350000 /usr/lib/libthread.so.1
    0xff340000 /usr/lib/libdl.so.1
    0xff200000 /usr/lib/libc.so.1
    0xff330000 /usr/platform/SUNW,Ultra-Enterprise/lib/libc_psr.so.1
    0xfe400000 /www/gmgwh/weblogic/jdk/j2sdk1_3_1_06/jre/lib/sparc/hotspot/libjvm.so
    0xff2d0000 /usr/lib/libCrun.so.1
    0xff1e0000 /usr/lib/libsocket.so.1
    0xff100000 /usr/lib/libnsl.so.1
    0xff0d0000 /usr/lib/libm.so.1
    0xff1c0000 /usr/lib/libmp.so.2
    0xff090000 /www/gmgwh/weblogic/jdk/j2sdk1_3_1_06/jre/lib/sparc/native_threads/libhpi.so
    0xff060000 /www/gmgwh/weblogic/jdk/j2sdk1_3_1_06/jre/lib/sparc/libverify.so
    0xff020000 /www/gmgwh/weblogic/jdk/j2sdk1_3_1_06/jre/lib/sparc/libjava.so
    0xfe7d0000 /www/gmgwh/weblogic/jdk/j2sdk1_3_1_06/jre/lib/sparc/libzip.so
    0xfe3e0000 /usr/lib/locale/en_US.ISO8859-1/en_US.ISO8859-1.so.2
    0xfe390000 /www/gmgwh/weblogic/jdk/j2sdk1_3_1_06/jre/lib/sparc/libnet.so
    0xfe230000 /usr/lib/nss_files.so.1
    0xfe160000 /www/gmgwh/weblogic/6.1/sp4/lib/solaris/libmuxer.so
    0xfd0e0000 /usr/ucblib/libucb.so.1
    0xfd090000 /usr/lib/libresolv.so.2
    0xfd050000 /usr/lib/libelf.so.1
    0xfafd0000 /app/oracle/product/8.1.7.4/lib/libocijdbc8.so
    0xe1800000 /app/oracle/product/8.1.7.4/lib/libclntsh.so.8.0
    0xfafb0000 /app/oracle/product/8.1.7.4/lib/libwtc8.so
    0xfaf90000 /usr/lib/libsched.so.1
    0xfaee0000 /usr/lib/libaio.so.1
    Local Time = Wed Jan 19 09:09:31 2005
    Elapsed Time = 22367
    # The exception above was detected in native code outside the VM
    # Java VM: Java HotSpot(TM) Client VM (1.3.1_06-b01 mixed mode)
    #

    hi there
    i would direct my efforts to search for the culprit on who generated the signal (either a INT, TERM or HUP). The crash occurred is just but another side-effect. The VM received a shutdown signal and shld exit. Just that while exiting, it crashed.
    There is this bug
    http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4904881
    Which is pretty rare. I am not sure if you are encountering this bug but if u have a core, a pstack of the core should show > 2 threads with doing the signal shutdown.

  • Using Intel's MKL C++ Library in JNI causes JVM to Crash at GC

    We're using JDK 1.6.0_07 on RedHat 4 (32-bit) and RedHat 5 (32-bit JVM on 64-bit processor). Our app uses JNI to access Intel's Math Kernel Library (MKL) for optimized algorithms; however, it crashes in libjvm.so/libpthread.so in the GC thread once the garbage collector runs (usually pretty quick).
    The MKL library uses it's own threading model built on pthreads. So, the basic flow goes like this:
    A Java GUI spawns a separate thread to:
    1) Call native method to initialize settings and allocate buffers
    2) Call native method to load data (using mapped buffers)
    3) Call native method to process data
    4) Call native method to unload data back into mapped buffers
    It seems like the MKL threading model (parallel processing) is causing issues with the JVM. Is there a safe way to call a MT native method? BTW, the native code never calls back into Java.

    Crashes normally indicate
    1. A problem with pointers in your code
    2. Incorrect usage of the library that you are calling (which cause a problem with pointers.)
    3. Incorrect usage of JNI.
    C/C++ pointer problem can cause failure much latter than the actual point where the error occurred. Much later in this case would be the garbage collector.
    Might or might not help....as far as I can recall, a recent thread had a gc problem because the JNI code was constructing java objects incorrectly.

  • JNI crash sockets

    I am trying to write a Java library around a piece of hardware that currently does not support Java. As the first part of the task, I need to establish a TCP/IP connection between a client and server. I wrote some test code in C that is very simple socket code that can be found on tons of example sites (yes I know Java has built in classes for this, but the connection must exist in the native side).
    I wrapped everything into a simple ConnectToServer and ConnectToClient functions (everything is hardcoded, so no parameters are passed) in a .so and can establish and run the connection without a hitch in a C++ program that loads the .so. When I load the .so and try to call the functions in a Java harness, the JVM crashes with a SIGSEGV in the server side during the accept call (the client does establish the connection, so it must be crashing somewhere pretty far into the accept( ) call). I have verified this crash by building and running the debug version of hotspot in gdb.
    Im running Red Hat Enterprise Linux Server release 6.1 (Santiago) and Java VM: Java HotSpot(TM) 64-Bit Server VM (21.0-b17 mixed mode linux-amd64 compressed oops).
    Am I not allowed to call native library functions that have system calls in them during JNI, or am I missing something else that is not immediately obvious?

    jschell wrote:
    891860 wrote:
    I am trying to write a Java library around a piece of hardware that currently does not support Java. As the first part of the task, I need to establish a TCP/IP connection between a client and server. I wrote some test code in C that is very simple socket code that can be found on tons of example sites (yes I know Java has built in classes for this, but the connection must exist in the native side).Only reason I can think of for that would be because you need to pass the socket to your C code.
    So given that.
    1. Write C code that creates the socket
    2. Write an API in C that uses 1 to call the library.
    3. Test 1 and 2 via C code.
    After step 3 is complete you do the following.
    A. Determine the business functionality that your java application needs to access via the library. This step does not involve code at all. No C. No java.
    B. Write an API in C that implements the functionality determined in step A. And it will use code from 1/2 as well as needed.
    C. Write code in C to test B.
    After you have completed step 3 and step C then you write JNI and Java.Yes, the case is that the library that Im using for this device is in C, and requires a C socket. I did pretty much the steps that you mentioned. I wrote the basic network code. I wrapped it. Then I wrote a C program to load the .so and test it. It worked fine. When I added the JNI wrapper and Java code to launch it, that is when I had the problems.
    I removed everything but the basic TCP IP code (literally the wrapper that goes into JNI is just the TCP connection code). It still crashed. I then replaced the TCP IP code with another example I found on the net. Same issue. :(
    Edited by: 891860 on 17-Oct-2011 15:55

  • JVM.dll crash in 1.4.2_07

    hi,
    Platform : windows 2000 server
    JVM: 1.4.2_07
    Once in a while my program is crashing. The code is a C++ program that invokes Java methods via JNI. However, at the time of the crash, it is not making any JNI calls.
    The crash dump shows the following stack for the thread in question:
    Exception number: c0000005 (access violation)
    0x113fc07
    jvm!JVM_RegisterUnsafeMethods+0x6fc2
    jvm!JVM_RegisterUnsafeMethods+0x716a
    jvm!JVM_RegisterUnsafeMethods+0x6ed3
    msvcrt+0x2b530
    kernel32!BaseThreadStart+0x34
    I guess my question is - when is JVM_RegisterUnsafeMethods called by the JVM? And what would cause it to crash.
    Thanks.
    Ash

    You need to actually write your own FocusTraversalPolicy class.
    It's actually pretty easy - just subclass FocusTraversalPolicy and override all the methods. You need to have your own algorithm for determining the next/first/last/etc components and after a short look at your code my guess would be to hold a reference to each component on your form in an array in the order you want the focus to move in and then you can easily return the "next" or "previous" component by looking up the array.
    Some of the methods can call others - e.g. getDefaultComponent, getFirstComponent, and getInitialComponent usually all return the same value.
    Regards,
    Tim

  • Solaris JVM Process Growth

    Hi,
    I am investigating a problem where we experience continual growth of our JVM process. The overall process size and native heap size of the JVM process continually grow at the same rate. I am monitoring these using the commands 'ps - o pid,vsz,rss' and 'pmap -x' respectively. The increases are in multiples of 8Kb.
    I have checked our java application using Optimizeit and it is not leaking memory. I have also monitored the size of the VM java heap using the '-verbose:gc' garbage collection debugging option. Garbage collection appears normal and the VM heap size remains below that specified by the '-Xmx' option.
    It appears that the memory growth is occurring in native code of the JVM process but I am at a loss on how to determine what is causing this. Can anyone advise me what may be causing this JVM process growth or ways in which I may be able to find this out?
    I am using JRE 1.4.2 SE (1.4.2_08_b03) on Solaris 8. Within the JVM we are running our web app in Tomcat 4.1.
    The shared libraries loaded by the JVM (as shown by pldd) are:
    /usr/lib/libthread.so.1
    /usr/lib/libdl.so.1
    /usr/lib/libc.so.1
    /usr/platform/sun4u/lib/libc_psr.so.1
    /vob/ntg-thirdparty/java/j2sdk1.4.2_08/jre/lib/sparc/client/libjvm.so
    /usr/lib/libCrun.so.1
    /usr/lib/libsocket.so.1
    /usr/lib/libnsl.so.1
    /usr/lib/libm.so.1
    /usr/lib/libsched.so.1
    /usr/lib/libmp.so.2
    /vob/ntg-thirdparty/java/j2sdk1.4.2_08/jre/lib/sparc/native_threads/libhpi.so
    /vob/ntg-thirdparty/java/j2sdk1.4.2_08/jre/lib/sparc/libverify.so
    /vob/ntg-thirdparty/java/j2sdk1.4.2_08/jre/lib/sparc/libjava.so
    /vob/ntg-thirdparty/java/j2sdk1.4.2_08/jre/lib/sparc/libzip.so
    /vob/ntg-thirdparty/java/j2sdk1.4.2_08/jre/lib/sparc/libjdwp.so
    /vob/ntg-thirdparty/java/j2sdk1.4.2_08/jre/lib/sparc/libdt_socket.so
    /usr/lib/nss_files.so.1
    /vob/ntg-thirdparty/java/j2sdk1.4.2_08/jre/lib/sparc/libnet.so
    /vob/ntg-thirdparty/tibco/rv-7.1/sol28/lib/libtibrvj.so
    /vob/ntg-thirdparty/tibco/rv-7.1/sol28/lib/libtibrvcmq.so
    /vob/ntg-thirdparty/tibco/rv-7.1/sol28/lib/libtibrvcm.so
    /vob/ntg-thirdparty/tibco/rv-7.1/sol28/lib/libtibrvft.so
    /vob/ntg-thirdparty/tibco/rv-7.1/sol28/lib/libtibrv.so
    /usr/lib/libpthread.so.1
    /vob/ntg-thirdparty/java/j2sdk1.4.2_08/jre/lib/sparc/libnio.so
    /usr/lib/librt.so.1
    /usr/lib/libaio.so.1
    /usr/lib/libsendfile.so.1
    /vob/ntg/dev/resources/lib/sol8gcc/libjavaperljni.so
    /vob/ntg/dev/thirdparty/perl-5.8.0-gcc-thread/lib/libperl.so
    /usr/lib/libw.so.1
    /vob/ntg/dev/resources/lib/sol8gcc/libstdc++.so.2.10.0
    /vob/ntg-thirdparty/java/j2sdk1.4.2_08/jre/lib/sparc/libioser12.so
    /vob/ntg-thirdparty/java/j2sdk1.4.2_08/jre/lib/sparc/libawt.so
    /vob/ntg-thirdparty/java/j2sdk1.4.2_08/jre/lib/sparc/libmlib_image.so
    /vob/ntg-thirdparty/java/j2sdk1.4.2_08/jre/lib/sparc/headless/libmawt.so
    /vob/ntg-thirdparty/java/j2sdk1.4.2_08/jre/lib/sparc/libcmm.so
    /vob/ntg-thirdparty/java/j2sdk1.4.2_08/jre/lib/sparc/libfontmanager.so
    /vob/ntg-thirdparty/java/j2sdk1.4.2_08/jre/lib/sparc/libdcpr.so
    /vob/ntg-thirdparty/java/j2sdk1.4.2_08/jre/lib/sparc/libjpeg.so
    Any Help is much appreciated.

    Hi
    If u can, use 1.4.2_10 (latest as of now). There is a bug 6250517, fixed in _09. Not sure if u r making any calls to NetworkInterface.getNetworkInterfaces.
    Also noticed that you are using tibco. How about putting -Xcheck:jni and see if it picks up anything.
    Unfortunately Solaris 8 didnt have libumem for tracking memory allocation. If u have any Solaris 9/10 boxes, you can use libumem to track it down.
    http://access1.sun.com/techarticles/libumem.html

  • JNI Crashes at the Runtime

    Hello everybody,
    I'm newbie at community, but I'm not so noob in Java programming.
    At first, I tried a lot of solutions for this problem, but nothing did work. Now, I hope we can work together to solve that.
    Ok, here we go. I'll explain the problem:
    I'm trying to integrate a native library written in C++ with Java. First I tried to use JNA because the user API is easiest then JNI. But the program crashes during the runtime. Here is the log file:
    xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    # An unexpected error has been detected by HotSpot Virtual Machine:
    # SIGSEGV (0xb) at pc=0xb7f3ef15, pid=6847, tid=3085961424
    # Java VM: Java HotSpot(TM) Client VM (1.4.2_18-b06 mixed mode)
    # Problematic frame:
    # C [libc.so.6+0x3df15] IOvfprintf+0x35
    --------------- T H R E A D ---------------
    Current thread (0x08057bd8): JavaThread "main" [_thread_in_native, id=6847]
    siginfo:si_signo=11, si_errno=0, si_code=1, si_addr=0x00000046
    Registers:
    EAX=0xb7f008d0, EBX=0xb803fff4, ECX=0x00000000, EDX=0x0000000d
    ESP=0xbfe90610, EBP=0xbfe90c2c, ESI=0x081318c8, EDI=0xffffffc8
    EIP=0xb7f3ef15, CR2=0x00000046, EFLAGS=0x00210282
    Top of Stack: (sp=0xbfe90610)
    0xbfe90610: ffffffc0 00000345 00200034 00280007
    0xbfe90620: b7f008d0 b7f40f74 00000000 00000000
    0xbfe90630: 00000000 000e4d1c 000e4d1c b7f008d0
    0xbfe90640: bfe90b90 00000001 000e5830 bfe90cc0
    0xbfe90650: ffffffff 000042a0 0000a108 00000006
    0xbfe90660: 00001000 00000002 000e8998 000e8998
    0xbfe90670: 000e8998 000000f8 000000f8 00000006
    0xbfe90680: 00000004 00000007 00000000 ffffffff
    Instructions: (pc=0xb7f3ef15)
    0xb7f3ef05: ff 8b bb cc ff ff ff 8b 14 38 89 95 94 fa ff ff
    0xb7f3ef15: 80 79 46 00 0f 84 31 26 00 00 8b 45 08 8b 30 f7
    Stack: [0xbfca2000,0xbfe94000), sp=0xbfe90610, free space=1977k
    Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
    C [libc.so.6+0x3df15] IOvfprintf+0x35
    C [libc.so.6+0x47c1f] IOfprintf+0x1f
    C [VenusLib.so+0xa92b] _ZN8CVv5404U10SaveConfigEv+0x7d
    C [VenusLib.so+0xa9ca] _ZN8CVv5404UD0Ev+0x32
    C [VenusLib.so+0x33fd] DestroyISensor+0xb9
    C [libNBioBSP.so+0x1423c] _Z13FreeSensorDllPP7ISensorPPv+0x52
    C [libNBioBSP.so+0x2a8e7] Z11OpenDevicetPP7ISensorPPvPNS_18tagDeviceInfoParamEPKc+0x38f
    C [libNBioBSP.so+0x20dc4] _ZN8CNBioBSP10OpenDeviceEt+0x94
    C [libNBioBSP.so+0x1bc19] NBioAPI_OpenDevice+0x3f
    C [libHBioBSP.so+0xa20] HBioAPI_OpenDevice+0x40
    C [jna29140.tmp+0x108db] ffi_call_SYSV+0x17
    C [jna29140.tmp+0x105b9] ffi_call+0x92
    C [jna29140.tmp+0x3b81]
    C [jna29140.tmp+0x43e1] Java_com_sun_jna_Function_invokeInt+0x43
    j com.sun.jna.Function.invokeInt(I[Ljava/lang/Object;)I+0
    j com.sun.jna.Function.invoke([Ljava/lang/Object;Ljava/lang/Class;)Ljava/lang/Object;+203
    j com.sun.jna.Function.invoke(Ljava/lang/Class;[Ljava/lang/Object;Ljava/util/Map;)Ljava/lang/Object;+194
    j com.sun.jna.Library$Handler.invoke(Ljava/lang/Object;Ljava/lang/reflect/Method;[Ljava/lang/Object;)Ljava/lang/Object;+344
    j $Proxy0.HBioAPI_OpenDevice(I)S+23
    j henry.classes.HBioBSPModule.abrirDispositivo()S+15
    j jnaenbspnitgensdkv1.Main.main([Ljava/lang/String;)V+52
    v ~StubRoutines::call_stub
    V [libjvm.so+0x1b1824]
    V [libjvm.so+0x267379]
    V [libjvm.so+0x1b1a76]
    V [libjvm.so+0x1b9d3e]
    V [libjvm.so+0x1c890d]
    C [java+0x1880]
    C [libc.so.6+0x165f5] __libc_start_main+0xe5
    Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
    j com.sun.jna.Function.invokeInt(I[Ljava/lang/Object;)I+0
    j com.sun.jna.Function.invoke([Ljava/lang/Object;Ljava/lang/Class;)Ljava/lang/Object;+203
    j com.sun.jna.Function.invoke(Ljava/lang/Class;[Ljava/lang/Object;Ljava/util/Map;)Ljava/lang/Object;+194
    j com.sun.jna.Library$Handler.invoke(Ljava/lang/Object;Ljava/lang/reflect/Method;[Ljava/lang/Object;)Ljava/lang/Object;+344
    j $Proxy0.HBioAPI_OpenDevice(I)S+23
    j henry.classes.HBioBSPModule.abrirDispositivo()S+15
    j jnaenbspnitgensdkv1.Main.main([Ljava/lang/String;)V+52
    v ~StubRoutines::call_stub
    --------------- P R O C E S S ---------------
    Java Threads: ( => current thread )
    0x080a4b08 JavaThread "CompilerThread0" daemon [_thread_blocked, id=6853]
    0x080a3cd8 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=6852]
    0x0808faa8 JavaThread "Finalizer" daemon [_thread_blocked, id=6850]
    0x0808e000 JavaThread "Reference Handler" daemon [_thread_blocked, id=6849]
    =>0x08057bd8 JavaThread "main" [_thread_in_native, id=6847]
    Other Threads:
    0x0808cd50 VMThread [id=6848]
    0x080a6538 WatcherThread [id=6854]
    VM state:not at safepoint (normal execution)
    VM Mutex/Monitor currently owned by a thread: None
    Heap
    def new generation total 576K, used 340K [0xab890000, 0xab930000, 0xabd70000)
    eden space 512K, 53% used [0xab890000, 0xab8d5120, 0xab910000)
    from space 64K, 100% used [0xab920000, 0xab930000, 0xab930000)
    to space 64K, 0% used [0xab910000, 0xab910000, 0xab920000)
    tenured generation total 1408K, used 50K [0xabd70000, 0xabed0000, 0xaf890000)
    the space 1408K, 3% used [0xabd70000, 0xabd7cb28, 0xabd7cc00, 0xabed0000)
    compacting perm gen total 4096K, used 1600K [0xaf890000, 0xafc90000, 0xb3890000)
    the space 4096K, 39% used [0xaf890000, 0xafa200e8, 0xafa20200, 0xafc90000)
    Dynamic libraries:
    08048000-08053000 r-xp 00000000 08:06 108586 /opt/java-sdk/j2sdk1.4.2_18/bin/java
    08053000-08055000 rwxp 0000a000 08:06 108586 /opt/java-sdk/j2sdk1.4.2_18/bin/java
    08055000-0815f000 rwxp 08055000 00:00 0 [heap]
    aadfc000-aaf16000 rwxp aadfc000 00:00 0
    aaf16000-aaffb000 r-xp 00000000 08:06 360409 /usr/lib/libstdc++.so.6.0.10
    aaffb000-aafff000 r-xp 000e5000 08:06 360409 /usr/lib/libstdc++.so.6.0.10
    aafff000-ab000000 rwxp 000e9000 08:06 360409 /usr/lib/libstdc++.so.6.0.10
    ab000000-ab006000 rwxp ab000000 00:00 0
    ab01d000-ab029000 r-xp 00000000 08:06 468130 /lib/libgcc_s.so.1
    ab029000-ab02a000 r-xp 0000b000 08:06 468130 /lib/libgcc_s.so.1
    ab02a000-ab02b000 rwxp 0000c000 08:06 468130 /lib/libgcc_s.so.1
    ab02b000-ab0e3000 r-xp 00000000 08:06 446430 /usr/lib/libstdc++.so.5.0.7
    ab0e3000-ab0e4000 r-xp 000b8000 08:06 446430 /usr/lib/libstdc++.so.5.0.7
    ab0e4000-ab0e8000 rwxp 000b9000 08:06 446430 /usr/lib/libstdc++.so.5.0.7
    ab0e8000-ab0ed000 rwxp ab0e8000 00:00 0
    ab0ed000-ab16b000 r-xp 00000000 08:06 468121 /lib/libNBioBSP.so
    ab16b000-ab174000 rwxp 0007e000 08:06 468121 /lib/libNBioBSP.so
    ab174000-ab17b000 rwxp ab174000 00:00 0
    ab182000-ab191000 r-xp 00000000 08:06 468087 /lib/VenusLib.so
    ab191000-ab192000 rwxp 0000f000 08:06 468087 /lib/VenusLib.so
    ab192000-ab193000 r-xp 00000000 08:06 463826 /usr/lib/libHBioBSP.so
    ab193000-ab194000 r-xp 00000000 08:06 463826 /usr/lib/libHBioBSP.so
    ab194000-ab195000 rwxp 00001000 08:06 463826 /usr/lib/libHBioBSP.so
    ab195000-ab1a8000 r-xp 00000000 08:06 519772 /tmp/jna29140.tmp
    ab1a8000-ab1a9000 r-xp 00012000 08:06 519772 /tmp/jna29140.tmp
    ab1a9000-ab1aa000 rwxp 00013000 08:06 519772 /tmp/jna29140.tmp
    ab1aa000-ab1b8000 r-xs 00000000 08:06 21586 /opt/java-lib/jna-3/linux-i386.jar
    ab1b8000-ab1e0000 r-xs 00000000 08:06 20837 /opt/java-lib/jna-3/jna.jar
    ab1e0000-ab1ed000 r-xs 00000000 08:06 108661 /opt/java-sdk/j2sdk1.4.2_18/jre/lib/ext/ldapsec.jar
    ab1ed000-ab209000 r-xs 00000000 08:06 108659 /opt/java-sdk/j2sdk1.4.2_18/jre/lib/ext/sunjce_provider.jar
    ab209000-ab2c7000 r-xs 00000000 08:06 108662 /opt/java-sdk/j2sdk1.4.2_18/jre/lib/ext/localedata.jar
    ab2c7000-ab2ca000 r-xs 00000000 08:06 108660 /opt/java-sdk/j2sdk1.4.2_18/jre/lib/ext/dnsns.jar
    ab2ca000-ab2cb000 ---p ab2ca000 00:00 0
    ab2cb000-ab34b000 rwxp ab2cb000 00:00 0
    ab34b000-ab34c000 ---p ab34b000 00:00 0
    ab34c000-ab359000 rwxp ab34c000 00:00 0
    ab359000-ab35c000 ---p ab359000 00:00 0
    ab35c000-ab54c000 rwxp ab35c000 00:00 0
    ab54c000-ab54d000 ---p ab54c000 00:00 0
    ab54d000-ab55a000 rwxp ab54d000 00:00 0
    ab55a000-ab55d000 ---p ab55a000 00:00 0
    ab55d000-ab5cd000 rwxp ab55d000 00:00 0
    ab5cd000-ab5ce000 ---p ab5cd000 00:00 0
    ab5ce000-ab64e000 rwxp ab5ce000 00:00 0
    ab64e000-ab68d000 r-xp 00000000 08:06 492489 /usr/lib/locale/pt_BR.utf8/LC_CTYPE
    ab68d000-ab68e000 ---p ab68d000 00:00 0
    ab68e000-ab69b000 rwxp ab68e000 00:00 0
    ab69b000-ab69e000 ---p ab69b000 00:00 0
    ab69e000-ab70e000 rwxp ab69e000 00:00 0
    ab70e000-ab70f000 ---p ab70e000 00:00 0
    ab70f000-ab71c000 rwxp ab70f000 00:00 0
    ab71c000-ab71f000 ---p ab71c000 00:00 0
    ab71f000-ab78f000 rwxp ab71f000 00:00 0
    ab78f000-ab790000 ---p ab78f000 00:00 0
    ab790000-ab813000 rwxp ab790000 00:00 0
    ab813000-ab831000 rwxp ab813000 00:00 0
    ab831000-ab832000 rwxp ab831000 00:00 0
    ab832000-ab84f000 rwxp ab832000 00:00 0
    ab84f000-ab850000 rwxp ab84f000 00:00 0
    ab850000-ab851000 rwxp ab850000 00:00 0
    ab851000-ab853000 rwxp ab851000 00:00 0
    ab853000-ab86f000 rwxp ab853000 00:00 0
    ab86f000-ab871000 rwxp ab86f000 00:00 0
    ab871000-ab88f000 rwxp ab871000 00:00 0
    ab88f000-ab930000 rwxp ab88f000 00:00 0
    ab930000-abd70000 rwxp ab930000 00:00 0
    abd70000-abed0000 rwxp abd70000 00:00 0
    abed0000-af890000 rwxp abed0000 00:00 0
    af890000-afc90000 rwxp af890000 00:00 0
    afc90000-b3890000 rwxp afc90000 00:00 0
    b3892000-b38bd000 rwxp b3892000 00:00 0
    b38bd000-b393a000 rwxp b38bd000 00:00 0
    b393a000-b39c2000 rwxp b393a000 00:00 0
    b39c2000-b593a000 rwxp b39c2000 00:00 0
    b593a000-b5f0f000 r-xs 00000000 08:06 108725 /opt/java-sdk/j2sdk1.4.2_18/jre/lib/charsets.jar
    b5f0f000-b5f21000 r-xs 00000000 08:06 108717 /opt/java-sdk/j2sdk1.4.2_18/jre/lib/jce.jar
    b5f21000-b5ffe000 r-xs 00000000 08:06 108746 /opt/java-sdk/j2sdk1.4.2_18/jre/lib/jsse.jar
    b5ffe000-b6014000 r-xs 00000000 08:06 108727 /opt/java-sdk/j2sdk1.4.2_18/jre/lib/sunrsasign.jar
    b6014000-b605e000 rwxp b6014000 00:00 0
    b605e000-b7a1a000 r-xs 00000000 08:06 108716 /opt/java-sdk/j2sdk1.4.2_18/jre/lib/rt.jar
    b7a1a000-b7a28000 r-xp 00000000 08:06 115020 /opt/java-sdk/j2sdk1.4.2_18/jre/lib/i386/libzip.so
    b7a28000-b7a2a000 rwxp 0000d000 08:06 115020 /opt/java-sdk/j2sdk1.4.2_18/jre/lib/i386/libzip.so
    b7a2a000-b7a46000 r-xp 00000000 08:06 115023 /opt/java-sdk/j2sdk1.4.2_18/jre/lib/i386/libjava.so
    b7a46000-b7a48000 rwxp 0001b000 08:06 115023 /opt/java-sdk/j2sdk1.4.2_18/jre/lib/i386/libjava.so
    b7a48000-b7a51000 r-xp 00000000 08:06 467991 /lib/libnss_files-2.8.so
    b7a51000-b7a52000 r-xp 00008000 08:06 467991 /lib/libnss_files-2.8.so
    b7a52000-b7a53000 rwxp 00009000 08:06 467991 /lib/libnss_files-2.8.so
    b7a53000-b7a5b000 r-xp 00000000 08:06 467977 /lib/libnss_nis-2.8.so
    b7a5b000-b7a5c000 r-xp 00007000 08:06 467977 /lib/libnss_nis-2.8.so
    b7a5c000-b7a5d000 rwxp 00008000 08:06 467977 /lib/libnss_nis-2.8.so
    b7a5e000-b7a65000 r-xs 00000000 08:06 360525 /usr/lib/gconv/gconv-modules.cache
    b7a65000-b7a72000 r-xp 00000000 08:06 115005 /opt/java-sdk/j2sdk1.4.2_18/jre/lib/i386/libverify.so
    b7a72000-b7a74000 rwxp 0000c000 08:06 115005 /opt/java-sdk/j2sdk1.4.2_18/jre/lib/i386/libverify.so
    b7a74000-b7a98000 r-xp 00000000 08:06 467990 /lib/libm-2.8.so
    b7a98000-b7a99000 r-xp 00023000 08:06 467990 /lib/libm-2.8.so
    b7a99000-b7a9a000 rwxp 00024000 08:06 467990 /lib/libm-2.8.so
    b7a9a000-b7aad000 r-xp 00000000 08:06 468200 /lib/libnsl-2.8.so
    b7aad000-b7aae000 r-xp 00012000 08:06 468200 /lib/libnsl-2.8.so
    b7aae000-b7aaf000 rwxp 00013000 08:06 468200 /lib/libnsl-2.8.so
    b7aaf000-b7ab1000 rwxp b7aaf000 00:00 0
    b7ab1000-b7ecf000 r-xp 00000000 08:06 115001 /opt/java-sdk/j2sdk1.4.2_18/jre/lib/i386/client/libjvm.so
    b7ecf000-b7eeb000 rwxp 0041d000 08:06 115001 /opt/java-sdk/j2sdk1.4.2_18/jre/lib/i386/client/libjvm.so
    b7eeb000-b7f01000 rwxp b7eeb000 00:00 0
    b7f01000-b803e000 r-xp 00000000 08:06 467979 /lib/libc-2.8.so
    b803e000-b8040000 r-xp 0013d000 08:06 467979 /lib/libc-2.8.so
    b8040000-b8041000 rwxp 0013f000 08:06 467979 /lib/libc-2.8.so
    b8041000-b8044000 rwxp b8041000 00:00 0
    b8044000-b8046000 r-xp 00000000 08:06 467985 /lib/libdl-2.8.so
    b8046000-b8047000 r-xp 00001000 08:06 467985 /lib/libdl-2.8.so
    b8047000-b8048000 rwxp 00002000 08:06 467985 /lib/libdl-2.8.so
    b8048000-b805c000 r-xp 00000000 08:06 468133 /lib/libpthread-2.8.so
    b805c000-b805d000 r-xp 00013000 08:06 468133 /lib/libpthread-2.8.so
    b805d000-b805e000 rwxp 00014000 08:06 468133 /lib/libpthread-2.8.so
    b805e000-b8060000 rwxp b805e000 00:00 0
    b8062000-b8066000 rwxs 00000000 08:06 552405 /tmp/hsperfdata_jborges/6847
    b8066000-b806d000 r-xp 00000000 08:06 467942 /lib/libnss_compat-2.8.so
    b806d000-b806e000 r-xp 00006000 08:06 467942 /lib/libnss_compat-2.8.so
    b806e000-b806f000 rwxp 00007000 08:06 467942 /lib/libnss_compat-2.8.so
    b806f000-b8075000 r-xp 00000000 08:06 115026 /opt/java-sdk/j2sdk1.4.2_18/jre/lib/i386/native_threads/libhpi.so
    b8075000-b8077000 rwxp 00005000 08:06 115026 /opt/java-sdk/j2sdk1.4.2_18/jre/lib/i386/native_threads/libhpi.so
    b8077000-b8078000 rwxp b8077000 00:00 0
    b8078000-b8093000 r-xp 00000000 08:06 468320 /lib/ld-2.8.so
    b8093000-b8094000 r-xp 0001a000 08:06 468320 /lib/ld-2.8.so
    b8094000-b8095000 rwxp 0001b000 08:06 468320 /lib/ld-2.8.so
    bfc98000-bfca2000 rwxp bfc98000 00:00 0
    bfca2000-bfca5000 ---p bfca2000 00:00 0
    bfe80000-bfe95000 rwxp bffeb000 00:00 0 [stack]
    ffffe000-fffff000 r-xp 00000000 00:00 0 [vdso]
    VM Arguments:
    java_command: jnaenbspnitgensdkv1.Main
    Launcher Type: SUN_STANDARD
    Environment Variables:
    JAVA_HOME=/usr/lib/jvm/jre
    JRE_HOME=/usr/lib/jvm/jre
    PATH=/opt/kde3/bin:/home/jborges/bin:/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/X11R6/bin:/usr/games:/usr/lib/jvm/jre/bin:/usr/lib/mit/bin:/usr/lib/mit/sbin:/usr/lib/qt3/bin
    LD_LIBRARY_PATH=/opt/java-sdk/j2sdk1.4.2_18/jre/lib/i386/client:/opt/java-sdk/j2sdk1.4.2_18/jre/lib/i386:/opt/java-sdk/j2sdk1.4.2_18/jre/../lib/i386:/opt/java-sdk/jdk1.6.0_07/jre/lib/i386/client:/opt/java-sdk/jdk1.6.0_07/jre/lib/i386:/opt/java-sdk/jdk1.6.0_07/jre/../lib/i386
    SHELL=/bin/bash
    DISPLAY=:0.0
    HOSTTYPE=i386
    OSTYPE=linux
    MACHTYPE=i686-suse-linux
    --------------- S Y S T E M ---------------
    OS:openSUSE 11.0 (i586)
    VERSION = 11.0
    uname:Linux 2.6.25.11-0.1-pae #1 SMP 2008-07-13 20:48:28 +0200 i686
    libc:glibc 2.8 NPTL 2.8
    rlimit: STACK 8192k, CORE 0k, NPROC 7677, NOFILE 8192, AS 1386000k
    load average:93490094150470077220126720.00 3606846966761539820743723613461780200924650763268597725005162661671931552496146641583441222935396377935628714291211382611843028547896026403367449273839563203090546838260603705542944542680411726151680.00 21221869192944998738009783234686122942367469160885032855155084356764147413706813705551872.00
    CPU:total 2 family 15, cmov, cx8, fxsr, mmx, sse, sse2
    Memory: 4k page, physical 969472k(12108k free), swap 763016k(762984k free)
    vm_info: Java HotSpot(TM) Client VM (1.4.2_18-b06) for linux-x86, built on May 28 2008 00:05:38 by unknown with unknown compiler
    xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    Let me explain more..
    After some tests I decided to use Java SDK 1.4 for this application. As you can see it was run in HotSpot Client VM 1.4.2_18. The OS is openSUSE 11.0 (kernel 2.6.25.11) and the System C Library is compatible with libc.so.6 (glibc) "the new one".
    Here are the native modules I'm trying to integrate with Java:
    VenusLib.so => It's the driver for the USB device I have to use in my application.
    libNBioBSP.so => It's the SDK written in C++ (compiled and compatible with GNU 3.x) that access the driver functionality.
    NOTE 1: I can't access driver's methods directly. It's made by the SDK.
    NOTE 2: The driver and the SDK are compatible with old libc.so.5 but I'm not sure about the compatibility with libc.so.6.
    I tested the SDK functionality with C++. I wrote a simple application and compiled using GNU 3.2. It worked very well.
    After that, I created a JNA interface to invoke the SDK methods but the program crash when I try to access the USB device.
    Here is a part of the JNA interface:
    public interface BSPModuleInterface extends Library {
        /* NBioAPI_Init
         * NBioAPI_RETURN NBioAPI_Init(
         *      OUT NBioAPI_HANDLE_PTR phHandle);
        public int NBioAPI_Init(IntByReference phBSP);
        /* NBioAPI_GetVersion
         * NBioAPI_RETURN NBioAPI_GetVersion(
         *      IN NBioAPI_HANDLE hHandle,
         *      OUT NBioAPI_VERSION_PTR pVersion);
        public int NBioAPI_GetVersion(int hHandle, Structure pVersion);
        /* NBioAPI_GetInitInfo
         * NBioAPI_RETURN NBioAPI_GetInitInfo(
         *      IN NBioAPI_HANDLE hHandle,
         *      IN NBioAPI_UINT8 nStructureType,
         *      OUT NBioAPI_INIT_INFO_PTR pInitInfo);
        public int NBioAPI_GetInitInfo(int hHandle, int nStructureType, Structure pInitInfo);
        /* NBioAPI_SetInitInfo
         * NBioAPI_RETURN NBioAPI_SetInitInfo(
         *      IN NBioAPI_HANDLE hHandle,
         *      IN NBioAPI_UINT8 nStructureType,
         *      OUT NBioAPI_INIT_INFO_PTR pInitInfo);
        public int NBioAPI_SetInitInfo(int hHandle, int nStructureType, Structure pInitInfo);
        /* NBioAPI_OpenDevice
         * NBioAPI_RETURN NBioAPI_OpenDevice(
         *      IN NBioAPI_HANDLE hHandle,
         *      IN NBioAPI_DEVICE_ID nDeviceID);
        public int NBioAPI_OpenDevice(int hHandle, int nDeviceID);
        /* NBioAPI_CloseDevice
         * NBioAPI_RETURN NBioAPI_CloseDevice(
         *      IN NBioAPI_HANDLE             hHandle,
         *      IN NBioAPI_DEVICE_ID          nDeviceID);
        public int NBioAPI_CloseDevice(int hHandle, short nDeviceID);
        public void NBioAPI_Enroll();
        public void NBioAPI_Verify();
        /* NBioAPI_EnumerateDevice
         * NBioAPI_RETURN NBioAPI_EnumerateDevice (
         *      IN NBioAPI_HANDLE hHandle,
         *      OUT NBioAPI_UINT32* pNumDevice,
         *      OUT NBioAPI_DEVICE_ID** ppDeviceID);
         public int NBioAPI_EnumerateDevice(int hHandle, IntByReference pNumDevice, PointerByReference ppDeviceID);
        /* NBioAPI_GetDeviceInfo
         *      NBioAPI_RETURN NBioAPI_GetDeviceInfo(
         *      IN NBioAPI_HANDLE hHandle,
         *      IN NBioAPI_DEV ICE_ID nDeviceID,
         *      IN NBioAPI_UINT8 nStructureType,
         *      OUT NBioAPI_DEVICE_INFO_PTR pDeviceInfo);
         public int NBioAPI_GetDeviceInfo(int hHandle, short nDeviceID, int StructureType, Structure pDeviceInfo);
         /* NBioAPI_SetDeviceInfo
          * NBioAPI_RETURN NBioAPI_SetDeviceInfo(
          *     IN NBioAPI_HANDLE hHandle,
          *     IN NBioAPI_DEVICE_ID nDeviceID,
          *     IN NBioAPI_UINT8 nStructureType,
          *     IN NBioAPI_DEVICE_INFO_PTR pDeviceInfo);
         public int NBioAPI_SetDeviceInfo(int hHandle, short nDeviceID, int nStructureType, Structure pDeviceInfo);
        /* NBioAPI_Terminate
         * NBioAPI_RETURN NBioAPI_Terminate(
         *      IN NBioAPI_HANDLE hHandle);
        public int NBioAPI_Terminate(int hHandle);
        /* NBioAPI_GetOpenedDeviceID
         * NBioAPI_DEVICE_ID NBioAPI NBioAPI_GetOpenedDeviceID(
         *      IN NBioAPI_HANDLE hHandle);
        public short NBioAPI_GetOpenedDeviceID(int hHandle);
    }Some of methods worked fine. But all methods that access the device crashes at the runtime.
    Well, it's not a topic about JNA so I will not give more details. After literally crashes my own head I decided to "down-ground" and use JNI to invoke the SDK methods.
    At first I created a simple class to test listed below:
    * To change this template, choose Tools | Templates
    * and open the template in the editor.
    package henry.hbiobsp.jni;
    * @author jborges
    public class HBioBSPModule {
        public native boolean HBioAPI_Init(int phHandle);
        public native boolean HBioAPI_Terminate(int hHandle);
        public native short HBioAPI_OpenDevice(int hHandle);   
        public native boolean HBioAPI_CloseDevice(int hHandle, short nDeviceID);
        static {
            System.loadLibrary("HBioBSP");
    }Using javah I generated the header file HBioBSP.h:
    /* DO NOT EDIT THIS FILE - it is machine generated */
    #include <jni.h>
    /* Header for class HBioBSP */
    #ifndef _Included_HBioBSP
    #define _Included_HBioBSP
    #ifdef __cplusplus
    extern "C" {
    #endif
    * Class:     HBioBSP
    * Method:    Init
    * Signature: ()I
    JNIEXPORT jint JNICALL Java_HBioBSP_Init
      (JNIEnv *, jobject);
    * Class:     HBioBSP
    * Method:    Terminate
    * Signature: (I)Z
    JNIEXPORT jboolean JNICALL Java_HBioBSP_Terminate
      (JNIEnv *, jobject, jint);
    * Class:     HBioBSP
    * Method:    OpenDevice
    * Signature: (I)S
    JNIEXPORT jshort JNICALL Java_HBioBSP_OpenDevice
      (JNIEnv *, jobject, jint);
    * Class:     HBioBSP
    * Method:    CloseDevice
    * Signature: (IS)Z
    JNIEXPORT jboolean JNICALL Java_HBioBSP_CloseDevice
      (JNIEnv *, jobject, jint, jshort);
    #ifdef __cplusplus
    #endif
    #endifSo, I implemented the C++ methods and compiled a dynamic library (HBioBSP.so) using GNU 3.2 Tools and I copied it to the system folder /usr/lib
    Now, here's the Main class to test the new library:
    * To change this template, choose Tools | Templates
    * and open the template in the editor.
    * @author jborges
    public class Main {
         * @param args the command line arguments
        public static void main(String[] args) {
            int hHandle;
            short nDeviceID;
            HBioBSP bioModule = new HBioBSP();
            System.out.println("bioModule.Init() \t\t\t\t> hHandle = " + (hHandle = bioModule.Init()));
            System.out.println("bioModule.OpenDevice() \t\t\t\t> " + (nDeviceID = bioModule.OpenDevice(hHandle)));
            System.out.println("bioModule.CloseDevice() \t\t\t> " + bioModule.CloseDevice(hHandle, nDeviceID));
            System.out.println("bioModule.Terminate() \t\t\t\t> " + bioModule.Terminate(hHandle));       
    }I run and...
    xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    init:
    deps-jar:
    Compiling 1 source file to /home/jborges/NetBeansProjects/JNI-HBioBSP/build/classes
    compile-single:
    run-single:
    bioModule.Init() > hHandle = 135324080
    # An unexpected error has been detected by HotSpot Virtual Machine:
    # SIGSEGV (0xb) at pc=0xb7e6ef15, pid=8554, tid=3085109456
    # Java VM: Java HotSpot(TM) Client VM (1.4.2_18-b06 mixed mode)
    # Problematic frame:
    # C [libc.so.6+0x3df15] IOvfprintf+0x35
    # An error report file with more information is saved as hs_err_pid8554.log
    # If you would like to submit a bug report, please visit:
    # http://java.sun.com/webapps/bugreport/crash.jsp
    Java Result: 134
    CONSTRU&Iacute;DO COM SUCESSO (tempo total: 2 segundos)
    xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    Ohhhhhhh god! It crashed when tried to access the USB device => bioModule.OpenDevice()
    The log file is below:
    xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    # An unexpected error has been detected by HotSpot Virtual Machine:
    # SIGSEGV (0xb) at pc=0xb7e22f15, pid=7705, tid=3084798160
    # Java VM: Java HotSpot(TM) Client VM (1.4.2_18-b06 mixed mode)
    # Problematic frame:
    # C [libc.so.6+0x3df15] IOvfprintf+0x35
    --------------- T H R E A D ---------------
    Current thread (0x08057bc0): JavaThread "main" [_thread_in_native, id=7705]
    siginfo:si_signo=11, si_errno=0, si_code=1, si_addr=0x00000046
    Registers:
    EAX=0xb7de48d0, EBX=0xb7f23ff4, ECX=0x00000000, EDX=0x0000000d
    ESP=0xbff7315c, EBP=0xbff73778, ESI=0x0810e1b8, EDI=0xffffffc8
    EIP=0xb7e22f15, CR2=0x00000046, EFLAGS=0x00210286
    Top of Stack: (sp=0xbff7315c)
    0xbff7315c: ffffffc0 00000345 00200034 00280007
    0xbff7316c: b7de48d0 b7e24f74 00000000 00000000
    0xbff7317c: 00000000 000e4d1c 000e4d1c b7de48d0
    0xbff7318c: bff736dc 00000001 000e5830 bff7380c
    0xbff7319c: ffffffff 000042a0 0000a108 00000006
    0xbff731ac: 00001000 00000002 000e8998 000e8998
    0xbff731bc: 000e8998 000000f8 000000f8 00000006
    0xbff731cc: 00000004 00000007 00000000 ffffffff
    Instructions: (pc=0xb7e22f15)
    0xb7e22f05: ff 8b bb cc ff ff ff 8b 14 38 89 95 94 fa ff ff
    0xb7e22f15: 80 79 46 00 0f 84 31 26 00 00 8b 45 08 8b 30 f7
    Stack: [0xbfd84000,0xbff76000), sp=0xbff7315c, free space=1980k
    Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
    C [libc.so.6+0x3df15] IOvfprintf+0x35
    C [libc.so.6+0x47c1f] IOfprintf+0x1f
    C [VenusLib.so+0xa92b] _ZN8CVv5404U10SaveConfigEv+0x7d
    C [VenusLib.so+0xa9ca] _ZN8CVv5404UD0Ev+0x32
    C [VenusLib.so+0x33fd] DestroyISensor+0xb9
    C [libNBioBSP.so+0x1423c] _Z13FreeSensorDllPP7ISensorPPv+0x52
    C [libNBioBSP.so+0x2a8e7] Z11OpenDevicetPP7ISensorPPvPNS_18tagDeviceInfoParamEPKc+0x38f
    C [libNBioBSP.so+0x20dc4] _ZN8CNBioBSP10OpenDeviceEt+0x94
    C [libNBioBSP.so+0x1bc19] NBioAPI_OpenDevice+0x3f
    C [libHBioBSP.so+0xbe0] Java_HBioBSP_OpenDevice+0x40
    j HBioBSP.OpenDevice(I)S+0
    j Main.main([Ljava/lang/String;)V+55
    v ~StubRoutines::call_stub
    V [libjvm.so+0x1b1824]
    V [libjvm.so+0x267379]
    V [libjvm.so+0x1b1a76]
    V [libjvm.so+0x1b9d3e]
    V [libjvm.so+0x1c890d]
    C [java+0x1880]
    C [libc.so.6+0x165f5] __libc_start_main+0xe5
    Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
    j HBioBSP.OpenDevice(I)S+0
    j Main.main([Ljava/lang/String;)V+55
    v ~StubRoutines::call_stub
    --------------- P R O C E S S ---------------
    Java Threads: ( => current thread )
    0x080a4ac8 JavaThread "CompilerThread0" daemon [_thread_blocked, id=7714]
    0x080a3c38 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=7713]
    0x0808fa58 JavaThread "Finalizer" daemon [_thread_blocked, id=7710]
    0x0808dfb0 JavaThread "Reference Handler" daemon [_thread_blocked, id=7709]
    =>0x08057bc0 JavaThread "main" [_thread_in_native, id=7705]
    Other Threads:
    0x0808cd38 VMThread [id=7708]
    0x080a64d8 WatcherThread [id=7715]
    VM state:not at safepoint (normal execution)
    VM Mutex/Monitor currently owned by a thread: None
    Heap
    def new generation total 576K, used 144K [0xab770000, 0xab810000, 0xabc50000)
    eden space 512K, 28% used [0xab770000, 0xab7942a8, 0xab7f0000)
    from space 64K, 0% used [0xab7f0000, 0xab7f0000, 0xab800000)
    to space 64K, 0% used [0xab800000, 0xab800000, 0xab810000)
    tenured generation total 1408K, used 0K [0xabc50000, 0xabdb0000, 0xaf770000)
    the space 1408K, 0% used [0xabc50000, 0xabc50000, 0xabc50200, 0xabdb0000)
    compacting perm gen total 4096K, used 982K [0xaf770000, 0xafb70000, 0xb3770000)
    the space 4096K, 23% used [0xaf770000, 0xaf865920, 0xaf865a00, 0xafb70000)
    Dynamic libraries:
    08048000-08053000 r-xp 00000000 08:06 108586 /opt/java-sdk/j2sdk1.4.2_18/bin/java
    08053000-08055000 rwxp 0000a000 08:06 108586 /opt/java-sdk/j2sdk1.4.2_18/bin/java
    08055000-08113000 rwxp 08055000 00:00 0 [heap]
    aad2d000-aae47000 rwxp aad2d000 00:00 0
    aae47000-aaf2c000 r-xp 00000000 08:06 360409 /usr/lib/libstdc++.so.6.0.10
    aaf2c000-aaf30000 r-xp 000e5000 08:06 360409 /usr/lib/libstdc++.so.6.0.10
    aaf30000-aaf31000 rwxp 000e9000 08:06 360409 /usr/lib/libstdc++.so.6.0.10
    aaf31000-aaf37000 rwxp aaf31000 00:00 0
    aaf4e000-aaf5a000 r-xp 00000000 08:06 468130 /lib/libgcc_s.so.1
    aaf5a000-aaf5b000 r-xp 0000b000 08:06 468130 /lib/libgcc_s.so.1
    aaf5b000-aaf5c000 rwxp 0000c000 08:06 468130 /lib/libgcc_s.so.1
    aaf5c000-ab014000 r-xp 00000000 08:06 446430 /usr/lib/libstdc++.so.5.0.7
    ab014000-ab015000 r-xp 000b8000 08:06 446430 /usr/lib/libstdc++.so.5.0.7
    ab015000-ab019000 rwxp 000b9000 08:06 446430 /usr/lib/libstdc++.so.5.0.7
    ab019000-ab01e000 rwxp ab019000 00:00 0
    ab01e000-ab09c000 r-xp 00000000 08:06 468121 /lib/libNBioBSP.so
    ab09c000-ab0a5000 rwxp 0007e000 08:06 468121 /lib/libNBioBSP.so
    ab0a5000-ab0ac000 rwxp ab0a5000 00:00 0
    ab0b3000-ab0c2000 r-xp 00000000 08:06 468087 /lib/VenusLib.so
    ab0c2000-ab0c3000 rwxp 0000f000 08:06 468087 /lib/VenusLib.so
    ab0c3000-ab0d0000 r-xs 00000000 08:06 108661 /opt/java-sdk/j2sdk1.4.2_18/jre/lib/ext/ldapsec.jar
    ab0d0000-ab0ec000 r-xs 00000000 08:06 108659 /opt/java-sdk/j2sdk1.4.2_18/jre/lib/ext/sunjce_provider.jar
    ab0ec000-ab1aa000 r-xs 00000000 08:06 108662 /opt/java-sdk/j2sdk1.4.2_18/jre/lib/ext/localedata.jar
    ab1aa000-ab1ab000 ---p ab1aa000 00:00 0
    ab1ab000-ab22b000 rwxp ab1ab000 00:00 0
    ab22b000-ab22c000 ---p ab22b000 00:00 0
    ab22c000-ab239000 rwxp ab22c000 00:00 0
    ab239000-ab23c000 ---p ab239000 00:00 0
    ab23c000-ab42c000 rwxp ab23c000 00:00 0
    ab42c000-ab42d000 ---p ab42c000 00:00 0
    ab42d000-ab43a000 rwxp ab42d000 00:00 0
    ab43a000-ab43d000 ---p ab43a000 00:00 0
    ab43d000-ab4ad000 rwxp ab43d000 00:00 0
    ab4ad000-ab4ae000 ---p ab4ad000 00:00 0
    ab4ae000-ab52e000 rwxp ab4ae000 00:00 0
    ab52e000-ab56d000 r-xp 00000000 08:06 492489 /usr/lib/locale/pt_BR.utf8/LC_CTYPE
    ab56d000-ab56e000 ---p ab56d000 00:00 0
    ab56e000-ab57b000 rwxp ab56e000 00:00 0
    ab57b000-ab57e000 ---p ab57b000 00:00 0
    ab57e000-ab5ee000 rwxp ab57e000 00:00 0
    ab5ee000-ab5ef000 ---p ab5ee000 00:00 0
    ab5ef000-ab5fc000 rwxp ab5ef000 00:00 0
    ab5fc000-ab5ff000 ---p ab5fc000 00:00 0
    ab5ff000-ab66f000 rwxp ab5ff000 00:00 0
    ab66f000-ab670000 ---p ab66f000 00:00 0
    ab670000-ab6f3000 rwxp ab670000 00:00 0
    ab6f3000-ab711000 rwxp ab6f3000 00:00 0
    ab711000-ab712000 rwxp ab711000 00:00 0
    ab712000-ab72f000 rwxp ab712000 00:00 0
    ab72f000-ab730000 rwxp ab72f000 00:00 0
    ab730000-ab731000 rwxp ab730000 00:00 0
    ab731000-ab733000 rwxp ab731000 00:00 0
    ab733000-ab74f000 rwxp ab733000 00:00 0
    ab74f000-ab751000 rwxp ab74f000 00:00 0
    ab751000-ab76f000 rwxp ab751000 00:00 0
    ab76f000-ab810000 rwxp ab76f000 00:00 0
    ab810000-abc50000 rwxp ab810000 00:00 0
    abc50000-abdb0000 rwxp abc50000 00:00 0
    abdb0000-af770000 rwxp abdb0000 00:00 0
    af770000-afb70000 rwxp af770000 00:00 0
    afb70000-b3770000 rwxp afb70000 00:00 0
    b3770000-b3771000 r-xp 00000000 08:06 463826 /usr/lib/libHBioBSP.so
    b3771000-b3772000 r-xp 00000000 08:06 463826 /usr/lib/libHBioBSP.so
    b3772000-b3773000 rwxp 00001000 08:06 463826 /usr/lib/libHBioBSP.so
    b3773000-b3776000 r-xs 00000000 08:06 108660 /opt/java-sdk/j2sdk1.

    Hello guys,
    After some tests I discovered the problem:
    If I run the Java Application as root user it works fine. It's not JNI or Java runtime or library dependences \o/ xD Just a permission access error to device, but without an appropriate error message.. That's why I didn't know what to do.
    Also, I can use JNA to invoke the SDK methods. It means the Java interface and the codification work will become more simple and faster to do.
    Well,
    Thank you all for attention. I hope participate more of the community and help other developers too.
    0_codexxx

Maybe you are looking for

  • Syncing ipod after hard drive repair

    I recently had a major problem with my computer and had to have a new hard drive installed, losing itunes in the process. I have downloaded the itunes software but when I insert my ipod, hoping to transfer the files on it to my itunes library, I get

  • NPE in CA-TS

    Hi experts, In our Java webdynpro CATS application I get the following error, when I try to go back to the previous week: java.lang.NullPointerException      at com.sap.xss.hr.cat.general.java.ContextHelperSlim.supplyTableData(ContextHelperSlim.java:

  • Can't use disc warrior 4.4 with my iMac lion

    I have tried pushing "c" when restarting the computer to boot from my Disc Warrior (4.4) disc but it is ignored.  When I push the "option" button on startup to boot from the disc warroir disc I get the dreaded 3 beep sound and I have to turn off the

  • Scrolling and searching is seriously delayed

    So I had itunes running perfectly on my main desktop computer upstairs with an older version of itunes. I also have a desktop dopwnstairs that had itunes running perfectly as well (this one is reading itunes files wirelessly from the main desktop). S

  • Updating the field "relevant for POD" for customer in XD03 in R/3

    Hi All, Is there a way to update the field "relevant for POD" for newly created customer on XD03 in R/3 from CRM system. My requirement is customers will be created in CRM by interface from mainframe(legacy) system. Whenever a  new customer is create