Fatal error using C++ native library

Hi everyone,
I'm currently developing a JNI native library in C++ in order to use an original library from a third vendor. I'm trying to perform a very simple operation, just calling a concrete method from the original library from a Java sample application.
The same test in C++ is working fine, so I assume the vendor library is working correctly. But if I perform exactly the same code from within my native library using JNI, it give a crash like this:
# A fatal error has been detected by the Java Runtime Environment:
# SIGSEGV (0xb) at pc=0x000000371c880580, pid=17095, tid=1077307712
# JRE version: 6.0_27-b07
# Java VM: Java HotSpot(TM) 64-Bit Server VM (20.2-b06 mixed mode linux-amd64 compressed oops)
# Problematic frame:
# C [libc.so.6+0x80580] wchar_t+0x0
I think this is telling me that there was an error in the native library, more concrete in the libc.so library which is part of the GNU C++ compiler used to generate the native library. I don't know what the "wchar_t" wants to mean, since I know that is a primitive type for wide chars. It might be that the error is related to the use of this primitive within the vendor library?
The compilation options that I'm using are the following:
#CCFLAGS = -shared -Wl,-soname,${TARGET} -lstdc++ -ldl -lpthread -fopenmp
CCFLAGS = -shared -Wl,-soname,${TARGET} -ldl -fopenmp
#FPFLAGS = -DLINUX -DGX_NAMESPACES -fPIC -fshort-wchar
#FPFLAGS = -fPIC -fshort-wchar
FPFLAGS = -fPIC
${TARGET} : FPEnginePulnixImpl.o
     ${CC} -o ${TARGET} FPEnginePulnixImpl.o ${CCFLAGS} -L${JAI_DIR} -lVrs
FPEnginePulnixImpl.o :
     ${CC} -o FPEnginePulnixImpl.o -I"${JDK_INCLUDES}" -I"${JDK_INCLUDES_LINUX}" -I"../jni/include" -I"${JAI_INCLUDES}" ${FPFLAGS} -c ../src/main/C++/FPEnginePulnixImpl.cc
I played around with those ones, without success so far. I debugged the native code and I know the crash is coming when I call a constructor of a C++ class of the vendor library. Is there something I could do about this? BTW, on Windows is working fine, but indeed, the vendor library is a different one. I've got the impression that there's something in the JNI wrapper of the JDK6 that I'm using that makes the vendor library to crash, either that or something wrong with the compilation of my native library.
Any help will be welcome.
Thanks and regards,
Luis

Most often errors are caused by
1. Pointer errors
2. Api misuse, such as using something in the wrong order (which actually leads to a pointer problem but it not really the cause.)
Keep in mind that the fact that code runs 'ok' on one system is NOT a safe indicator that the above problems do not exist.
If it is not that then if the binaries have incompatible build properties then that can cause problems.

