Debugging mingw cross-compiled JNI code with drmingw

Hi there... I've been googling up a storm but so far no luck so I thought I'd throw the question out and hope for some answers. I have a chunk of native code in linux and now cross-compiled to win32 using mingw. When there is an exception in the native code, the VM exits. I'm getting java dumping its stack traces (eg. hs_err_pidXXXXX.log files), but those only have hex addresses for the native DLL because the mingw symbols aren't understood.
Example:
C [lhext.dll+0x47dcc]
C [lhext.dll+0x37408]
j some.jni.method.call.i.cant.easily.cut.and.paste
I tried to load the drmingw exchndl.dll in my native code, which I thought should dump stack traces to a file when the exception occurs, but it seems like java is controlling the exception handling and bypassing the exchndl.dll library, so the net result is no useful stack trace output.
Does anyone have a good method to do this (aside from attaching gdb in windows, which is inconvenient if this happens in the field)? Or a method to extract a call stack using the hex dll addresses from a mingw cross-compiled dll?

Hi there... I've been googling up a storm but so far no luck so I thought I'd throw the question out and hope for some answers. I have a chunk of native code in linux and now cross-compiled to win32 using mingw. When there is an exception in the native code, the VM exits. I'm getting java dumping its stack traces (eg. hs_err_pidXXXXX.log files), but those only have hex addresses for the native DLL because the mingw symbols aren't understood.
Example:
C [lhext.dll+0x47dcc]
C [lhext.dll+0x37408]
j some.jni.method.call.i.cant.easily.cut.and.paste
I tried to load the drmingw exchndl.dll in my native code, which I thought should dump stack traces to a file when the exception occurs, but it seems like java is controlling the exception handling and bypassing the exchndl.dll library, so the net result is no useful stack trace output.
Does anyone have a good method to do this (aside from attaching gdb in windows, which is inconvenient if this happens in the field)? Or a method to extract a call stack using the hex dll addresses from a mingw cross-compiled dll?

