Causing the JNI code to crash "properly"

Hi,
I have some code written in C and liked to Java using JNI.
When I run it (even from the Visual C++ environment) and the code gets an exception in C, the JVM catches it and closes up nicely with an error.
What can I do to remove this behavior and let it crash - this will cause Visual C++ debugger to catch it and show me where the crash is.
Thanks,
Tsahi

Hi,
I've got 2 problems with this:
1. I'm writiing code in pure ANSI C - so try/catch doesn't work for me in the long run - just as a way of debugging a specific problem.
2. I need something that will crash - not something that will get over it, but something that will be able to show me the exact problem, along with a backtrace, values of variables, and the ability to use a debugger to check the memory while I'm at it.
I will try it though, so thanks a lot

Similar Messages

  • TS1702 what is causing the iboostup application to crash after the last upgrade?

    iboostup crashes and says that it is damaged on load.  software is uninstalled by deleting application, reboot mac, reinstall from app store.  problem remains with iboostup.  other software works fine.  downloaded another software from app store and it works too.

    That usually means that Windows notices that the program isn't responding.
    Start Firefox in <u>[[Safe Mode]]</u> to check if one of the extensions or if hardware acceleration is causing the problem (switch to the DEFAULT theme: Firefox (Tools) > Add-ons > Appearance/Themes).
    *Don't make any changes on the Safe mode start window.
    *https://support.mozilla.com/kb/Safe+Mode

  • Printing A Report Causes The System To Reboot / Crash

    Post Author: rhavlick
    CA Forum: Crystal Reports
    Hello,
       I'm not even sure where to start on this one - I built a few reports in CR XI, and deployed them to the customer's machines.  So far 2 out of the 10 at 2 seperate locations will have no problems displaying the report on the screen in the screen in the print preview control for .NET.  However, when the user presses Print, and selects just their normal HP Laserjet 4240n printer, it actually goes to the blue screen of death, and then reboots.  I upgraded to Crystal Reports 2008, and it's doing the same thing after installing the runtime on the user's machine.  Next I tested on another computer at the same office, with the same results to the same printer.  Next I tried to print to the Microsoft Office XPS Document Writer and that works from Crystal and then printing to the printer from that.  I also tried exporting from Crystal to PDF, and then printing from that which works too.  I updated drivers with the latest drivers, one is a HP and one is a Lexmark at 2 different not related locations.  It appears to be report dependent since some other reports work.
      Is there any way anyone knows how to trouble shoot this issue?
      Thanks.

    Post Author: rhavlick
    CA Forum: Crystal Reports
    It's taken me about a month and $600 to purchase printers and return them, etc. to finally get this figured out.  What is happening is if you have color on a report, and then print to a printer that doesn't support color printing it actually crashes the O.S.  I can't recreate this on all B&W printers, it only appears to happen on some, even though they have the same drivers, etc.
    I can strip out colors, and just leave it black white and grey and everything works on the one that was crashing.  What I am wondering is if anyone knows of a way I can force CR to print in B&W on a printer that only supports B&W either when it's printing or when it's rendering the report?  I do need the reports to be in color for the users with a color printer and it renders fine in color even if you don't have a color printer, but it blows up when you print.  Does anyone know if this is possible or have any suggestions regarding this?  Thanks.

  • How to set the vc 6.0 and netbean to debugger the jni code, thanks

    the above is the questions thanks.

    It's no longer where it was on Apple's servers - only 6.0.2 & 6.0.3 now.

  • I found what causes the 6800le blackscreen-safemode-crashing/problem

    I am very angry with MSI. Users of problematic msi or other 6800le brand cards please test.
    First of all install the Everest 1.5.1 program you can find it here http://www.lavalys.com/ then  after a clean boot(uninstall drivers& driver cleaner 3) run everest go to display/Gpu and check gpu clock and memory effective clock they are 200 for the gpu and 400 for the memory.
    As you can imagine these are the frequences this card is built to work at, but installing the drivers as we all know we have 300/700 so the card is higly overclocked at this freq that is why we have the locking black screen problems when we play anything in 3D and no problems when we underclock the cards down to 300/500 (sometimes with artifacts).
    I need an answer from MSI this is a faulty batch of cards out in the market and everyone says that is nothing wrong.
    I want everything I payed for. And an answer from MSI.
    Please I am sending my card to my local distributor tomorrow who told me that MSI told him that they never heard anything about problems with 6800le cards and I am afraid that he will send me a card with the same problem.
    Please MSI should be aware of this f@@@@ing problem.

    Hello,
    This is a User to user forum and MSI does not read or participate in these forums.
    Suggestions on posting and getting better answers
    I'm sure a user with that card would be happy to try what you are asking. But you may have to wait for someone to come along
    Your reseller should be the one contacting MSI on your issue, or you could send them an e-mail.
    I do not recall reading about this particular problem as the correct Core/Memory clocks are in fact 300/700.
    I think if any blame is to be shed here it is on nVidia as they supply the chipsets and the BIOS. MSI does not modify either at this point, especially this early in the product cycle. I could even go as far as speculating MSI is not even building these cards and nVidia is contract manufacturing them.
    The only card with 200/400 Core/Memory clock speeds is the FX 5200.

  • How to set debugger to debugger the jni code using  VC 6.0 and netbean

    thanks a lot.

    Thanks Brian.
    Well here is the next problem. I got a VI (attatched) off ni.com and it works fine on a windows98 platform. But quits working on NT.
    I can write perfectly (which i checked by hooking an LED display unit at the other end of the parallel port cable). I observed that the LEDs respond to the toggling of individual bits (data bits). But the error occures at the "out port.vi", when I try to run it on a NT machine (where I actually wanna use it). Are you aware of any changes to be made in order to run a VI on NT that works on 98?
    Thanks again.
    Pari.
    Attachments:
    parallelPortSwitcher.vi ‏124 KB

  • Abstract class causes JNI GetByteArrayElements to crash

    I'm having a problem with a subclass of an abstract class that is accessing a JNI function. I'm using Java 1.4.2.
    I started out with a single class that reads data from a serial port (via a JNI call) and then parses the data. When I test this class, the read/parse works correctly.
    Since I have to create multiple parsing protocols, I decided to create an abstract class that contained the reading functionality and a subclass that parses the data. When I did this, the 1st call to GetByteArrayElement never returns (nor do I get a stack dump trace).
    I also tried making the super-class non-abstract and over-writing the prase method(s). I got a similar failure.
    I can't imagine what the issue might be - why would splitting the original object into two (superclass/subclass) cause such a problem?
    I've include relevent snippits of code.
    Thanks for the help!
    ===== JNI Code =====
    extern JNIEXPORT jint JNICALL Java_vp_jni_Serial_read (JNIEnv *env,
         jclass class, jint fd, jbyteArray buf, jint cnt, jint offset)
         jboolean     iscopy = JNI_FALSE;
         // FAILS ON CALL; NEVER RETURNS!!!!
         const jbyte *data = GetByteArrayElements (env, buf, &iscopy);
         const uchar     *b;
         int               num,
                        rc;
         b = (uchar *) &data[offset];
         num = cnt;
         do
              rc = read (fd, (char *) b, num);
              if (handleReadException (env, rc) != 0)
                   (*env)->ReleaseByteArrayElements (env, buf, (jbyte *) data, 0);
                   return rc;
              num -= rc;
              b += rc;
         } while (num > 0);
         (*env)->ReleaseByteArrayElements (env, buf, (jbyte *) data, 0);
         return cnt;
    }==== Java Native Calls ====
    public class Serial
         public int read (byte[] data, int length, int offset)
              throws IOException
              return read (fd, data, length, offset);
         private static native int read (int fd, byte[] buf, int cnt, int offset)
              throws IOException;
    }==== Abstract super-class ====
    package vp.parse;
    import java.io.IOException;
    import java.io.InterruptedIOException;
    import java.io.SyncFailedException;
    import vp.jni.Serial;
    import vp.jni.Exec;
    import vp.data.ControlData;
    public abstract class Parse extends Thread
         protected static final int     ERROR = -1;
         private static final int     LOC_TIMEOUT = 3000;
         private Serial          link;
         private int               port;
         private boolean          running = false;
         private int               baud = Serial.B9600;
         protected abstract void reset ();
         protected abstract void parse ();
         public Parse (int port, String id, int baud)
              this.port = port;
              this.baud = baud;
              start ();
              synchronized (this)
                   try
                        wait (5000);
                   } catch (Exception e)
                        System.out.println (id + " Thread failed to synchronize");
              System.out.println ("Done");
         public void run ()
              link = new Serial(port);
              try
                   link.open();
                   link.setBaud (baud);
                   link.setTimeout (LOC_TIMEOUT);
              catch (Exception e )
                   link = null;
                   return;
              running = true;
              synchronized (this)
                   notify ();
              while (running)
                   parse ();
         protected int read (byte[] buf, int packetSize, int offset)
              if (offset >= packetSize)
                   offset = 0;
              if (offset > 0)
                   for (int i=0; i<packetSize - offset; i++)
                        buf[i] = buf[offset+i];
                   offset = packetSize - offset;
              try
                   int cnt = link.read (buf, packetSize - offset, offset);
                   offset = 0;          // all data is good
              // ready to 'close down' executable
              catch (Exception exp)
                   running = false;
                   return ERROR;
              return offset;
    }==== Sub-class to handle parsing ====
    package vp.parse;
    public class Eis extends Parse
         private static final int     PACKET_SIZE = 3 + 69 + 1;     // hdr, data, csum
         private byte[]          buffer = new byte[PACKET_SIZE];
         private int               offset = 0;
         public Eis (int port)
              super (port, "GR EIS", Serial.B9600);
         protected void reset ()
              offset = 0;
         protected void parse ()
              do
                   offset = read (buffer, PACKET_SIZE, offset);
                   if (offset == ERROR)
                        offset = 0;
                        return;
                   // parse code here
              } while (parse failed);
         public static void main (String[] argv)
              Eis e = new Eis (3);
              try { Thread.sleep (10000); } catch (Exception x) {}
    }

    The issue was the following:
    I had declared a buffer in the sub-class;
    private byte[] buffer = new byte[PACKET_SIZE];
    And the assumption would be that by the time it got used, it would be initialized. But that's not the case. Why?
    The sub-class called the super class constructor. At this point in time, buffer[] is not valid.
    The super class constructor spawns the child thread and waits for the spawned thread to finish initialization.
    The spawned thread creates the serial port, informs the constructor it's 'done' and starts to parse incoming data.
    The parse() code is the sub-class passes the uninitialized buffer to the JNI code and GetByteArrayElements crashes because id doesn't like a null pointer.
    Since the parent thread doesn't regain control to finish the construction, buffer[] never gets initialized.
    So much for synchronized thread spawning in a constructor...

  • [JNI Beginner] GC of Java arrays returned by the native code

    Hello all,
    I am beginning with JNI, to integrate a C library that pilots an industrial equipment, into a java UI. This library enables to exchange various proprietary PDUs (protocol data units), with the equipment, up and down (request/replies). Both requests and replies are arrays of bytes (+char*+).
    "Request" byte arrays are constructed by Java code, which passes them to the JNI code that glues with the lib. "Reply" byte arrays are returned to the Java code, which analyzes them.
    The "return reply" part is very similar to this [tutorial example|http://java.sun.com/developer/onlineTraining/Programming/JDCBook/jniexamp.html] , which returns bytes read from a file. However there's something I don't understand with regard to garbage collection of the returned byte array:
    - in this stock example, the C code creates a Java byte array fills it, and simply returns it (example code stripped to highlight only the parts relevant to my question):
        jByteArray=(*env)->NewByteArray(env, size);
        (*env)->SetByteArrayRegion(env, jByteArray, 0, size, (jbyte *)sourceBytes);
        return (jByteArray);What will happen to this Java array (jByteArray) with regard to garbage collection?
    - if it's no more referenced (the example Java code just systemouts it and forgets it), will it be eligible to GC?
    - if it is referenced by a Java variable (in my case, I plan to keep a reference to several replies as the business logic requires to analyze several of them together), do regular Java language GC rules apply, and prevent eligibility of the array to GC as long as it's referenced?
    That may sound obvious, but what mixes me up is that the same tutorial describes memory issues in subsequent chapters: spécifically, the section on "passing arrays states that:
    [in the example] the array is returned to the calling Java language method, which in turn, garbage collects the reference to the array when it is no longer usedThis seems to answer "yes" to both my questions above :o) But it goes on:
    The array can be explicitly freed with the following call:
    {code} (*env)-> ReleaseByteArrayElements(env, jByteArray, (jbyte *)sourceBytes, 0);{code}Under what circumstances would one need to explicitly free jByteArray when it's about to be returned to the Java calling method? Or does this sentence apply to completely different situations (such as, when the array is +not+ returned as is to a Java method)?
    The tutorial's next section has a much-expected +memory issues+ paragraph, from which I quote:
    By default, JNI uses local references when creating objects inside a native method. This means when the method returns, the references are eligible to be garbage collected.I assume this means, +unless the references are assigned, in the Java code, to a Java variable+, right?
    If you want an object to persist across native method calls, use a global reference instead. A global reference is created from a local reference by calling NewGlobalReference on the the local reference.I assume this enables the C code to maintain a global reference to a java object even if it's not referenced anymore from the Java variables, right?
    I also checked the [JNI specification|http://download-llnw.oracle.com/javase/6/docs/technotes/guides/jni/spec/design.html#wp1242] , but this didn't clear the doubt completely:
    *Global and Local References*
    The JNI divides object references used by the native code into two categories: local and global references. Local references are valid for the duration of a native method call, and are automatically freed after the native method returns. Global references remain valid until they are explicitly freed.
    Objects are passed to native methods as local references. All Java objects returned by JNI functions are local references. The JNI allows the programmer to create global references from local references. JNI functions that expect Java objects accept both global and local references. A native method may return a local or global reference to the VM as its resultAgain I assume the intent is that Global references are meant for objects that have to survive across native calls, regardless of whether they are referenced by Java code. But what worries me is that combining both sentences end up in +All Java objects returned by JNI functions are local references (...) and are automatically freed after the native method returns.+.
    Could you clarify how to make sure that my Java byte arrays, be they allocated in C code, behave consistently with a Java array allocated in Java code (I'm familiar already with GC of "regular" Java objects)?
    Thanks in advance, and best regards,
    J.

    jduprez wrote:
    Hello all,
    I am beginning with JNI, to integrate a C library that pilots an industrial equipment, into a java UI. This library enables to exchange various proprietary PDUs (protocol data units), with the equipment, up and down (request/replies). Both requests and replies are arrays of bytes (+char*+).
    "Request" byte arrays are constructed by Java code, which passes them to the JNI code that glues with the lib. "Reply" byte arrays are returned to the Java code, which analyzes them.
    The "return reply" part is very similar to this [tutorial example|http://java.sun.com/developer/onlineTraining/Programming/JDCBook/jniexamp.html] , which returns bytes read from a file. However there's something I don't understand with regard to garbage collection of the returned byte array:
    - in this stock example, the C code creates a Java byte array fills it, and simply returns it (example code stripped to highlight only the parts relevant to my question):
        jByteArray=(*env)->NewByteArray(env, size);
    (*env)->SetByteArrayRegion(env, jByteArray, 0, size, (jbyte *)sourceBytes);
    return (jByteArray);What will happen to this Java array (jByteArray) with regard to garbage collection?It will be collected when it is no longer referenced.
    The fact that you created it in jni doesn't change that.
    The array can be explicitly freed with the following call:
    (*env)-> ReleaseByteArrayElements(env, jByteArray, (jbyte *)sourceBytes, 0);Under what circumstances would one need to explicitly free jByteArray when it's about to be returned to the Java calling method? Or does this sentence apply to completely different situations (such as, when the array is not returned as is to a Java method)?
    Per what the tutorial says it is either poorly worded or just wrong.
    An array which has been properly initialized it a just a java object. Thus it can be freed like any other object.
    Per your original question that does not concern you because you return it.
    In terms of why you need to explicitly free local references.
    [http://download-llnw.oracle.com/javase/6/docs/technotes/guides/jni/spec/design.html#wp16785]
    The tutorial's next section has a much-expected memory issues paragraph, from which I quote:
    By default, JNI uses local references when creating objects inside a native method. This means when the method returns, the references are eligible to be garbage collected.I assume this means, unless the references are assigned, in the Java code, to a Java variable, right?As stated it is not precise.
    The created objects are tracked by the VM. When they are eligible to be collected they are.
    If you create a local reference and do NOTHING that creates an active reference elsewhere then when the executing thread returns to the VM then the local references are eligible to be collected.
    >
    If you want an object to persist across native method calls, use a global reference instead. A global reference is created from a local reference by calling NewGlobalReference on the the local reference.That is not precise. The scope is the executing thread. You can pass a local reference to another method without problem.
    I assume this enables the C code to maintain a global reference to a java object even if it's not referenced anymore from the Java variables, right?
    It enables access to it to be insured across multiple threads in terms of execution scope. Normally you should not use them.

  • 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.

  • JNI and Threads Crashes

    Hi,
    I am creating a Java app using JNI to call C++ libraries a vendor has provided for us. I used a pointer upon instantiation of the C++ object, store it in the Java side, and when I need to call a method in C, would de-reference that pointer to make function call.
    This works well in a standalone Java application. However, when I use a thread to call this object, or a servlet, it will get as far as letting me make one function call in C, but other calls afterwards will cause a core dump.
    Anyone experience this before? Please share any insight you might have. Thanks in advance.
    -Justin
    Here's the code:
    =======================================
    #include <jni.h>
    #include <iostream.h>
    #include "com_jni_JNIDSM_0005fServer.h"
    #include "DSMC_Server.h"
    //Java side: public static int cObjectID
    static jobject cls = 0;
    static jfieldID fid;
    * Class: JNIDSM_0005fServer
    * Method: DSM_Server
    * Signature: ()I
    * Create an instance of this object and return a reference handler (pointer).
    * REQUIRED: Need to call this method first before DSM_Server object can be used.
    JNIEXPORT jint JNICALL Java_com_jni_JNIDSM_1Server_DSM_1Server
    (JNIEnv* p_env, jobject p_obj)
    DSMC_Server* server;
    server = new DSMC_Server();
    cout << "ServerPtr Created = " << (jint)server << endl;
    Java_com_jni_JNIDSM_1Server_setCID(p_env, p_obj, (jint) server);
    return ((jint) server);
    * Class: JNIDSM_0005fServer
    * Method: connect
    * Signature: (Ljava/lang/String;ILjava/lang/String;I)I
    * Create connection from the DSM Client to the Server. Pass in host & port of Server and
    * name assigned to the module of the DSM Client.
    JNIEXPORT jint JNICALL Java_com_jni_JNIDSM_1Server_connect
    (JNIEnv* p_env, jobject p_obj, jstring p_host, jint p_port, jstring p_serverModuleName)
    // Obtain pointer reference to corresponding DSM objects
    DSMC_Server* serverPtr = (DSMC_Server*)
    Java_com_jni_JNIDSM_1Server_getCID (p_env, p_obj);
    // Convert the Java String to a Char pointer for use
    cout << "ServerPtr in JNI_connect() begin = " << (jint) serverPtr << endl;
    jboolean isModCopy, isHostCopy;
    const char* host = p_env->GetStringUTFChars(p_host, &isHostCopy);
    const char* serverModuleName = p_env->GetStringUTFChars(p_serverModuleName, &isModCopy);
    // Call the DSM_Server object's Connect() function
    jint status = (*serverPtr).Connect (host, p_port, serverModuleName);
    // Clean up object allocation for string copy after method is done
    if (isHostCopy == JNI_TRUE)
    p_env->ReleaseStringUTFChars(p_host, host);
    if (isModCopy == JNI_TRUE)
    p_env->ReleaseStringUTFChars(p_serverModuleName, serverModuleName);
    cout << "ServerPtr in JNI_connect() after = " << (jint) serverPtr << endl;
    return status;
    * Class: JNIDSM_0005fServer
    * Method: disconnect
    * Signature: (I)V
    * Disconnect from the Server.
    JNIEXPORT void JNICALL Java_com_jni_JNIDSM_1Server_disconnect
    (JNIEnv* p_env, jobject p_obj)
    // Obtain pointer reference to corresponding DSM objects
    DSMC_Server* serverPtr = (DSMC_Server*)
    Java_com_jni_JNIDSM_1Server_getCID (p_env, p_obj);
    cout << "ServerPtr in disconnect = " << (jint) serverPtr << endl;
    // Call the DSM_Server object's Disconnect() function
    (*serverPtr).Disconnect();
    * Class: JNIDSM_0005fServer
    * Method: doHeartbeat
    * Signature: (I)I
    * Check the status of the Server. Return status code that tells the caller Server' status.
    JNIEXPORT jint JNICALL Java_com_jni_JNIDSM_1Server_doHeartbeat
    (JNIEnv* p_env, jobject p_obj, jint p_serverPtr)
    // Obtain pointer reference to corresponding DSM objects
    DSMC_Server* serverPtr = (DSMC_Server*)
    Java_com_jni_JNIDSM_1Server_getCID (p_env, p_obj);
    // Call the DSM_Server object's DoHeartbeat() function
    jint status = (*serverPtr).DoHeartbeat();
    return status;
    * Class: JNIDSM_0005fServer
    * Method: getMaxPacketSize
    * Signature: (I)I
    * Return the packet size that are being sent through this network connection.
    JNIEXPORT jint JNICALL Java_com_jni_JNIDSM_1Server_getMaxPacketSize
    (JNIEnv* p_env, jclass p_class)
    // Obtain pointer reference to corresponding DSM objects
    DSMC_Server* serverPtr = (DSMC_Server*)
    Java_com_jni_JNIDSM_1Server_getCID (p_env, p_obj);
    // Call the DSM_Server object's GetMaxPacketSize() function
    jint packetSize = (*serverPtr).GetMaxPacketSize();
    return packetSize;
    * Class: com_jni_JNIDSM_0005fServer
    * Method: getCID
    * Signature: ()J
    JNIEXPORT jlong JNICALL Java_com_jni_JNIDSM_1Server_getCID
    (JNIEnv* p_env, jobject p_obj)
         jclass clazz;
         clazz = p_env->GetObjectClass(cls);
         fid = p_env->GetStaticFieldID(clazz, "cObjectID", "J");
    jint id = p_env->GetStaticLongField(clazz, fid);
    cout << "ServerPtr retrieved w/ getCID = " << id << endl;
    return id;
    * Class: com_jni_JNIDSM_0005fServer
    * Method: setCID
    * Signature: (J)V
    JNIEXPORT void JNICALL Java_com_jni_JNIDSM_1Server_setCID
    (JNIEnv* p_env, jobject p_obj, jint p_hndlr)
         jclass clazz;
         //create global reference
         if (cls == 0) {
              clazz = p_env->GetObjectClass(p_obj);
              if (clazz == 0) {
    cout << "Error occurred while getting class ref..."<< endl;
              cls = p_env->NewGlobalRef(p_obj);
              if (cls == 0) {
    cout << "Error occurred trying to create Global ref..."<< endl;
              fid = p_env->GetStaticFieldID(clazz, "cObjectID", "J");
         } else
              clazz = p_env->GetObjectClass(cls);
    p_env->SetStaticLongField(clazz, fid, p_hndlr);
    cout << "ServerPtr saved in setCID = " << p_hndlr << endl;
    }

    Thanks Tom for your help.
    After further debugging and trying new ideas, it turns out to be something really weird within the actual C++ object. I did a very basic execution to just connect and disconnect from the server all within one function. Even with one function call, it would crash. I'm going back to the vendor to let them figure it out.
    I've done my own examples of allocating dynamic arrays, setting & getting values, then deallocating it. There were no problems with threads then.
    I know I'm not going wacky, hopefully not, but who knows. Thanks again.
    Here's the simple code that crashed within a Java thread:
    void SomeJNIFunction(<params>) {
    jboolean isModCopy, isHostCopy, isAppCopy;
    const char* host = p_env->GetStringUTFChars(p_sHost, &isHostCopy);
    const char* sModuleName = p_env->GetStringUTFChars(p_sModName, &isModCopy);
    const char* sAppName = p_env->GetStringUTFChars(p_sAppName, &isAppCopy);
    jint status = 0;
    DSMC_Server serverPtr;
    DSMC_Event eventPtr;
    cout << "In JNI, ready to connect. Host=" << host << "|ModName=" << sModuleName
    << "|AppName=" << sAppName << endl;
    // connection attempt
    status = serverPtr.Connect (host, p_iPort, sModuleName);
    cout << "(JNI) Connected ..." << endl;
    //*************crash!!!!!!!********
              serverPtr.Disconnect();
    }

  • 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 :)

  • Why can see the jsp code in browser?

    Q1:
    I just setup completely the oracle application server downloading from OTN website.
    I have created a new OC4J instance 'appweb' in enterprise manager wizard form.
    I can look at the jsp code on the browse when I request the demo application instance.
    I try to deploy a WAR into the 'appweb' container that is been builded by the JBuilder 7 IDE,
    then I can't request all jsp page ,as the browser is normal getting the error 404 message ,but
    the jsp page is sure of.
    Q2:
    I want to change the http server Port ,but the application server can't been taken any request
    servies if change the Port number '7777' in the http.conf file. why for this ??? Be sure , I
    didn't change other configuration parameter.
    Please help me!
    thinks.

    Allaire JRun '%00' or '%2570' could allow an attacker to view the source code of JSP files
    Description:
    Allaire JRun is a program development suite used to create Web applications with Java Server Pages (JSP files) and Java Servlets. JRun versions 3.0 and 3.1 could allow a remote attacker to view the source code of known JSP files on the Web server. A remote attacker could send to the JRun Web Server (JWS) a URL request appended with '%00' or '%2570' for a known JSP file to cause the source code of the file to be returned.
    Platforms Affected:
    JRun 3.0
    JRun 3.1
    Remedy:
    Apply the appropriate patch for your system, as listed in Macromedia Product Security Bulletin MPSB01-15. See References.
    Consequences:
    Obtain Information
    References:
    Macromedia Product Security Bulletin MPSB01-15, "Patch Available for Revealing Source Code when Accessing a JSP as myjsp%00 or myjs%2570 via the JWS or IIS." at
    http://www.macromedia.com/v1/handlers/index.cfm?ID=22288&Method=Full
    or go to, http://www.iss.net/security_center/static/7676.php
    Sudha

  • Help! JNI code freezes inside printf() call

    Hi,
    I have a JDK 1.1.8 based java app that loads a JNI based dll. When I run the app from DOS prompt it is working fine. When I run the app from my IDE (i.e no access to console stdout/stdin), the app is freezing. So I launched VC++ 6x and attached to the Java app. Found that the JNI code that was trying to print trace messages using std C call "printf()" freeze inside printf().
    Is the lack of std dos command window an issue when running an app like this?
    I appreciate any pointers.
    Thanks
    Puri malluru

    Is the lack of std dos command window an issue when running an app like this?Could be. If the output is being redirected and the pipe is filling then the io method will block until the pipe clears. Perhaps the IDE has an output window that you need to open or init.

  • Can anyone help with isolating the cause of an InDesign CS5 crash?  It's intermittent...

    Hi All,
    I've got a client that's running into an intermittent crashing problem with InDesign.  Ordinarily "intermittent" points to hardware, but we wanted to rule out bad software first, especially as InDesign is the ONLY application that's crashing on this system.   The crashing doesn't seem to correspond to any given task that's executed within InDesign either.  This is an iMac 2.5 GHz Intel Core i5 (mid 2011 model), 8 GB of RAM.  Original this iMac was running Snow Leopard with InDesign CS5 (7.0.4), and crashing fequently then.  For numerous reasons including the crashing we did an erase and install of the OS, this time installing 10.8.2, and a fresh install of CS5 and ran all updates from Adobe (to 7.0.4), and then ran a Disk Permissions repair (we have not updated to 10.8.3 due to reports I've seen of more crashing with InDesign CS5).  Fonts and InDesign application support files from ~/Library were migrated over manually, but no other user data.  The crashing occurs within two user accounts on this fresh OS (one of which was created to troubleshoot with as a clean environment) so isn't likely user account related but due to fonts that may not be confirmed.  Being that it's intermittent it's been quite hard to track down.  Linotype Font Explorer is installed on this system and I have just now disabled the font activation plugins in case that is part of the problem here; haven't had a chance yet to let the system run without those to see if the problem is resolved.  Two recent crash logs (below) show different activity causing the crash (I've included thread 0 only, but can post more if requested; my experience has been that thread 0 will usually give you what you need, but given that we're seeing different cuases here I'm at a loss).  We have tried fresh RAM in the system in case this was related to bad memory, and that made no difference.  Font caches for both applications and the OS have been cleared and fonts showing any missing printer font files have been disabled.  Any help would be greatly apprecaited.  
    Many thanks,
    Mike
    Log 1:
    Process:         Adobe InDesign CS5 [11565]
    Path:            /Applications/Adobe InDesign CS5/Adobe InDesign CS5.app/Contents/MacOS/Adobe InDesign CS5
    Identifier:      com.adobe.InDesign
    Version:         7.0.4.553 (7040)
    Code Type:       X86 (Native)
    Parent Process:  launchd [238]
    User ID:         501
    Date/Time:       2013-05-02 12:45:38.327 -0700
    OS Version:      Mac OS X 10.8.2 (12C60)
    Report Version:  10
    Crashed Thread:  0  Dispatch queue: com.apple.main-thread
    Exception Type:  EXC_BAD_ACCESS (SIGBUS)
    Exception Codes: KERN_PROTECTION_FAILURE at 0x0000000000000004
    VM Regions Near 0x4:
    --> __PAGEZERO             0000000000000000-0000000000001000 [    4K] ---/--- SM=NUL  /Applications/Adobe InDesign CS5/Adobe InDesign CS5.app/Contents/MacOS/Adobe InDesign CS5
        __TEXT                 0000000000001000-0000000000005000 [   16K] r-x/rwx SM=COW  /Applications/Adobe InDesign CS5/Adobe InDesign CS5.app/Contents/MacOS/Adobe InDesign CS5
    Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
    0   com.adobe.InDesign.Links                0x11da9cfd 0x11d39000 + 462077
    1   com.adobe.InDesign.Links                0x11dad857 0x11d39000 + 477271
    2   com.adobe.InDesign.Links                0x11dabcc0 0x11d39000 + 470208
    3   com.adobe.InDesign.Links                0x11da96b9 0x11d39000 + 460473
    4   DataBaseLib.dylib                       0x010fd89f InterfaceSnapshot::ResetObjectToSnapshot(IDataBase*, IPMUnknown*, IDType<SnapshotID_tag>, ISnapshotCache*, scoped_lastrevinfodataref&) + 575
    5   ObjectModelLib.dylib                    0x01063b80 0x1038000 + 179072
    6   ObjectModelLib.dylib                    0x01070eb8 ShuksanInit(IStartupScreen* (*)(), IPlugIn*) + 23784
    7   DataBaseLib.dylib                       0x010ce158 0x10c9000 + 20824
    8   com.adobe.InDesign.Links                0x11d7b093 0x11d39000 + 270483
    9   com.adobe.InDesign.Links                0x11d7d991 0x11d39000 + 280977
    10  com.adobe.InDesign.Links                0x11d8ee5a 0x11d39000 + 351834
    11  com.adobe.InDesign.Links                0x11d9f17f 0x11d39000 + 418175
    12  com.adobe.InDesign.Links                0x11da016e 0x11d39000 + 422254
    13  com.adobe.InDesign.Links                0x11d78258 0x11d39000 + 258648
    14  com.adobe.InDesign.Links                0x11e05bbc GetPlugIn + 191420
    15  com.adobe.InDesign.Links                0x11e05836 GetPlugIn + 190518
    16  com.adobe.InDesign.Document Framework          0x0d937a85 0xd936000 + 6789
    17  com.adobe.InDesign.Document Framework          0x0d937b75 0xd936000 + 7029
    18  com.adobe.InDesign.AppFramework          0x0bbb60ed GetPlugIn + 201661
    19  com.adobe.InDesign.Links                0x11d71025 0x11d39000 + 229413
    20  com.adobe.InDesign.Links                0x11d70d6c 0x11d39000 + 228716
    21  ObjectModelLib.dylib                    0x01062640 0x1038000 + 173632
    22  ObjectModelLib.dylib                    0x010651bb 0x1038000 + 184763
    23  com.adobe.InDesign.Document Framework          0x0d9d0ed0 0xd936000 + 634576
    24  com.adobe.InDesign.Links                0x11dc53f8 0x11d39000 + 574456
    25  com.adobe.InDesign.Document Framework          0x0d937a85 0xd936000 + 6789
    26  com.adobe.InDesign.Document Framework          0x0d937b75 0xd936000 + 7029
    27  com.adobe.InDesign.AppFramework          0x0bbb60ed GetPlugIn + 201661
    28  PublicLib.dylib                         0x01161d6c UIDList::ReadWrite(IPMStream*, UIDList::EXferType) + 204
    29  PublicLib.dylib                         0x01161f50 UIDList::ReadWriteXferReference(IPMStream*) + 32
    30  com.adobe.InDesign.Links                0x11db2d49 0x11d39000 + 499017
    31  ObjectModelLib.dylib                    0x01062640 0x1038000 + 173632
    32  ObjectModelLib.dylib                    0x01065ab5 0x1038000 + 187061
    33  com.adobe.InDesign.Document Framework          0x0d9d13ec 0xd936000 + 635884
    34  com.adobe.InDesign.Document Framework          0x0d9d0c1e 0xd936000 + 633886
    35  com.adobe.InDesign.Generic Page Item          0x117a0a86 GetPlugIn + 149142
    36  PublicLib.dylib                         0x01164422 Command::DoImmediate(short) + 34
    37  com.adobe.InDesign.Utilities            0x0ce10aa3 0xce0f000 + 6819
    38  com.adobe.InDesign.Utilities            0x0ce10ccc 0xce0f000 + 7372
    39  com.adobe.InDesign.AppFramework          0x0bb7a688 0xbb60000 + 108168
    40  PublicLib.dylib                         0x0116557b CmdUtils::ProcessCommand(ICommand*) + 59
    41  com.adobe.InDesign.Document Framework          0x0d952c6d 0xd936000 + 117869
    42  PublicLib.dylib                         0x01164422 Command::DoImmediate(short) + 34
    43  com.adobe.InDesign.Utilities            0x0ce10aa3 0xce0f000 + 6819
    44  com.adobe.InDesign.Utilities            0x0ce10ccc 0xce0f000 + 7372
    45  com.adobe.InDesign.AppFramework          0x0bb7a688 0xbb60000 + 108168
    46  PublicLib.dylib                         0x0116557b CmdUtils::ProcessCommand(ICommand*) + 59
    47  PublicLib.dylib                         0x01163cd1 CompoundSequenceCmd::Do() + 369
    48  PublicLib.dylib                         0x01164422 Command::DoImmediate(short) + 34
    49  com.adobe.InDesign.Utilities            0x0ce10aa3 0xce0f000 + 6819
    50  com.adobe.InDesign.Utilities            0x0ce10ccc 0xce0f000 + 7372
    51  com.adobe.InDesign.AppFramework          0x0bb7a688 0xbb60000 + 108168
    52  PublicLib.dylib                         0x0116557b CmdUtils::ProcessCommand(ICommand*) + 59
    53  com.adobe.InDesign.AppFramework          0x0bb83bef 0xbb60000 + 146415
    54  PublicLib.dylib                         0x01164422 Command::DoImmediate(short) + 34
    55  com.adobe.InDesign.Utilities            0x0ce10aa3 0xce0f000 + 6819
    56  com.adobe.InDesign.Utilities            0x0ce10ccc 0xce0f000 + 7372
    57  com.adobe.InDesign.AppFramework          0x0bb7a688 0xbb60000 + 108168
    58  PublicLib.dylib                         0x0116557b CmdUtils::ProcessCommand(ICommand*) + 59
    59  com.adobe.InDesign.AppFramework          0x0bb83bef 0xbb60000 + 146415
    60  PublicLib.dylib                         0x01164422 Command::DoImmediate(short) + 34
    61  com.adobe.InDesign.Utilities            0x0ce10aa3 0xce0f000 + 6819
    62  com.adobe.InDesign.Utilities            0x0ce10ccc 0xce0f000 + 7372
    63  com.adobe.InDesign.AppFramework          0x0bb7a688 0xbb60000 + 108168
    64  PublicLib.dylib                         0x0116557b CmdUtils::ProcessCommand(ICommand*) + 59
    65  com.adobe.InDesign.Widgets              0x0e99304b GetPlugIn + 211323
    66  com.adobe.InDesign.Widgets              0x0e996386 GetPlugIn + 224438
    67  com.adobe.InDesign.Widgets              0x0e995fc0 GetPlugIn + 223472
    68  PublicLib.dylib                         0x0117982b CScrapSuite_Extensible::Paste(IClipboardController*, IControlView*, short) + 219
    69  com.adobe.InDesign.Application UI          0x0d3d1ff4 0xd3af000 + 143348
    70  com.adobe.InDesign.Application UI          0x0d3d2f05 0xd3af000 + 147205
    71  com.adobe.InDesign.Application UI          0x0d3d0abc 0xd3af000 + 137916
    72  com.adobe.InDesign.Application UI          0x0d433632 GetPlugIn + 217730
    73  com.adobe.InDesign.Actions              0x13d30de3 GetPlugIn + 11699
    74  com.adobe.InDesign.Actions              0x13d1eccc 0x13d1d000 + 7372
    75  WidgetBinLib.dylib                      0x02880334 MDefaultEH::KeyboardShortcut(IEvent*) + 484
    76  WidgetBinLib.dylib                      0x0287fb34 CDefaultEH::KeyDown(IEvent*) + 148
    77  WidgetBinLib.dylib                      0x02880133 MDefaultEH::KeyDown(IEvent*) + 163
    78  PublicLib.dylib                         0x01184bee CEventDispatcher::DispatchToEventHandlers(IEvent*) + 222
    79  PublicLib.dylib                         0x011846a8 CEventDispatcher::DispatchEvent(IEvent*, IEvent::SystemHandledState) + 24
    80  com.adobe.InDesign.Application UI          0x0d446b99 GetPlugIn + 296937
    81  com.adobe.InDesign.Application UI          0x0d4445dc GetPlugIn + 287276
    82  com.apple.HIToolbox                     0x9995cb6b _InvokeEventHandlerUPP(OpaqueEventHandlerCallRef*, OpaqueEventRef*, void*, long (*)(OpaqueEventHandlerCallRef*, OpaqueEventRef*, void*)) + 36
    83  com.apple.HIToolbox                     0x997e4594 DispatchEventToHandlers(EventTargetRec*, OpaqueEventRef*, HandlerCallRec*) + 1343
    84  com.apple.HIToolbox                     0x997e3980 SendEventToEventTargetInternal(OpaqueEventRef*, OpaqueEventTargetRef*, HandlerCallRec*) + 430
    85  com.apple.HIToolbox                     0x997f7855 SendEventToEventTarget + 88
    86  com.apple.HIToolbox                     0x998178b2 ToolboxEventDispatcherHandler(OpaqueEventHandlerCallRef*, OpaqueEventRef*, void*) + 2392
    87  com.apple.HIToolbox                     0x997e4a3f DispatchEventToHandlers(EventTargetRec*, OpaqueEventRef*, HandlerCallRec*) + 2538
    88  com.apple.HIToolbox                     0x997e3980 SendEventToEventTargetInternal(OpaqueEventRef*, OpaqueEventTargetRef*, HandlerCallRec*) + 430
    89  com.apple.HIToolbox                     0x997f7855 SendEventToEventTarget + 88
    90  com.apple.HIToolbox                     0x997d9077 SendTSMEvent + 75
    91  com.apple.HIToolbox                     0x997d8b0b SendUnicodeTextAEToUnicodeDoc + 745
    92  com.apple.HIToolbox                     0x997d8704 TSMKeyEvent + 980
    93  com.apple.HIToolbox                     0x998281e5 TSMProcessRawKeyEvent + 3102
    94  com.apple.HIToolbox                     0x99868ec5 HandleCompatibilityKeyEvent + 323
    95  com.apple.HIToolbox                     0x997e0aba HIApplication::EventHandler(OpaqueEventHandlerCallRef*, OpaqueEventRef*, void*) + 7318
    96  com.apple.HIToolbox                     0x9995cb6b _InvokeEventHandlerUPP(OpaqueEventHandlerCallRef*, OpaqueEventRef*, void*, long (*)(OpaqueEventHandlerCallRef*, OpaqueEventRef*, void*)) + 36
    97  com.apple.HIToolbox                     0x997e4594 DispatchEventToHandlers(EventTargetRec*, OpaqueEventRef*, HandlerCallRec*) + 1343
    98  com.apple.HIToolbox                     0x997e3980 SendEventToEventTargetInternal(OpaqueEventRef*, OpaqueEventTargetRef*, HandlerCallRec*) + 430
    99  com.apple.HIToolbox                     0x997e37ca SendEventToEventTargetWithOptions + 94
    100 com.apple.HIToolbox                     0x9981738c ToolboxEventDispatcherHandler(OpaqueEventHandlerCallRef*, OpaqueEventRef*, void*) + 1074
    101 com.apple.HIToolbox                     0x997e4a3f DispatchEventToHandlers(EventTargetRec*, OpaqueEventRef*, HandlerCallRec*) + 2538
    102 com.apple.HIToolbox                     0x997e3980 SendEventToEventTargetInternal(OpaqueEventRef*, OpaqueEventTargetRef*, HandlerCallRec*) + 430
    103 com.apple.HIToolbox                     0x997f7855 SendEventToEventTarget + 88
    104 com.adobe.InDesign.AppFramework          0x0bb62fd5 0xbb60000 + 12245
    105 com.adobe.InDesign.AppFramework          0x0bb884fa GetPlugIn + 14282
    106 com.adobe.InDesign                      0x0000288b main + 187
    107 com.adobe.InDesign                      0x000027a6 start + 54
    Log 2:
    Process:         Adobe InDesign CS5 [745]
    Path:            /Applications/Adobe InDesign CS5/Adobe InDesign CS5.app/Contents/MacOS/Adobe InDesign CS5
    Identifier:      com.adobe.InDesign
    Version:         7.0.4.553 (7040)
    Code Type:       X86 (Native)
    Parent Process:  launchd [142]
    User ID:         501
    Date/Time:       2013-05-07 15:00:42.593 -0700
    OS Version:      Mac OS X 10.8.2 (12C60)
    Report Version:  10
    Crashed Thread:  0  Dispatch queue: com.apple.main-thread
    Exception Type:  EXC_BAD_ACCESS (SIGBUS)
    Exception Codes: KERN_PROTECTION_FAILURE at 0x0000000000000000
    VM Regions Near 0:
    --> __PAGEZERO             0000000000000000-0000000000001000 [    4K] ---/--- SM=NUL  /Applications/Adobe InDesign CS5/Adobe InDesign CS5.app/Contents/MacOS/Adobe InDesign CS5
        __TEXT                 0000000000001000-0000000000005000 [   16K] r-x/rwx SM=COW  /Applications/Adobe InDesign CS5/Adobe InDesign CS5.app/Contents/MacOS/Adobe InDesign CS5
    Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
    0   com.adobe.InDesign.Text                 0x0ff26f59 GetPlugIn + 1072585
    1   com.adobe.InDesign.Text                 0x0ff2c0eb GetPlugIn + 1093467
    2   com.adobe.InDesign.Text                 0x0ff2c1ef GetPlugIn + 1093727
    3   com.adobe.InDesign.Text                 0x0ff2c2c7 GetPlugIn + 1093943
    4   DataBaseLib.dylib                       0x010fd89f InterfaceSnapshot::ResetObjectToSnapshot(IDataBase*, IPMUnknown*, IDType<SnapshotID_tag>, ISnapshotCache*, scoped_lastrevinfodataref&) + 575
    5   ObjectModelLib.dylib                    0x01063b80 0x1038000 + 179072
    6   ObjectModelLib.dylib                    0x01070eb8 ShuksanInit(IStartupScreen* (*)(), IPlugIn*) + 23784
    7   DataBaseLib.dylib                       0x010ce158 0x10c9000 + 20824
    8   com.adobe.InDesign.Text                 0x0ff2e909 GetPlugIn + 1103737
    9   com.adobe.InDesign.Text                 0x1004932e GetPlugIn + 2261406
    10  com.adobe.InDesign.Text                 0x0fe3fcba GetPlugIn + 125738
    11  com.adobe.InDesign.Text                 0x0fe400ff GetPlugIn + 126831
    12  com.adobe.InDesign.Text                 0x0fec3876 GetPlugIn + 665318
    13  PublicLib.dylib                         0x01164422 Command::DoImmediate(short) + 34
    14  com.adobe.InDesign.Utilities            0x0ce3baa3 0xce3a000 + 6819
    15  com.adobe.InDesign.Utilities            0x0ce3bccc 0xce3a000 + 7372
    16  com.adobe.InDesign.AppFramework          0x0bb7a688 0xbb60000 + 108168
    17  com.adobe.InDesign.AppFramework          0x0bb6cf11 0xbb60000 + 53009
    18  com.adobe.InDesign.AppFramework          0x0bb62f0e 0xbb60000 + 12046
    19  com.adobe.InDesign.AppFramework          0x0bb884fa GetPlugIn + 14282
    20  com.adobe.InDesign                      0x0000288b main + 187
    21  com.adobe.InDesign                      0x000027a6 start + 54

    Thanks, Peter. 
    The "link related" and "text related" crashes were what I interpretted here, too, though I'm at a loss on how to proceed given that this is a fresh system and applications.  This is happening with multiple InDesign projects in a design office environment where many others work on the same files and none of the other computers are having problems with these files.  I've removed the same files listed (thank you for those) before and did so effectively with creating the new user account to test with, but it had no effect.  I just tried again though, as these files could easily have becone corrupt again if they were being written to when InDesign crashed.  Will let you know if that makes any difference.  I've also gone through and completely cleaned out the fonts again and once more cleared the font caches.  If need be I'll reboot this system into safe mode and try that way.
    Best,
    Mike

  • NewObject crash in a PLI/C/JNI code

    Hi,
    i call NewObject() function in a PLI/C/JNI app to create a java/lang/Vector instance.My Verilog simulator (ModelSim PE 5.4b) crash without display an error code.
    Please take a look , and see what is wrong with my code.
    jclass jclass_Vector;
    jmethodID jmethodID_Vector_new;
    jclass_Vector=_env->FindClass("java/util/Vector");
    if(jclass_Vector==NULL){
    return ;
    jmethodID_Vector_new=_env->GetMethodID(jclass_Vector,"<init>","()V");
    if(jmethodID_Vector_new==NULL){
    return ;
    jobject dataVector;
    dataVector=_env->NewObject(jclass_Vector,jmethodID_Vector_new);
    Thanks in advance,
    Marius

    As far as I can tell, there's nothing wrong with the small snippet of code that you've posted. The problem is elsewhere. Try making a small sample program that demonstrates the failure.
    Also, take a look at Jace - http://jace.reyelts.com/jace
    The equivalent code would be:
    // Create a new Vector
    Vector dataVector(); A lot simpler...
    God bless,
    -Toby Reyelts

Maybe you are looking for