Similar Messages

  • I am getting this error when I open Firefox after DLing Firefox 5 (never seen this in any other previous version): FATAL ERROR : The dynamic C library contained in the extension file could not be found.

    Hi there,
    I'm getting this error when opening Firefox 5:
    FATAL ERROR : The dynamic C library contained in the extension file could not be found.
    I've never seen this error before... First time it happened was immediately after DLing Firefox 5 yesterday. I haven't DLed or installed anything else recently.
    I see that you already have my system info. Any help is much appreciated!

    Just read in another post that there is a known 49 character limit on the file path for QuickTime movies..

  • Fatal Error: Failed to load library 'pdh.dll.'

    When I double click on the Skype icon, a dialogue box pops up. It says "Fatal Error" at the top, and inside, it says, "Failed to load library 'pdh.dll.'" I cannot get Skype to open at all.
    I had used Skype with no problems the day before, and I didn't do anything to any files or anything. I don't think.
    I have restarted my computer, un-installed and reinstalled Skype, and went into %appdata% and renamed the Skype folder, tried to open Skype, then renamed the folder back again. None of this worked.
    I ran a Malware scan and it came back clean. I am currently running a virus scan.
    Can anyone help me?
    Solved!
    Go to Solution.

    See this case:
    http://community.skype.com/t5/Windows-archive/Skype-crashes-with-Adobe-Reader-XI/m-p/1557574/highlig...
    Have you recently updated your Adobe Reader application?

  • How to use a native library packaged in a connector

    Hi,
    I know how to package a native library into a connector in my app server. But I don't quite know how to use it. Suppose I provide a wrapper java class for the native library, can I use the java class directly in my EJB (since the classloader of the RA is the parent of the EJB classloader) or I have to issue an outbound call?
    Thanks,
    Haitao

    Thanks Vidyut! You've answered my question.
    I placed the jar file in the $CATALINA_HOME/shared/lib directory. But where should I place the taglib TLD file? And how should I reference it in web.xml?
    Currently, my web.xml is as follows and it doesn't work.
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <!DOCTYPE web-app
    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
    "http://java.sun.com/dtd/web-app_2_3.dtd">
    <web-app>
    <taglib>
    <taglib-uri>http://abc.com</taglib-uri>
    <taglib-location>c:\Tomcat\shared\lib\mytags-taglib.tld</taglib-location>
    </taglib>
    </web-app>
    Thanks again!
    Joe

  • How to use a native library (.so) in EJB

    Hi,
    I know how to package a native library into a connector in iAS. But I don't quite know how to use it. Suppose I provide a wrapper java class for the native library, can I use the java class directly in my EJB (since the classloader of the RA is the parent of the EJB classloader) or I have to issue an outbound call?
    Also, if I package the native library into a RA (standalone), iAS will automatically load it so in my wrapper java class, I don't have to call System.loadLibrary(...). Correct?
    Thanks,
    Haitao

    Thanks, Russ. My older Mac Pro is a 2,1 -- I think I only missed by a few months in buying one that would run Mavericks (64 bit EFI).  I do intend to buy a "trashcan" Mac Pro but not just yet.
    As for updating projects — that's my issue, I think. The Mac Pro and the laptop are networked so I can be working on my laptop and go to the Mac Pro and open the Final Cut Pro that is resident on that computer. What is odd is that it doesn't open any of the projects that normally open up with I start up FCP X on the Mac Pro.
    I frequently work inside the house on my laptop running programs that are on my Mac Pro outside in my office — usually no problem at all with Adobe applications. 
    FCP X won't let me open a project by clicking on the project — it insists that I "Open projects from within FCP X" but they won't open that way.  This what is odd — that it won't let me open projects even thought they are fully native to that version of FCP and are even on the same hard drive on the Mac Pro.

  • Fatal errors using JavaFX ChoiceBox, Tooltip, Popup in Eclipse (RCP) View

    I'm using JavaFX within an Eclipse RCP application. Any JavaFX popup (ChoiceBox, Tooltip, etc..) within an eclipse view causes a fatal exception to occur when clicking on the popup. The popups do appear, but clicking on them causes the fatal error.
    I created a standalone JavaFX application to confirm that the Popups work fine in that environment. They do.
    I also created a standalone SWT-based application (outside of an RCP) that embeds the FXCanvas within an SWT shell and the problem doesn't occur there either.
    But when the Combo is contained in an FXCanvas within and RCP view, the fatal exception occurs.
    Has anybody else seen this behavior?
    I tried it with JavaFX 2.0.2, 2.1 b17, 2.1 b19 (all 32bit)
    I'm using JRE 6.0_30-b12 (32bit) on Windows 7 (64bit)
    My RCP target platform is based on eclipse 3.6 (galileo).
    Thanks!

    The problem is described in http://javafx-jira.kenai.com/browse/RT-20883. e(fx)clipse 0.0.14 (http://tomsondev.bestsolution.at/2012/05/29/efxclipse-0-0-14-released/) which I've just released fixes the problem. Unfortunately it does not work with 3.6 because I'm using OSGi API only available > 3.7.0

  • Fatal error 'failed to load library dxva.dll

    My skype program won't open or load and I get fatal error message ' dxva2.dll what must I do?

    A quick search brings up: http://community.skype.com/t5/Windows-desktop-client/load-library-dxva2-dll/m-p/4000948/highlight/true#M348806  

  • Error using custom tag library

    Hi All,
              I am getting the following error:
              On the browzer page when I invoke the foo.jsp page containing a tag
              library.
              Parsing of JSP File '/jsp/foo.jsp' failed:
              /jsp/foo.jsp(7): Could not parse deployment descriptor:
              org.xml.sax.SAXParseException: Could not parse taglib, starting at
              line 5
              probably occurred due to an error in /jsp/foo.jsp line 7:
              <%@ taglib uri="example-taglib.tld" prefix="eg" %>
              Wed Mar 27 13:17:49 PST 2002
              The configutation is as follows
              Foo.jsp in documentRoot/jsp
              tld file in documentRoot/WEB-INF
              class files in documentRoot/WEB-INF/classes/examples.
              The server is spitting out the following code:
              weblogic.servlet.jsp.JspException: (line 7): Could not parse
              deployment descript
              or: org.xml.sax.SAXParseException: Could not parse taglib, starting at
              line 5
              at java.lang.Throwable.fillInStackTrace(Native Method)
              at java.lang.Throwable.fillInStackTrace(Compiled Code)
              at java.lang.Throwable.<init>(Compiled Code)
              at java.lang.Exception.<init>(Compiled Code)
              at java.lang.RuntimeException.<init>(RuntimeException.java:47)
              at weblogic.servlet.jsp.JspException.<init>(JspException.java:9)
              Can anyone help me with this ?
              Thanks for your help!!
              SundayFunday!
              

    Could anyone please let me know what is going on here?
              SundayFunday!
              [email protected] (SundayFunday) wrote in message news:<[email protected]>...
              > Can anyone help me with this?!!
              >
              > Thanks!
              >
              > Sundayfunday.
              >
              > [email protected] (SundayFunday) wrote in message news:<[email protected]>...
              > > Hi All,
              > >
              > > I am getting the following error:
              > >
              > > On the browzer page when I invoke the foo.jsp page containing a tag
              > > library.
              > >
              > > Parsing of JSP File '/jsp/foo.jsp' failed:
              > > --------------------------------------------------------------------------------
              > > /jsp/foo.jsp(7): Could not parse deployment descriptor:
              > > org.xml.sax.SAXParseException: Could not parse taglib, starting at
              > > line 5
              > > probably occurred due to an error in /jsp/foo.jsp line 7:
              > > <%@ taglib uri="example-taglib.tld" prefix="eg" %>
              > > --------------------------------------------------------------------------------
              > > Wed Mar 27 13:17:49 PST 2002
              > >
              > >
              > >
              > > The configutation is as follows
              > >
              > > Foo.jsp in documentRoot/jsp
              > >
              > > tld file in documentRoot/WEB-INF
              > > class files in documentRoot/WEB-INF/classes/examples.
              > >
              > >
              > >
              > > The server is spitting out the following code:
              > >
              > > weblogic.servlet.jsp.JspException: (line 7): Could not parse
              > > deployment descript
              > > or: org.xml.sax.SAXParseException: Could not parse taglib, starting at
              > > line 5
              > > at java.lang.Throwable.fillInStackTrace(Native Method)
              > > at java.lang.Throwable.fillInStackTrace(Compiled Code)
              > > at java.lang.Throwable.<init>(Compiled Code)
              > > at java.lang.Exception.<init>(Compiled Code)
              > > at java.lang.RuntimeException.<init>(RuntimeException.java:47)
              > > at weblogic.servlet.jsp.JspException.<init>(JspException.java:9)
              > >
              > >
              > > Can anyone help me with this ?
              > >
              > > Thanks for your help!!
              > >
              > > SundayFunday!
              

  • Fatal error: fail to load library dxva2.dll

    My PC has Windows XP Professional SP3 and I installed the latest version of Skype.
    Installation was OK but when I tried to open Skype, the error I've described in the topic's subject appears (the same as the image).
    How can I fix this problem?
    Attachments:
    Untitled 1.png ‏7 KB

    Dxva2.dll is a DirectX system file.  If you are receiving that error it is because this operating system file is missing or damaged.  While copying the file from another source can work, it's best to use system file checker (sfc /scannow) in a command prompt box (Start - Run - cmd) to ensure the proper version is restored.  This will allow your OS to repair damaged or missing Windows operating system files (like dxva2.dll).  Be aware in Windows XP you will either need your Windows XP installation media or a local copy of the i386 folder (originating from the install disc) in order to successfully run system file checker.

  • Skype Error: Fatal Error - Failed to load library ...

    My skype is normally perfect! but for some strange reason it stopped working! i have tried researching about this but failed to complete and reslove this  
    It will be very thankful if you guys help me to reslove this!
    Solved!
    Go to Solution.

    I couldnt find the .log but however there was a txt file which was in the folder!
    CBS Folder
    Attachments:
    CBS.zip ‏1 KB

  • Fatal Error: Failed to load library 'dxav2.dll

    Help po plss

    Please,  run the DirectX diagnostics tool.
    Go to Windows Start  and in the Run box type dxdiag.exe and press the OK button. This will start the DirectX diagnostics program. Run this diagnostics and save the results to a file. Please, attach this file to your post.
    Be aware that you will have to zip this file before attaching it here.

  • Native library NOT thread safe - how to use it via JNI?

    Hello,
    has anybody ever tried to use a native library from JNI, when the library is not thread safe?
    The library (Windows DLL) was up to now used in an MFC App and thus was only used by one user - that meant one thread - at a time.
    Now we would like to use the library like a "server": many Java clients connect the same time to the library via JNI. That would mean each client makes its calls to the library in its own thread. Because the library is not thread safe, this would cause problems.
    Now we discussed to load the library several times - separately for each client (for each thread).
    Is this possible at all? How can we do that?
    And do you think we can solve the problem in this way?
    Are there other ways to use the library, though it is not thread safe?
    Any ideas welcome.
    Thanks for any contributions to the discussion, Ina

    (1)
    has anybody ever tried to use a native library from
    JNI, when the library (Windows DLL) is not thread safe?
    Now we want many Java clients.
    That would mean each client makes its calls
    to the library in its own thread. Because the library
    is not thread safe, this would cause problems.Right. And therefore you have to encapsulate the DLL behind a properly synchronized interface class.
    Now the details of how you have to do that depends: (a) does the DLL contain state information other than TLS? (b) do you know which methods are not thread-safe?
    Depending on (a), (b) two extremes are both possible:
    One extreme would be to get an instance of the interface to the DLL from a factory method you'll have to write, where the factory method will block until it can give you "the DLL". Every client thread would obtain "the DLL", then use it, then release it. That would make the whole thing a "client-driven" "dedicated" server. If a client forgets to release the DLL, everybody else is going to be locked out. :-(
    The other extreme would be just to mirror the DLL methods, and mark the relevant ones as synchronized. That should be doable if (a) is false, and (b) is true.
    (2)
    Now we discussed to load the library several times -
    separately for each client (for each thread).
    Is this possible at all? How can we do that?
    And do you think we can solve the problem in this
    way?The DLL is going to be mapped into the process address space on first usage. More Java threads just means adding more references to the same DLL instance.
    That would not result in thread-safe behavior.

  • Native library loading problem

    Hi Folks,
    I currently downloaded, and compiled the bDB core using VS 2010 x64 (I run 64 bit win7, and JRE 64 bit). In Eclipse I'm trying to use the native library (setting up the path correctly), however the java is complaining that it cannot find dependencies.
    I switched to JE, it works fine, but I'm not sure if JE is as performant as the core version. Anybody had the same problem?
    thanks in advance
    Edited by: user5493457 on Mar 22, 2011 3:35 AM

    Hi,
    Please review the building process of the Berkeley DB libraries, to ensure you have correctly built them. Review Building Berkeley DB for Windows, Building the Java API and Java configuration. If you want to build 64-bit libraries, make sure you select x64 as platform configuration in Visual Studio when building.
    I assume you are getting a java.lang.UnsatisfiedLinkError exception at runtime. Just to make sure Eclipse correctly finds the native BDB libraries, in your Run Configuration for the project you're trying to run, under Environment, add a new variable, LD_LIBRARY_PATH with a value of something like D:\BerkeleyDB\db-5.1.25\build_windows\x64\Debug (substitute Debug with Release depending on how you built the libraries) -- this is the path to the location of the native BDB libs, libdb51d.dll and libdb_java51d.dll (or libdb51.dll and libdb_java51.dll), so you should change it as appropriate for your system.
    Also, for that Run Configuration add a new variable, CLASSPATH with a value of something like D:\BerkeleyDB\db-5.1.25\build_windows\x64\Debug\db.jar;D:\BerkeleyDB\db-5.1.25\build_windows\x64\Debug\classes (this is the path to the Java API classes and the Java API jar file -- db.jar). Make sure that "Append environment to native environment" option is checked, in the Run Configurations screen.
    Regards,
    Andrei

  • Fatal error XML-0121 in a valid XML file in v2 of SAX parser

    Attachments: "1|type=text/plain|desc=Logging of Fatal error using v2 of SAX parser |file=v2_loggin
    .txt|";"2|type=text/plain|desc=Logging of Fatal error using v2 of java SAX parser |17078|file=v2_l
    gging.txt|"
    Dear XML team,
    I am using the SAX parser version 2.0.2.4. When parsing a valid
    XML of approx. 3,5 Megabytes i get a fatal error XML-0121
    saying 'End tag does not match start tag
    <CORRESPONDENTIENAAM1>...'
    We checked the xml on the well formedness with tools like XML
    Spy and IE5. The XML is valid!
    We did some testing on the XML with the SAXSample class and we
    noticed that the error is related to the use of Entity
    References. When we removed the Entity Reference &apos; the XML
    was parsed correctly.
    We also noticed that if we cut the XML in two smaller parts it
    was also parsed correctly.
    I attached the output of the parser, as well as the output of
    the SAXSample class.
    I hope you can fix this problem!
    With kind regards,
    Rolf van Deursen.
    null

    Update: I have attempted to use xmlparserv2.jar dated 12/23/08 that is packaged with jDeveloper 11g preview, but am still receiving the same message.

  • Specify native library in java command line

    My application is :
    1. packed into 1 jar file
    2. use sqljdbc4.jar
    2. use a native library: "Microsoft SQL Server JDBC Driver 3.0".(use it in Ecplise and it works fine)
    3. run by this command: "java -jar myapp.jar".
    java version is jdk1.6.0_23
    btw: I config all the class paths in the manifest.mf file
    My application is failed to run, since it cannot find the native library. How/where to specify the native library location?

    -Djava.library.path