Similar Messages

  • Problem to compile sample code with C++ Parser on Unix

    I just downloaded C++ parser and tried to compile the sample source code, but I got
    the following error:
    g++ -o DOMSample -I../include DOMSample.cpp -L../lib/xml8 -L../lib/core8 -L../lib/nls8 -L../lib/xmlc8 -L../lib/nsl -L../lib/socket
    Undefined first referenced
    symbol in file
    Node::getFirstChild(void) /var/tmp/ccarlA8y.o
    Node::getValue(void) /var/tmp/ccarlA8y.o
    XMLParser::xmlterm(void) /var/tmp/ccarlA8y.o
    XMLParser::getDocumentElement(void) /var/tmp/ccarlA8y.o
    xmlinit__9XMLParserPUcPFPvPCUcUi_vPvP8xmlsaxcbT3T1 /var/tmp/ccarlA8y.o
    Node::hasChildNodes(void) /var/tmp/ccarlA8y.o
    Node::getChildNode(unsigned int) /var/tmp/ccarlA8y.o
    Node::getName(void) /var/tmp/ccarlA8y.o
    Node::numChildNodes(void) /var/tmp/ccarlA8y.o
    XMLParser::xmlparse(unsigned char *, unsigned char *, unsigned int)/var/tmp/ccarlA8y.o
    Node::getType(void) /var/tmp/ccarlA8y.o
    ld: fatal: Symbol referencing errors. No output written to DOMSample
    collect2: ld returned 1 exit status
    make: *** [DOMSample] Error 1
    Please help me out. Thanks,
    null

    I have the similar problem when I tried to compile sample code with C++ parser on WinNT4. I am using Micrsoft Visual Studio V6.0. I added the include file and lib file in the path.
    Here are the error messages:
    Linking...
    FullDOM.obj : error LNK2001: unresolved external symbol "public: void __thiscall XMLParser::xmlterm(void)" (?xmlterm@XMLParser@@QAEXXZ)
    FullDOM.obj : error LNK2001: unresolved external symbol "public: class NamedNodeMap * __thiscall DocumentType::getEntities(void)" (?getEntities@DocumentType@@QAEPAVNamedNodeMap@@XZ)
    FullDOM.obj : error LNK2001: unresolved external symbol "public: class Node * __thiscall NamedNodeMap::item(unsigned int)" (?item@NamedNodeMap@@QAEPAVNode@@I@Z)
    FullDOM.obj : error LNK2001: unresolved external symbol "public: unsigned int __thiscall NamedNodeMap::getLength(void)" (?getLength@NamedNodeMap@@QAEIXZ)
    FullDOM.obj : error LNK2001: unresolved external symbol "public: class NamedNodeMap * __thiscall DocumentType::getNotations(void)" (?getNotations@DocumentType@@QAEPAVNamedNodeMap@@XZ)
    FullDOM.obj : error LNK2001: unresolved external symbol "public: class DocumentType * __thiscall XMLParser::getDocType(void)" (?getDocType@XMLParser@@QAEPAVDocumentType@@XZ)
    FullDOM.obj : error LNK2001: unresolved external symbol "public: unsigned int __thiscall XMLParser::xmlparse(unsigned char *,unsigned char *,unsigned int)" (?xmlparse@XMLParser@@QAEIPAE0I@Z)
    FullDOM.obj : error LNK2001: unresolved external symbol "public: void __thiscall XMLParser::xmlclean(void)" (?xmlclean@XMLParser@@QAEXXZ)
    FullDOM.obj : error LNK2001: unresolved external symbol "public: void __thiscall CharacterData::replaceData(unsigned long,unsigned long,unsigned char *)" (?replaceData@CharacterData@@QAEXKKPAE@Z)
    FullDOM.obj : error LNK2001: unresolved external symbol "public: void __thiscall CharacterData::deleteData(unsigned long,unsigned long)" (?deleteData@CharacterData@@QAEXKK@Z)
    FullDOM.obj : error LNK2001: unresolved external symbol "public: void __thiscall CharacterData::insertData(unsigned long,unsigned char *)" (?insertData@CharacterData@@QAEXKPAE@Z)
    FullDOM.obj : error LNK2001: unresolved external symbol "public: void __thiscall CharacterData::appendData(unsigned char *)" (?appendData@CharacterData@@QAEXPAE@Z)
    FullDOM.obj : error LNK2001: unresolved external symbol "public: unsigned char * __thiscall CharacterData::substringData(unsigned long,unsigned long)" (?substringData@CharacterData@@QAEPAEKK@Z)
    FullDOM.obj : error LNK2001: unresolved external symbol "public: unsigned int __thiscall CharacterData::getLength(void)" (?getLength@CharacterData@@QAEIXZ)
    FullDOM.obj : error LNK2001: unresolved external symbol "public: void __thiscall CharacterData::setData(unsigned char *)" (?setData@CharacterData@@QAEXPAE@Z)
    FullDOM.obj : error LNK2001: unresolved external symbol "public: unsigned char * __thiscall CharacterData::getData(void)" (?getData@CharacterData@@QAEPAEXZ)
    FullDOM.obj : error LNK2001: unresolved external symbol "public: class Node * __thiscall Text::splitText(unsigned long)" (?splitText@Text@@QAEPAVNode@@K@Z)
    FullDOM.obj : error LNK2001: unresolved external symbol "public: class Node * __thiscall Node::cloneNode(int)" (?cloneNode@Node@@QAEPAV1@H@Z)
    FullDOM.obj : error LNK2001: unresolved external symbol "public: class Node * __thiscall NamedNodeMap::removeNamedItem(unsigned char *)" (?removeNamedItem@NamedNodeMap@@QAEPAVNode@@PAE@Z)
    FullDOM.obj : error LNK2001: unresolved external symbol "public: int __thiscall NamedNodeMap::setNamedItem(class Node *,class Node * *)" (?setNamedItem@NamedNodeMap@@QAEHPAVNode@@PAPAV2@@Z)
    FullDOM.obj : error LNK2001: unresolved external symbol "public: class NamedNodeMap * __thiscall Node::getAttributes(void)" (?getAttributes@Node@@QAEPAVNamedNodeMap@@XZ)
    FullDOM.obj : error LNK2001: unresolved external symbol "public: class Attr * __thiscall Element::removeAttributeNode(class Attr *)" (?removeAttributeNode@Element@@QAEPAVAttr@@PAV2@@Z)
    FullDOM.obj : error LNK2001: unresolved external symbol "public: class Attr * __thiscall Element::setAttribute(unsigned char *,unsigned char *)" (?setAttribute@Element@@QAEPAVAttr@@PAE0@Z)
    FullDOM.obj : error LNK2001: unresolved external symbol "public: void __thiscall Element::removeAttribute(unsigned char *)" (?removeAttribute@Element@@QAEXPAE@Z)
    FullDOM.obj : error LNK2001: unresolved external symbol "public: class Attr * __thiscall Element::getAttributeNode(unsigned char *)" (?getAttributeNode@Element@@QAEPAVAttr@@PAE@Z)
    FullDOM.obj : error LNK2001: unresolved external symbol "public: void __thiscall Attr::setValue(unsigned char *)" (?setValue@Attr@@QAEXPAE@Z)
    FullDOM.obj : error LNK2001: unresolved external symbol "public: int __thiscall Element::setAttributeNode(class Attr *,class Attr * *)" (?setAttributeNode@Element@@QAEHPAVAttr@@PAPAV2@@Z)
    FullDOM.obj : error LNK2001: unresolved external symbol "public: class Attr * __thiscall Document::createAttribute(unsigned char *,unsigned char *)" (?createAttribute@Document@@QAEPAVAttr@@PAE0@Z)
    FullDOM.obj : error LNK2001: unresolved external symbol "public: class DocumentFragment * __thiscall Document::createDocumentFragment(void)" (?createDocumentFragment@Document@@QAEPAVDocumentFragment@@XZ)
    FullDOM.obj : error LNK2001: unresolved external symbol "public: void __thiscall Element::normalize(void)" (?normalize@Element@@QAEXXZ)
    FullDOM.obj : error LNK2001: unresolved external symbol "public: class Node * __thiscall Node::removeChild(void)" (?removeChild@Node@@QAEPAV1@XZ)
    FullDOM.obj : error LNK2001: unresolved external symbol "public: class Node * __thiscall Node::replaceChild(class Node *)" (?replaceChild@Node@@QAEPAV1@PAV1@@Z)
    FullDOM.obj : error LNK2001: unresolved external symbol "public: class Document * __thiscall Node::getOwnerDocument(void)" (?getOwnerDocument@Node@@QAEPAVDocument@@XZ)
    FullDOM.obj : error LNK2001: unresolved external symbol "public: class Node * __thiscall Node::getParentNode(void)" (?getParentNode@Node@@QAEPAV1@XZ)
    FullDOM.obj : error LNK2001: unresolved external symbol "public: class Node * __thiscall NodeList::item(unsigned int)" (?item@NodeList@@QAEPAVNode@@I@Z)
    FullDOM.obj : error LNK2001: unresolved external symbol "public: unsigned int __thiscall NodeList::getLength(void)" (?getLength@NodeList@@QAEIXZ)
    FullDOM.obj : error LNK2001: unresolved external symbol "public: class NodeList * __thiscall Document::getElementsByTagName(class Element *,unsigned char *)" (?getElementsByTagName@Document@@QAEPAVNodeList@@PAVElement@@PAE@Z)
    FullDOM.obj : error LNK2001: unresolved external symbol "public: void __thiscall Node::setValue(unsigned char *)" (?setValue@Node@@QAEXPAE@Z)
    FullDOM.obj : error LNK2001: unresolved external symbol "public: class Node * __thiscall Node::getPreviousSibling(void)" (?getPreviousSibling@Node@@QAEPAV1@XZ)
    FullDOM.obj : error LNK2001: unresolved external symbol "public: class Node * __thiscall Node::getLastChild(void)" (?getLastChild@Node@@QAEPAV1@XZ)
    FullDOM.obj : error LNK2001: unresolved external symbol "public: class Node * __thiscall Node::getNextSibling(void)" (?getNextSibling@Node@@QAEPAV1@XZ)
    FullDOM.obj : error LNK2001: unresolved external symbol "public: class Node * __thiscall Node::getFirstChild(void)" (?getFirstChild@Node@@QAEPAV1@XZ)
    FullDOM.obj : error LNK2001: unresolved external symbol "public: class Node * __thiscall Node::insertBefore(class Node *,class Node *)" (?insertBefore@Node@@QAEPAV1@PAV1@0@Z)
    FullDOM.obj : error LNK2001: unresolved external symbol "public: class EntityReference * __thiscall Document::createEntityReference(unsigned char *)" (?createEntityReference@Document@@QAEPAVEntityReference@@PAE@Z)
    FullDOM.obj : error LNK2001: unresolved external symbol "public: class CDATASection * __thiscall Document::createCDATASection(unsigned char *)" (?createCDATASection@Document@@QAEPAVCDATASection@@PAE@Z)
    FullDOM.obj : error LNK2001: unresolved external symbol "public: class ProcessingInstruction * __thiscall Document::createProcessingInstruction(unsigned char *,unsigned char *)" (?createProcessingInstruction@Document@@QAEPAVProcessingInstruction@@PA
    E0@Z)
    FullDOM.obj : error LNK2001: unresolved external symbol "public: class Comment * __thiscall Document::createComment(unsigned char *)" (?createComment@Document@@QAEPAVComment@@PAE@Z)
    FullDOM.obj : error LNK2001: unresolved external symbol "public: class Text * __thiscall Document::createTextNode(unsigned char *)" (?createTextNode@Document@@QAEPAVText@@PAE@Z)
    FullDOM.obj : error LNK2001: unresolved external symbol "public: class Element * __thiscall XMLParser::getDocumentElement(void)" (?getDocumentElement@XMLParser@@QAEPAVElement@@XZ)
    FullDOM.obj : error LNK2001: unresolved external symbol "public: class Node * __thiscall Node::appendChild(class Node *)" (?appendChild@Node@@QAEPAV1@PAV1@@Z)
    FullDOM.obj : error LNK2001: unresolved external symbol "public: class Element * __thiscall Document::createElement(unsigned char *)" (?createElement@Document@@QAEPAVElement@@PAE@Z)
    FullDOM.obj : error LNK2001: unresolved external symbol "public: class Document * __thiscall XMLParser::getDocument(void)" (?getDocument@XMLParser@@QAEPAVDocument@@XZ)
    FullDOM.obj : error LNK2001: unresolved external symbol "public: class Document * __thiscall XMLParser::createDocument(void)" (?createDocument@XMLParser@@QAEPAVDocument@@XZ)
    FullDOM.obj : error LNK2001: unresolved external symbol "public: unsigned int __thiscall XMLParser::xmlinit(unsigned char *,void (__cdecl*)(void *,unsigned char const *,unsigned int),void *,struct xmlsaxcb *,void *,unsigned char *)" (?xmlinit@XMLPar
    ser@@QAEIPAEP6AXPAXPBEI@Z1PAUxmlsaxcb@@10@Z)
    FullDOM.obj : error LNK2001: unresolved external symbol "public: unsigned int __thiscall Node::numChildNodes(void)" (?numChildNodes@Node@@QAEIXZ)
    FullDOM.obj : error LNK2001: unresolved external symbol "public: class NodeList * __thiscall Node::getChildNodes(void)" (?getChildNodes@Node@@QAEPAVNodeList@@XZ)
    FullDOM.obj : error LNK2001: unresolved external symbol "public: int __thiscall Node::hasChildNodes(void)" (?hasChildNodes@Node@@QAEHXZ)
    FullDOM.obj : error LNK2001: unresolved external symbol "public: unsigned char * __thiscall Attr::getValue(void)" (?getValue@Attr@@QAEPAEXZ)
    FullDOM.obj : error LNK2001: unresolved external symbol "public: int __thiscall Attr::getSpecified(void)" (?getSpecified@Attr@@QAEHXZ)
    FullDOM.obj : error LNK2001: unresolved external symbol "public: unsigned char * __thiscall Attr::getName(void)" (?getName@Attr@@QAEPAEXZ)
    FullDOM.obj : error LNK2001: unresolved external symbol "public: unsigned char * __thiscall Node::getValue(void)" (?getValue@Node@@QAEPAEXZ)
    FullDOM.obj : error LNK2001: unresolved external symbol "public: unsigned char * __thiscall Node::getName(void)" (?getName@Node@@QAEPAEXZ)
    FullDOM.obj : error LNK2001: unresolved external symbol "public: short __thiscall Node::getType(void)" (?getType@Node@@QAEFXZ)
    LIBCD.lib(wincrt0.obj) : error LNK2001: unresolved external symbol _WinMain@16
    Debug/orafulldom.exe : fatal error LNK1120: 64 unresolved externals
    Error executing link.exe.
    orafulldom.exe - 65 error(s), 0 warning(s)
    null

  • Compile c code with makefile

    i have the source code for a program on my mac and i dont really know how to compile it.
    it has a makefile and all of the sources but i dont really know how to compile it
    the source code is at this website
    http://bcrypt.sourceforge.net/
    how do i compile the code on os x
    ?

    Hi--
    First off, you have to have the developer tools installed. You can download the latest version at Apple's Developer web site:
    http://developer.apple.com/products/online.html
    Or, there will be an appropriate version for your OS located on the DVD or CD that contains your OS installation.
    Since your code has a makefile, you simply need to open the Terminal application and change into the directory with your source code, and type make at the prompt. If you're not familiar with the Unix command line, I'd suggest any one of dozens of tutorials on how to maneuver around your computer in the Terminal. This is only one example:
    http://www.osxfaq.com/Tutorials/LearningCenter/
    charlie

  • Compiling Java code with Japanese characters

    I have a Java code with some Japanese characters. My compiler doesn't recognise these characters and gives me error messages.
    Please help me.

    Obviously it's not the copmiler's fault. You need to fix your code.
    Here is a link to the Java Language Specification.
    The link is to section 3.8 - Identifiers.
    It describes the acceptable naming:
    http://java.sun.com/docs/books/jls/second_edition/html/lexical.doc.html#40625
    Perhaps your editor is not saving the text file in an appropriate format.
    What editor are you using?
    Try vim http://www.vim.org
    or SciTE http://www.scintilla.org/SciTE.html

  • Executing tiny programming language compiled byte code with the JVM

    Hello,
    For a project, I am developing a simple programming language, with a syntax not unlike Pascal, which compiles to Java Byte Code. Currently I execute the compiled byte code using my own interpreter. This works OK, but what I'd like to do now is to execute the compiled byte code using the actual existing JVM. The compiled byte code resides in a text file upon compilation of a sample program written in my tiny programming language. Does anyone know how I may start to go about this? Thanks in advance.
    adam

    The only way of getting a standard Java virtual machine to execute your java byte code, is to wrap it up into a completely valid java class file.
    Any constants you use, must be put into the classes constant pool.
    Any local variables will have to go into the local variable table of the method which uses them... etc, etc.
    Something like ASM, would let you dynamically create a Java class file.
    http://asm.objectweb.org/
    regards,
    Owen

  • [Solve]Compile Ada code with integer_IO ,error integer.ads not found.

    Hello all again.
    I do some programming in Ada and i am very fascinated this language.
    I got problem when using integer_IO in my code.
    When it compiling I got strange error integer.ads not found.
    BTW.My compiler is GNAT 4.4.1.
    Thanks for help.
    Last edited by SpeedVin (2010-03-01 17:30:56)

    drcouzelis wrote:
    I also think Ada is fascinating. I wrote a small video game in Ada and I use Ada a little at work.
    "integer_IO" and "Integer_IO" doesn't matter, because Ada is case insensitive.
    I'm not home right now, but I think "Integer_IO" is a subpackage of "Text_IO":
    with Ada.Text_IO.Integer_IO;
    If you want, you can post your code and I'll see if I can compile it.
    Are you an Ada beginner? Even though I have been working with Ada for more than a year now, I still don't think I'm very good at it. I wish there was more documentation and more projects used Ada.
    Yes I'm new  into this language.
    I really won to that there will be more project's/program's written in ADA.
    This is my program code:
    With Text_IO;
    Use Text_IO;
    With Ada.Text_IO.Integer_IO;
    procedure file is
    Age :integer range 0..100;
    begin
    if Age < 18 then
    put_line("BABY!!!");
    else
    put_line("OLD MAN!!!");
    end if;
    end;
    When I try to compile it I get error:
    file.adb:3:17: "Integer_IO" is a nested package, not a compilation unit

  • Compiling JNI library with resource files (i.e. images)

    hi-
    i'm compiling a jni library on mac osx leopard using a command like:
    cc -g -dynamiclib -o libJNI.jnilib file1.o file2.o main.o -framework JavaVM -framework Foundation -framework AppKit -framework Cocoai'd like to include resource files like images in the build of the jni library. how can i compile those into the jni library?
    thanks,
    augusto.

    Creating shared libraries themselves are compiler/linker/OS problems.
    Not Java/JNI.
    So finding a forum that answers questions about the compiler/linker in use is the place to ask them.

  • [SOLVED] mingw32 cross compile won't link with static libraries

    Hi all,
    I'm trying to cross compile an app I have written to i486-mingw32.  I'm running Arch 64-bit (under which it compiles fine natively), and I have installed the mingw32 binaries along with mingw32-boost-static from AUR.
    All seems well, but unfortunately when I cross compile my code libtool refuses to link to the static Boost libraries:
    *** Warning: Trying to link with static lib archive /usr/i486-mingw32/lib/libboost_filesystem-mt-s.a.
    *** I have the capability to make that library automatically link in when
    *** you link to this library. But I can only do this if you have a
    *** shared version of the library, which you do not appear to have
    *** because the file extensions .a of this argument makes me believe
    *** that it is just a static archive that I should not use here.
    This then leads to undefined references as the library is not linked in.  But as I *want* the static version of the library, does anyone know how to tell libtool to accept the .a file and link it?
    Last edited by Malvineous (2011-05-02 02:44:48)

    Just to follow up on this, I discovered the problem.  It turns out libtool was doing the correct thing, and refusing to link the static library in with the shared one (otherwise later this could result in something being defined multiple times.)  The undefined references were unrelated to the error above, and the code that was causing them (in a different Boost header file) could be easily #defined out.
    When the time came to link the actual executables, libtool did include all the necessary libraries and everything worked as it should!

  • SoS, windows freezing when debugging jni code

    Somebody Help!!!!
    I am desperately trying to debug JNI code with MSDEV debugger.
    This is a flow:
    1. I run the java application from Msdev. Visual 6.0
    2. Insert a breakpoint in the first native method.
    3. The program successfully stops in the breakpoint.
    4. The "next" debugger command freezes WINDOWS :(
    I have tried all last jdk2 releases starting from 1.3 till 1.5.
    Any ideas ?
    10000000x in advance

    Cross-post:
    Duplicate post:
    http://forum.java.sun.com/thread.jspa?threadID=604754
    @OP: QUIT IT!

  • JVM core dump - JNI code

    I am using JNI in my Java application , 12 hours after running my test case get a JVM crash -
    1) These are the parameters with which i invoke my Java program
    java -d64 -Xcheck:jni -Xmx2560M -Xms2560M -Xss256k RunQueries
    2) The Heap output at the time of the core shows "from space" as 100% used , does this signify anything?
    Heap at VM Abort:
    Heap
    def new generation total 848128K, used 672342K [0xfffffffe93c00000, 0xfffffffec9150000, 0xfffffffec9150000)
    eden space 822464K, 78% used [0xfffffffe93c00000, 0xfffffffebb385b90, 0xfffffffec5f30000)
    from space 25664K, 100% used [0xfffffffec7840000, 0xfffffffec9150000, 0xfffffffec9150000)
    to space 25664K, 0% used [0xfffffffec5f30000, 0xfffffffec5f30000, 0xfffffffec7840000)
    tenured generation total 1747648K, used 1350866K [0xfffffffec9150000, 0xffffffff33c00000, 0xffffffff33c00000)
    the space 1747648K, 77% used [0xfffffffec9150000, 0xffffffff1b884830, 0xffffffff1b884a00, 0xffffffff33c00000)
    compacting perm gen total 16384K, used 13550K [0xffffffff33c00000, 0xffffffff34c00000, 0xffffffff37c00000)
    the space 16384K, 82% used [0xffffffff33c00000, 0xffffffff3493b860, 0xffffffff3493ba00, 0xffffffff34c00000)
    Local Time = Mon Feb 12 21:49:40 2007
    Elapsed Time = 61687
    # The exception above was detected in native code outside the VM
    # Java VM: Java HotSpot(TM) 64-Bit Server VM (1.4.2_07-b05 mixed mode)
    3) A dbx on the Java core shows the location in the JNI code where the core dump occured.
    dbx `which java` core
    For information about new features see `help changes'
    To remove this message, put `dbxenv suppress_startup_message 7.3' in your .dbxrc
    Reading java
    dbx: internal warning: writable memory segment 0x7cb00000[16384] of size 0 in core
    core file header read successfully
    Reading ld.so.1
    Reading libthread.so.1
    Reading libdl.so.1
    Reading libc.so.1
    Reading libc_psr.so.1
    Reading libjvm.so
    Reading libCrun.so.1
    Reading libsocket.so.1
    Reading libnsl.so.1
    Reading libm.so.1
    WARNING!!
    A loadobject was found with an unexpected checksum value.
    See `help core mismatch' for details, and run `proc -map'
    to see what checksum values were expected and found.
    dbx: warning: Some symbolic information might be incorrect.
    t@1 (l@1) terminated by signal ABRT (Abort)
    0xffffffff7eea822c: lwpkill+0x0008: bcc,a,pt %icc,_lwp_kill+0x18 ! 0xffffffff7eea823c
    Current function is Java_getLoid (optimized)
    7239 e = cod_to_long (*(o_object*) data, &loid_as_long);
    (dbx) where
    current thread: t@1
    [1] lwpkill(0x0, 0x6, 0xffffffffffffffe6, 0x0, 0x0, 0x0), at 0xffffffff7eea822c
    [2] raise(0x6, 0x0, 0xffffffff7fffad30, 0x7fbffeff00003ff6, 0x0, 0x2), at 0xffffffff7ee58a8c
    [3] abort(0x0, 0xffffffff7fffae10, 0x0, 0xfffffffffffffff8, 0x0, 0xffffffff7fffae39), at 0xffffffff7ee3e3b8
    [4] os::abort(0x1, 0xffffffff7e9d295c, 0xffffffff7fffaf10, 0xffffffff7e9d24a9, 0x4b007c, 0xffffffff7eb78878), at 0xffffffff7e90951c
    [5] os::handle_unexpected_exception(0x10011e600, 0xa, 0xfffffffe90345704, 0xffffffff7fffbeb0, 0xffffffff7e69c6f8, 0x0), at 0xffffffff7e907e08
    [6] JVM_handle_solaris_signal(0xffffffff7fffbeb0, 0xffffffff7e9d443e, 0xffffffff7fffbbd0, 0x1, 0x0, 0x1), at 0xffffffff7e69c800
    [7] __sighndlr(0xa, 0xffffffff7fffbeb0, 0xffffffff7fffbbd0, 0xffffffff7e69cb9c, 0x0, 0x0), at 0xffffffff7f2188d8
    ---- called from signal handler with signal 10 (SIGBUS) ------
    =>[8] Java_getLoid(vjEnv = ???, cls = ???, handle = ???, attr = ???) (optimized), at 0xfffffffe90345704 (line ~7239) in "j.c"
    I have added checks for this function call to ensure that no invalid pointer is being sent to it which could cause a segmentation violation.
    Please could someone give me some pointers on how to solve this problem, the error occurs at this point only 12 hours after running the test case..

    First step is to add the option -Xcheck:jni to your java command line. It will flag common JNI errors.
    If that doesn't identify the problem, then compile your jni code with debugging symbols (-g) and add the following option to the java command line when you run your test: -XX:+ShowMessageBoxOnError. When you hit the problem again, the VM will keep the process alive instead of calling abort(). Then you can use dbx to attach to the live process and should be able to get a better idea of what went wrong.

  • Compiling Java Servlet with Depricated Methods

    I have a problem of compiling Java servlets that contain depricated methods. If you compile against modern version of servlet.jar I see depricated methods error messages and if I use a very old servlet.jar it cannot find newer methods. What is is the best solution in this case?
    Thank you,
    Boris.

    The best thing to do would be compile your code with the -depreciated option to find which methods have been depreciated and the refactor your code to remove them.
    The next best thing is to ignore the messages (they are warnings not errors) and your code should still work

  • Cross-compiling desirable

    I would really like to see the ability in the Studio compilers to cross compile SPARC code on x86 and vice versa.
    This would incentivize the OpenSolaris engineering team to support cross-compilation as well, I believe.
    The reason for this is that my build host for SPARC is a lot slower than the Opteron system I have. I suspect that I'm not alone in this, and that some folks may have the reverse.
    Support for cross-compilation would probably also help ISVs out that want to support both ISAs. Imagine having a single build host to build a product for a bunch of platforms. Folks already do this for gcc.
    I realize that a link step or somesuch is going to require a copy of the OS libraries and headers be installed, but its easy to get those from OpenSolaris (or even a stock Solaris build just installed or copied to an alternate directory).
    The only thing we can't solve in OpenSolaris itself to do this is making the compilers (code generation, assembler, and optimization) able to cross-compile. If Studio had this feature (and it shouldn't be hard to add), then we'd be able to take the next step to enable cross-compilation of Solaris itself.

    I agree that it would be very desirable.
    I don't necessarily agree that it wouldn't be too hard; it depends on how the compiler was designed.
    That said, one could also envisage a cross-compiler to earlier versions of Solaris, which would be neat (and should in fact be easier to do than true cross compilation). Currently, production builds have to be done on a machine running the earliest version of Solaris that you want to support. Version-cross-compilation would allow you to do the build on a later version of Solaris, but generate a binary that would work from the earlier version.
    Just a thought.
    /lib

  • Debugging Jni Dll with VC6

    I'm having problems debugging my JNI DLL hosted by a tomcat application. Starting Tomcat under the vc debugger causes a lot of first chance exceptions (0c0000005) to be thrown by JVM.DLL. This happens before my jni dll is even loaded, here's a short dump :
    Nicht abgefangene Ausnahme in java.exe (JVM.DLL): 0xC0000005: Access Violation.
    Nicht abgefangene Ausnahme in java.exe (JVM.DLL): 0xC0000005: Access Violation.
    Nicht abgefangene Ausnahme in java.exe (JVM.DLL): 0xC0000005: Access Violation.
    Nicht abgefangene Ausnahme in java.exe (JVM.DLL): 0xC0000005: Access Violation.
    Nicht abgefangene Ausnahme in java.exe (JVM.DLL): 0xC0000005: Access Violation.
    Nicht abgefangene Ausnahme in java.exe (JVM.DLL): 0xC0000005: Access Violation.
    Geladene Symbole für "D:\Projekte\Applications\Winlog.web\tomcat\bin\JGimp.dll" überein. <----- my JNI DLL
    Nicht abgefangene Ausnahme in java.exe (JVM.DLL): 0xC0000005: Access Violation.
    Geladene Symbole für "D:\Projekte\Applications\Winlog.web\tomcat\bin\CGimp.dll"
    JVM seems to catch those itself, but needless to say, this is something that shouldn't happen.
    Any ideas ?
    Regards

    805541 wrote:
    Actually, this was a statement waiting for opinions...
    I can use VC2005, VC2008, WinDebug as well, same issue.
    And the real alternative is to have strict layering in the C code itself such that you shouldn't need to debug JNI itself at all.well, that's a strange comment. Is there any valid reason not to debug a jni DLL ?1. Because you can't. Say on a production system with strict install rules.
    2. Because you don't actually need to "debug" the JNI code itself because you maintain a strict boundary layer protocol. Thus bugs can normally only be expected in the functional C code (which allows for testing via other means.)
    3. Because it is difficult to do.
    And my favorite is because I would avoid JNI completely these days and instead use a separate executable that wraps the target functionality. Thus to discrete applications both which can be tested independently.
    When I used JNI in the past I never needed to use a debugger (because I followed item 2 in the above.)
    Other than that I can only see that you have two questions.
    1. You are asking if you are doing something wrong. You might suggest googling.
    2. You know you are not doing anything wrong and there is something 'wrong' with the VM. In that case get use to it. It isn't going away. Or at least not unless you have a sales contract and/or service contract with Sun/Oracle. And if you have that then this is site is not the appropriate way to use that.

  • JVM Seg Fault With Multithreaded JNI Code

    Hello all:
    I'm having a problem with a multi threaded application. The application is used to bridge an exsisting C++ application with an exsisting Java application so I went with a JNI implementation. After I completed my implementation, I found that the bridge would crash after a few hours (or a few million JNI calls). At first I thought there was a memory leak but my memory usage was not going up (according to the task manager) and the heap was staying around 3 MB (according to a third party tool). I finally figured out that the problem was my JNI code. The JNI code is all in a wrapper DLL (built with MinGW) that four other DLL's call dynamically. So I made a test app to test the wrapper dll. The test app is a simple two threaded application that creates a java object and deletes the java object. CODE:
    #include <process.h>
    #include "JNIUtilityInterface.h"  // Link to the JNI dll (GetProcAdress, etc.)
    void test(void * arg) {   
       for (int i = 0; i < 4000000; i++) {
          jobject jTest = createObjectByClass(NULL, "JNITest", "()V");
          deleteObject(jTest);
       int num = (int)arg;
       printf("done - %d\n", num);              
    int main(int argc, char *argv[])
       clearJNIUtilityDll();
       initJNIUtilityDll();
       invokeJVM();         
       for (int i = 0; i < 3; i++) {
          if (i == 0) {
             _beginthread(test, 0, (void*)i);
          } else {           
             _beginthread(test, 0, (void*)i);
       Sleep(240000);
       exitJNIUtilityDll();
       return 0;
    }createObjectByClass code:
    jobject JNIUtility_API createObjectByClass(jboolean * hasException, 
                                               const char * className, 
                                               const char * descriptor, va_list args) {                                                                                                                    
       jclass clazz;
       jmethodID mid;
       jobject obj;
       JNIEnv * env;
       env = getEnv();
       if (env != NULL) {  
          if (env->EnsureLocalCapacity(2) == JNI_OK) {
             jclass clazz = env->FindClass(className);                                                
             jmethodID mid = env->GetMethodID(clazz, "<init>", descriptor);       
             if (mid) {
                obj = env->NewObjectV(clazz, mid, args);                                             
             env->DeleteLocalRef(clazz);          
          if (hasException) {
             *hasException = env->ExceptionCheck();
       env = NULL;
       return obj;
    } getEnv code:
    JNIEnv * getEnv() {          
       JNIEnv * env;
       jint result;
       result = jvm->GetEnv((void **)&env, JNI_VERSION_1_4);
       if (result == JNI_EDETACHED) {
          if (jvm->AttachCurrentThreadAsDaemon((void **)&env, NULL) == JNI_OK) {
             //printf("Attached current thread!\n");
       return env;
    }deleteObject code:
    void JNIUtility_API deleteObject(jobject obj) {
       JNIEnv * env;
       env = getEnv();
       if (env != NULL) {                                                                                                                                               
          env->DeleteLocalRef(obj);
       env = NULL;                             
    }The other code is not important since I know this is where the seg fault is happening. Again this is just test code but when I run this code with only one thread, it works fine (with the 4000000 for loop). The JavaVM is globally cached as well.
    If anybody nows how to properly run two or more native threads that use JNI methods, please let me know or if you have any tips, that will be good too! If you want any more code to try for yourself, I'm willing to send it to you.
    Thanks!!

    Nevermind, I found out that if you build you code using jni.h from 1.5.0_06 and run you code using 1.5.0_04 JRE, you run into problems with multi threading! Don't do this because it leads to headaches and high blood pressure :)

  • Cross-compile generated C code

    Hello,
    I'm trying to cross-compile the C code generated from the uC SDK, but I'm getting undefined reference errors from the compiler.
    I'm using an ARM7 based embedded board with uCLinux and buildroot as cross compiler. I was able to cross compile the labview runtime library by adapting the makefile from the m5329evb example so far. But now when I try to cross compile the c code of my VI the compiler gives undefined reference errors.
    My question is, how do I make the the compiler use the built library and which parameters do I have to use?
    Here is command I used to compile my VI:
    ~/buildroot/buildroot-atmel/toolchain_build_arm_small/gcc-4.1.2-final/gcc/gcc-cross vi1.c -I/home/michael/buildroot/CCodeGen/include/blockdiagram/ -I/home/michael/buildroot/CCodeGen/include/frontpanel/ -I/home/michael/buildroot/CCodeGen/include/comms/ -I/home/michael/buildroot/CCodeGen/include/os/unix -I/home/michael/test/CcodeGen/ -L/home/michael/buildroot/CCodeGen/libsrc/main/ -L/home/michael/buildroot/CCodeGen/libsrc/blockdiagram/ -L/home/michael/buildroot/CCodeGen/libsrc/os/unix /home/michael/test2/libs/rt.a -DCHeadless -DUnix -w -o vi1
    Michael

    Hi Michael,
    lvEmbeddedMain.c is not a generated file. It is located in labview\CCodeGen\libsrc\main\lvEmbeddedMain.c. It is copied to the build folder in the labview\Targets\NI\Embedded\unix\unix_LEP_TargetPlugin\LEP_unix_CopySupportFiles.vi plug-in VI.
    What symbols are undefined?
    Michael P
    National Instruments

Maybe you are looking for

  • User changes in tab strip ui element are not recorded in context change log

    Hi All, We are using a tab strip ui element in webdynpro component. But user changes inside tab strip ui element are not getting recorded to the context change log. I have an input field on the same view besides  tab strip ui element. User changes to

  • OBIEE11g/10 shut down

    Hi Gurus,Very Urgent Please help me. We installed OBIEE10g and 11g on same box when we shut down bi presentation server of 10g, 11g Presentation server is also shutting down, We configured Satic ports.ini file. FYI: OBIEE 10g was installed on Weblogi

  • Managing OSB services with source Control

    I have a number of services developed within an OSB and all the files .proxy , .biz , etc are stored in my source control system. This works perfectly fine when one team is working on one service. However now we are looking at branching the service t

  • How do I remove i06 it is messing up my text messaging

    I send a text and all the phones in my family get the message.  They also receive all the messages

  • Upgraded to Mavericks, iPhoto won't update

    I upgraded to Mavericks but iPhoto won't update. Receive this message: "This update is not available for this Apple ID either because it was bought by a different user or the item was refunded or cancelled." I have only had one user name. I can't get