Maybe you are looking for

  • GT70 2OD downloads bios driver firmware

    i have GT70 2OD-019US i tried to update my graphic card driver from  http://www.msi.com/product/nb/GT70-2OD.html#download it didnt work it said not compatiable im using latest beta driver from nvidia webiste you guys have right stuff on the website t

  • Output 1440p through MDP to HDMI 2?

    Hello there, I have a mid 2011 27" iMac, and I recently bought an LG 4k TV. I have everything (iMac, Xbox, cable TV, bluray) running through an Onkyo TX-NR636, which is a 4K AV reciever, and then one HDMI cable runs to the TV. It's all very fancy. MY

  • ITS and SSL- how do I make this work?

    We have several systems running ITS 6.20 on Windows 2003 Servers. The systems also use Requisition web site pages for SRM, IPC, and Siteminder. When someone logs in with our normal URL, Siteminder itself runs them through a secure link and into the a

  • Cash Discount Given to Customer

    Hi Gurus, Please tell me where to assign the GL Account of Cash Discount given to Customers? Like we assign GL Account of Discount Rcvd in OBXU? Thank You

  • Multiple Application Server's Version installs multiple jinitiator

    I have multiple Application Servers in my environment and they have different versions like 9iAS 9.0.4 10.0.2 etc. I am facing a problem that when my users jump from one Application Server to another then it uses and install different jinitiator. Kin