Crash in call to Native function

I am trying to use the JNIEXPORT from my Java Applet. At the point of call to the JNIEXPORT function my applet terminates without any error / crash dialog.
I am not sure what is happening with it. Please guide.

You're trying to invoke native code in an applet? That's not legal unless the applet is signed, and you have configured the SecurityManager, and the user grants the applet permission to run.
Right?

Similar Messages

  • Calling a native function from a dll

    Hi all,
    I want to call an api function exported from a dll using java. For example l like to call a function from kernel.dll (Windows). How can i do this. Do i have to create another dll for this?

    hi,
    you need to use JNI
    you have to create de DLL , and call kernel32.dll in.
    like that:
    java_class.class ==> first_dll.dll ==> kernel32.dll

  • Call native function fflush & strprn from java

    Hi,
    I need to call a native function fflush and stdprn from java for printing a file.
    How can i call this function?
    Can any one help me with sample code.
    Thanks,
    rpalanivelu

    Thanks your reply,
    Actually my problem is need to take printout using dot matrix printer(text printer) with different font size.
    So, i am using native method which is available in c.
    in c program i am using fflush,stdprn and fprintf.
    Here i've attached my sample program also.
    #include <jni.h>
    #include "NativePrint.h"
    #include <stdio.h>
    #include <string.h>
    #include <stdlib.h>
    #define MAXLINE_LEN 100
    JNIEXPORT jint JNICALL
    Java_NativePrint_dotMatrixPrint(JNIEnv* env, jobject obj )
    FILE *fp;
    char filename[20];
    char line[100]; /* A line read from the file */
    int lineNumber = 0;
    /* Print control codes */
    char boldOn = 14;
    char boldOff = 20;
    char contentlenOn = 15;
    char contentlenOff = 18;
    printf("Printing from C3");
    strcpy( filename , "sayHello.c" );
    /* Open the file in read mode */
    fp = fopen( filename , "r" );
    /* Error in opening file, then exit */
    if ( fp == NULL )
    printf( "\nERROR: %s cannot be opened\n" , filename );
    exit( 1 );
    while ( fgets( line , 100 , fp ) != NULL )
    lineNumber++; /* Line we are about to process next */
    printf("%s",line);
    /* If this is the first line */
    if ( lineNumber == 1 )
    /* then print it in bold */
    //fprintf( stdprn , "%c" , boldOn );
    fprintf( stdprn , "%c" , contentlenOn );
    fprintf( stdprn , line );
    fprintf( stdprn , "%c" , contentlenOff);
    //fprintf( stdprn , "%c" , boldOff );
    else
    /* else print it in normal mode */
    fprintf( stdprn , line );
    fflush(stdprn);
    return 0;

  • Calling native functions from java w/out DLL

    If I invoke a JVM inside my c++ app and try to start up a class that calls a native function, do I still need a DLL for that? Or will it look to my header file and then look to my implementation somewhere in a c++ class?
    For example:
    WinMain() - Invokes JVM and loads "HelloWorld" java class, then calls its 'main' method.
    HelloWorld.java - 'main' method calls "displayHello();" a native function.
    HelloWorld.h - defines displayHello native interface
    So it looks simply to the cpp implementation of the interface...I tried executing this but it isnt working...is it even possible?

    OK, I attempted what you posted by writing the following code... please look at because I get a 'main' not found error. I am trying to execute this from a win32 app...
    Callbacks.java:
    class Callbacks {
      private native void nativeMethod(int depth);
      private void callback(int depth) {
        if (depth < 5) {
          System.out.println("In Java, depth = " + depth + ", about to enter C");
          nativeMethod(depth + 1);
          System.out.println("In Java, depth = " + depth + ", back from C");
        } else
          System.out.println("In Java, depth = " + depth + ", limit exceeded");
      public static void main(String args[]) {
        Callbacks c = new Callbacks();
        c.nativeMethod(0);
    }InvokeJVM.cpp:
    #include "InvokeJVM.h"
    //Log any windows errors
    void InvokeJVM::LogWin32Error(const char * pTitle){
         PCHAR pBuffer;   
         LONG  lError = GetLastError ( );
         FormatMessage ( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM,
              NULL,                   
              lError,                   
              MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),                   
              (char *)&pBuffer,                   
              0,                   
              NULL );
         //LogError ("Win32 error: %s %s\n",pBuffer,pTitle);
         LocalFree ( pBuffer );
    //Get a string returned from the windows registry
    bool InvokeJVM::GetStringFromRegistry(HKEY key, const char *name, unsigned char *buf, int bufsize){
         DWORD type, size;
         if (RegQueryValueEx(key, name, 0, &type, 0, &size) == 0 && type == REG_SZ && (size < (unsigned int)bufsize)){
              if (RegQueryValueEx(key, name, 0, 0, buf, &size) == 0){
                   return true;
         return false;
    //Get the path to the runtime environment
    bool InvokeJVM::GetPublicJREHome(char *buf, int bufsize){
         HKEY key, subkey;   
         char version[MAX_PATH];  
         /* Find the current version of the JRE */
         if(RegOpenKeyEx(HKEY_LOCAL_MACHINE, JRE_KEY,0,KEY_READ,&key)!=0){
              //LogError("Error opening registry key '" JRE_KEY "'\n");          
              return false;   
         if(!GetStringFromRegistry(key,"CurrentVersion",(unsigned char *)version, sizeof(version))){
              //LogError("Failed reading value of registry key:\n\t"JRE_KEY "\\CurrentVersion\n");          
              RegCloseKey(key);          
              return false;   
         if(strcmp(version, DOTRELEASE)!= 0){
              //LogError("Registry key '" JRE_KEY "\\CurrentVersion'\nhas value '%s', but '" DOTRELEASE "' is required.\n", version);
              RegCloseKey(key);          
              return false;   
         /* Find directory where the current version is installed. */   
         if(RegOpenKeyEx(key,version,0,KEY_READ, &subkey)!= 0){
              //LogError("Error opening registry key '"JRE_KEY "\\%s'\n", version);          
              RegCloseKey(key);          
              return false;   
         if(!GetStringFromRegistry(subkey, "JavaHome", (unsigned char *)buf, bufsize)){
              //LogError("Failed reading value of registry key:\n\t"JRE_KEY "\\%s\\JavaHome\n", version);          
              RegCloseKey(key);          
              RegCloseKey(subkey);          
              return false;   
         RegCloseKey(key);   
         RegCloseKey(subkey);   
         return true;
    //Native interface call to printf
    jint JNICALL _vfprintf_(FILE *fp, const char *format, va_list args){
         //LogError(format,args);     
         return 0;
    //Native interface call if the VM exited
    void JNICALL _exit_(jint code){     
         //LogError("VM exited");     
         exit(code);
    //Native interface call if the VM aborted
    void JNICALL _abort_(void){
         //LogError("VM aborted");     
         abort();
    //Load the Java Virtual Machine
    void InvokeJVM::LoadJVM(char* dir){
         HINSTANCE handle;     
         JavaVMOption options[5];     
         char JREHome[MAX_PATH];     
         char JVMPath[MAX_PATH];                                             
         char classpathOption[MAX_PATH];     
         char librarypathOption[MAX_PATH];
         if(!GetPublicJREHome(JREHome, MAX_PATH)){          
              //LogError("Could not locate JRE");          
              abort();     
         strcpy(JVMPath,JREHome);     
         strcat(JVMPath,"\\jre\\bin\\client\\jvm.dll");
         if ((handle=LoadLibrary(JVMPath))==0) {          
              //LogError("Error loading: %s", JVMPath);          
              abort();   
         CreateJavaVM_t pfnCreateJavaVM=(CreateJavaVM_t)GetProcAddress(handle,"JNI_CreateJavaVM");
         if (pfnCreateJavaVM==0){          
              //LogError("Error: can't find JNI interfaces in: %s",JVMPath);          
              abort();     
         strcpy(classpathOption,"-Djava.class.path=");
         strcat(classpathOption,dir);     
         strcat(classpathOption,";");     
         strcat(classpathOption,JREHome);     
         strcat(classpathOption,"\\lib");     
         strcat(classpathOption,";");
         strcat(classpathOption,JREHome);     
         strcat(classpathOption,"\\lib\\comm.jar");     
         strcpy(librarypathOption,"-Djava.library.path=");     
         strcat(librarypathOption,JREHome);     
         strcat(librarypathOption,"\\lib");
         OutputDebugString("classpath option=");     
         OutputDebugString(classpathOption);     
         OutputDebugString("\n");     
         OutputDebugString("librarypath option=");     
         OutputDebugString(librarypathOption);     
         OutputDebugString("\n");
         options[0].optionString=classpathOption;
         options[1].optionString=librarypathOption;          
         options[2].optionString="vfprintf";     
         options[2].extraInfo=_vfprintf_;     
         options[3].optionString="exit";     
         options[3].extraInfo=_exit_;     
         options[4].optionString="abort";     
         options[4].extraInfo=_abort_;
         vmArgs.version = JNI_VERSION_1_2;
         vmArgs.nOptions = 5;   
         vmArgs.options  = options;  
         vmArgs.ignoreUnrecognized = false;
         if(pfnCreateJavaVM(&jvm,(void**)&env, &vmArgs) != 0){
              //LogError("Could not create VM");
              abort();     
    }Winmain.cpp:
    #define WIN32_MEAN_AND_LEAN
    #define WIN32_EXTRA_LEAN
    #include <windows.h>
    #include "oglwindow.h"          // the OpenGL window class
    #include "vector.h"
    #include "engine.h"               // the engine's main class
    #include "BrimstoneEngine.h"
    #include "InvokeJVM.h"
    JNIEXPORT void JNICALL Java_HelloWorld_displayHelloWorld(JNIEnv *, jobject){
        MessageBox(NULL, "Hello From Java!", "Error", MB_OK);
        return;
    JNIEXPORT void JNICALL Java_Callbacks_nativeMethod(JNIEnv *env, jobject obj, jint depth){
      jclass cls = env->GetObjectClass(obj);
      jmethodID mid = env->GetMethodID(cls, "callback", "(I)V");
      if (mid == 0) {
        return;
      printf("In C, depth = %d, about to enter Java\n", depth);
      env->CallVoidMethod(obj, mid, depth);
      printf("In C, depth = %d, back from Java\n", depth);
    JNINativeMethod methods[] = {"nativeMethod","()V", Java_Callbacks_nativeMethod};
    WINAPI WinMain(HINSTANCE hInst, HINSTANCE, LPSTR, int nCmdShow){
         InvokeJVM javaVirtualMachine;
         int loopRet;
         javaVirtualMachine.running = false;
         CoInitialize(NULL);
         if (!COGLWindow::RegisterWindow(hInst)){
              MessageBox(NULL, "Failed to register window class", "Error", MB_OK);
              return -1;
         BrimstoneEngine *engine = NULL;
         try{
              char path[MAX_PATH];  
              char drive[MAX_PATH];   
              char file[MAX_PATH];   
              char dir[MAX_PATH];   
              char ext[MAX_PATH];
              jclass  cls, cls1;     
              jmethodID mid;     
              jobjectArray args;
              jint err;
              _splitpath(path,drive,dir,file,ext);          
              javaVirtualMachine.LoadJVM(dir);     
              if(javaVirtualMachine.env == NULL){               
                   MessageBox(NULL, "Could not load VM", "Error", MB_OK);
                   abort();          
              if(GetModuleFileName(NULL, path, MAX_PATH) == 0){               
                   javaVirtualMachine.LogWin32Error("Getting module filename");          
                   abort();          
              cls = javaVirtualMachine.env->FindClass("Callbacks");
              if(cls == NULL){               
                   MessageBox(NULL, "Could not find class %s (or its superclass)", "Error", MB_OK);
                   exit(-1);          
              err = javaVirtualMachine.env->RegisterNatives(cls, methods, 1 );
              mid = javaVirtualMachine.env->GetMethodID(cls, "main", "([Ljava/lang/String;)V");
              if(mid == NULL){
                   MessageBox(NULL, "Could not find method 'main'", "Error", MB_OK);
                   exit(-1);          
              args = javaVirtualMachine.env->NewObjectArray(2-2, javaVirtualMachine.env->FindClass("java/lang/String"), NULL);          
              if(args==NULL){               
                   MessageBox(NULL, "Could not create args array", "Error", MB_OK);
              for(int arg=0; arg < 2;arg++)     {               
                   javaVirtualMachine.env->SetObjectArrayElement(args, arg, javaVirtualMachine.env->NewStringUTF(argv[arg+2]));      
              javaVirtualMachine.env->CallStaticVoidMethod(cls,mid,args);     
              javaVirtualMachine.jvm->DestroyJavaVM();
              engine = new BrimstoneEngine("OpenGL Game", FALSE, 800, 600, 16);
              loopRet = engine->EnterMessageLoop();
              delete engine;
              return loopRet;
         catch(char *sz)
              MessageBox(NULL, sz, 0, 0);
              delete engine;
         CoUninitialize();
         return -1;
    }any help is always appreciated

  • Can i pass an int * to a native function?

    From Java, can I pass an int pointer to the JNI?
    I want the native function to assign data to an int in the Java program.
    Many thanks!

    838478 wrote:
    Many thanks to both of you for your helpful responses. I pitched my original question somewhat disingenuously in order to be precise. My actual development issue is broader:
    I have C++ API that passes many data types by reference (as pointers or references) in order to modify the passed values. If I were to wrap this API to call it from from Java it sounds as though passing each parameter as an object (e.g. Integer for int would be the cleanest way to go. Does this sound correct?
    One enigma: I have to call a native function with a char * argument that returns with that char * pointing to a buffer of binary data. How should I pass back that binary buffer to Java? As a String? Your problem is not specific enough.
    1. You want to create data, regardless of the type, on the native heap and pass it through java to another native method. Solution: Use a long. You have a pointer to the data (again the type does NOT matter), you cast it to a long, you return that from your first method, pass it into the second, and there you cast the long back to the pointer. The pointer can point to anything you like including complex data types.
    2. You want to create data, of some complex structure, on the native heap and then access that data in java. Then you MUST map it to java types, every piece of data, of every type, specific to the type. So a native int maps to a java int (if the sizes match), a char* maps to a String, etc. You MUST create in some fashion every java data item that you need. There are NO shortcuts.

  • Exit handling in native function by JNI

    Hi everyone,
    We are developing a Java application using native function calls through JNI in Linux.
    The application starts and calls a native function and the native function attach a signal
    handler and an exit handler. In addition, in the native function, we fork another process
    and in the forked process, we calls a several java-side methods. It works in normal cases.
    However, when System.exit() is called in the java-side methods invoked by a native function,
    the application is stopped. Thus we add shutdown hook (Runtime.getRuntime().addShutdownHook())
    to treat this case. The shutdown hook just calls a native method, and the native method
    just calls exit(). We expect the calling exit() in the native method invoked in shutdown hook for JVM
    invokes our exit handler which is attached in advance. It looks working well.
    But, sometimes we find several garbage(?) jvm processes (we can see the process named as "java"
    in using Linux command "ps"). The parent process of these processes is init process (pid = 1).
    With the pid of these processes, we suspect the processes are created when we fork another process
    in native function invoked through JNI. However it is not happened every times in our application.
    Why the garbage java processes remain? Is there any problem in the calling exit() in the native
    method invoked during JVM Shutdown process?
    I hope any answers for this problem.
    Thanks in advance,
    Seung-Uk Oh

    Thus we add shutdown hook
    (Runtime.getRuntime().addShutdownHook())
    to treat this case. The shutdown hook just calls a
    native method, and the native method
    just calls exit(). We expect the calling exit() in the
    native method invoked in shutdown hook for JVM
    invokes our exit handler which is attached in advance.
    It looks working well.I wouldn't think that was a good idea.
    You are terminating the JVMs normal exit process. Why don't you just register the exit processes in your own stack and call them with the native method?

  • CVI crashes when calling function from external DLL

    I'm calling a CVI library from Test Stand 4.1.  In that CVI library I load an external DLL (using LoadLibrary) and create a few function pointers (using GetProcAddress).  The DLL loads successfully, and I get addresses for all of the imported functions.  
    However, when I one of the functions is called CVI crashes (Test Stand says it lost the ActiveX connection to CVI) when executing in an external CVI instance.  If executed in the Test Stand process I get a system level exception.
    If I step through the code in CVI, it hangs after trying to step into or over the call to the function pointer from the external DLL.
    I am able to call the functions in a small test project I created in CVI, however when integrating it into an existing test library and calling it through Test Stand it fails.
    Any ideas on how to go about debugging this issue?

    Have you tried calling into the dll that CVI calls directly from TestStand?  I am curious to know if this also crashes.
    I am also curious to know if there are any path references in the dll that is called by the CVI program.  If so are they relative, or absolute paths?
    I ask because one of the possibilities is that relative paths are being used to specify a path from the location of the code that is called, and they are not working because the current working directory is being specified by TestStand, and the paths are not relative to the working directory given by TestStand.
    Jensen
    National Instruments
    Applications Engineer

  • GUI crashes when calling native code..

    Hi,
    I have interfaced to an existing C program using the Java Native Interface and I am controlling the C program using a GUI. The problem is that everytime I click on the button to call the native method, the GUI crashes... The bizarre thing is that the C code seems to actually execute properly and no exceptions are thrown..
    Anyone come across this problem?
    /john

    Hi,
    Thanks for the replies...
    The GUI completely disappears. No error file is generated. No exceptions are thrown. Here it is in more detail..
    The C code is invoked using the java native interface. The C code converts a MIDI file to a text file. It is normally run in DOS and accepts two parameters. You would run it in DOS normally as follows:
    mf2t Example1.mid Example1.txt.
    In the GUI I select the MIDI file and specify the output file (Example1.txt). I then pass these two parameters to the C code. The C code originally used argc and argv to accept the parameters. I replaced these with "fileArray" and "parameter"... "mf2t" replaces "main" in the native code...
    On the java side the code looks like this:
    static public native boolean mf2t(String s6, String s7);
    public String infile; // Input MIDI file
    public String textOut; // Output text file
    private void MIDIButtonActionPerformed(java.awt.event.ActionEvent evt) {
    Object target=evt.getSource();
    if(target == MIDIButton) {
    if(mf2t(infile,textOut)){
    InfoLabel.setText("MIDI to text conversion complete");
    The code is built on the C side into a DLL using MS Visual Studio.
    On the C side the code looks something like this:
    static char *fileArray[5];
    static int argument=3;
    static char midiArray[25];
    static char txtArray[25];
    void mf2t(int argument,char * fileArray[]);
    // Entry point to native C code is here
    JNIEXPORT jboolean JNICALL
    Java_MainWindow_mf2t (JNIEnv *env, jobject j1, jstring midi, jstring txt)
    const jbyte *midiFile;
    const jbyte *txtFile;
    midiFile=(*env)->GetStringUTFChars(env,midi, NULL);
    txtFile=(*env)->GetStringUTFChars(env,txt, NULL);
    // The lines above just convert the java string into a C equivalent..
    strcpy(midiArray,midiFile);
    strcpy(txtArray,txtFile);
    fileArray[0]="mf2t.exe"; // Here I get fileArray to point to the converted strings
    fileArray[1]=midiArray;
    fileArray[2]=txtArray;
    mf2t(argument,fileArray); // Then I pass this to a native method
    (*env)->ReleaseStringUTFChars(env,midi, midiFile);
    (*env)->ReleaseStringUTFChars(env,txt, txtFile);
    return 1;
    void mf2t(int argument,char * fileArray[]){
    // native code in here
    I think it may have something to do with threads.. I'm not sure though.. It's impossible to know whats going on in the C code when the GUI crashes. If anything looks strange it's because I left out some code here for the sake of brevity... Still if you see anything that stands out let me know..
    Thanks,
    John

  • Native function call

    I created a native c class which is called in a java code. when i try to execute the program , there is "java.lang.UnsatisfiedLinkError". I tried to place the dll file created in the appropriate directory, but still i get the same error.
    My java class( which tries to access the c class) is in a package which is inside another directory, will this create any problem?
    kindly help me with ur suggestions. thank you

    I am attaching the code fragments below:
    package JavaFem;
         public class FESAMDSolver extends FESolver {
         public native void cAMDorder(int neq, int[]ap, int[]ai, int[]pv);
              static {
              //System.loadLibrary("testamd");
              System.load("Z:/testamd.dll");
              public void solve() {
         cAMDorder(num_eqns, Ap, Ai, pVector); // calling the native C method
    My native function code :
    #include <jni.h>
    #include "JavaFem_0005cFESAMDSolver.h"
    #include "amd.h"
    JNIEXPORT void JNICALL Java_JavaFem_0005cFESAMDSolver_cAMDorder
    (JNIEnv *env, jobject obj, jint n, jintArray ApArray , jintArray AiArray, jintArray PArray)
              jintArray Ap = (*env)->GetIntArrayElements(env, ApArray, 0);
              jintArray Ai = (*env)->GetIntArrayElements(env, AiArray, 0);
              jintArray P = (*env)->GetIntArrayElements(env, PArray, 0);
              (void) amd_order (n, Ap, Ai, P, (double *) NULL, (double *) NULL) ;
    Directory structure
    JavaFemViewer\JavaFem
         JavaFem is a package inside the JavaFemViewer folder.
    My testamd.dll file and all C file objs are located inside the JavaFem directory. When i created a dll file, there was no header file generated along with it.
    The error i get is displayed below:
    java.lang.UnsatisfiedLinkError: cAMDorder
    at JavaFem.FESAMDSolver.cAMDorder(Native Method)

  • How to call C functions from native functions?

    Hi, I want to call a C function from a JNICALL?
    i wrote somthin like this:
    #include "ParamInput1.h"
    #include <jni.h>
    #include <stdio.h>
    #include "testPhase1.h"
    JNIEXPORT void JNICALL
    Java_ParamInput1_phase1(JNIEnv *env,
                   jobject obj,
                   jdouble tSim,
                   jdouble tSup,
                   jdouble iSim)
    double threshSim = tSim;
    double threshSup = tSup;
    double itemSim = iSim;
    /* call test Phase1 to execute the function*/
    testPhase1(threshSim, threshSup, itemSim);
    return;
    And I always get "undefined symbol: testPhase1__Fddd" error!
    what is the problem here? thanks alot!
    Jim

    Basically - you are already are compiling a c file. Replace that c file with all the c files.
    Specifically it depends on the OS, compiler and how you are compiling
    For windows add it the project or compile each file and then add the object fill to the link line.
    For unix add the other c files in to the compile line the same place you have the current C file.

  • Problem calling native functions

    Ok, I generate a dll with some native functions, but when I want to use one of the native functions I get the error:
    java.lang.UnsatisfiedLinkError: pruebas.TestClass.myFunction(II)I
    where pruebas.TestClass is the class that class the native function myFunction(int, int)...
    I get the same error when I do not load the dll, can somebody help me solve this error
    thanks a lot
    God bless you
    --Chema                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    hmm, never done this on windows so I can't be too sure. You can try setting java.library.path and see if it helps.
    http://www.inonit.com/cygwin/jni/helloWorld/load.html
    (the command wopuld be java -Djava.library.path=YOURPATH yourapplication)

  • I have an app that crashes when I run one function, but no one else I know with the same app experiences the crash.  I checked my Diagnostics

    I have an app called Astrogold that crashes when I run one function, but no one else I know with the same app experiences the crash.  The app writes several different reports, and gives the option of sending them as PDF files.  All the other reports generate fine, but one of them....and that one crashes the app while it is trying to generate the report.
    Note:  it only crashes the display.  If I double click the home button I see the app itself is still running.
    I checked my Diagnostics & Usage data, and noticed that every time the app crashes a LowMemory report is created.  I looked at the LowMemory report and see that the Largest process is Astrogold.  But I don't see any reports with the name of the app itself.
    I have an iPhone 5c, and according to iTunes I have 2.25 GB Free.
    Below is the actual LowMemory report.  Can anyone make any suggestions?
    name":"astrogold","bug_type":"109","os_version":"iPhone OS 7.1.2 (11D257)","bundleID":"com.esotech.astrogold","version":"4.2.4 (4.2)","app_name":"astrogold"}
    Incident Identifier: 257B47E8-3A4D-4C64-8E9F-71D33C905548
    CrashReporter Key:   cfa389285f4559a21d797bfeec6a78c584e798d6
    Hardware Model:      iPhone5,4
    Process:             astrogold [18906]
    Path:                /var/mobile/Applications/D8301675-652C-4472-A168-CF3F141C5F58/astrogold.app/ast rogold
    Identifier:          com.esotech.astrogold
    Version:             4.2.4 (4.2)
    Code Type:           ARM (Native)
    Parent Process:      launchd [1]
    Date/Time:           2014-08-31 13:15:13.616 +0800
    OS Version:          iOS 7.1.2 (11D257)
    Report Version:      104
    Exception Type:  EXC_CRASH (SIGABRT)
    Exception Codes: 0x0000000000000000, 0x0000000000000000
    Triggered by Thread:  0
    Thread 0 Crashed:
    0   libsystem_kernel.dylib         0x399a51f0 0x39992000 + 78320
    1   libsystem_pthread.dylib        0x39a0d7b2 0x39a0a000 + 14258
    2   libsystem_c.dylib              0x39955ff4 0x3990c000 + 303092
    3   libsystem_malloc.dylib         0x399ccd20 0x399ca000 + 11552
    4   libobjc.A.dylib                0x393f73a4 0x393ed000 + 41892
    5   libobjc.A.dylib                0x393ffb66 0x393ed000 + 76646
    6   astrogold                      0x001be574 0xe2000 + 902516
    7   astrogold                      0x001be774 0xe2000 + 903028
    8   astrogold                      0x001a2910 0xe2000 + 788752
    9   astrogold                      0x001a40fa 0xe2000 + 794874
    10  UIKit                          0x315ba174 0x3147c000 + 1302900
    11  UIKit                          0x315613d6 0x3147c000 + 938966
    12  UIKit                          0x31560c2c 0x3147c000 + 937004
    13  UIKit                          0x314872e0 0x3147c000 + 45792
    14  QuartzCore                     0x31103316 0x310f7000 + 49942
    15  QuartzCore                     0x310feb3a 0x310f7000 + 31546
    16  QuartzCore                     0x310fe9cc 0x310f7000 + 31180
    17  QuartzCore                     0x310fe3e0 0x310f7000 + 29664
    18  QuartzCore                     0x310fe1f2 0x310f7000 + 29170
    19  QuartzCore                     0x310f7f18 0x310f7000 + 3864
    20  CoreFoundation                 0x2ec20ff6 0x2eb81000 + 655350
    21  CoreFoundation                 0x2ec1e982 0x2eb81000 + 645506
    22  CoreFoundation                 0x2ec1ecce 0x2eb81000 + 646350
    23  CoreFoundation                 0x2eb89724 0x2eb81000 + 34596
    24  CoreFoundation                 0x2eb89506 0x2eb81000 + 34054
    25  GraphicsServices               0x33af86ce 0x33aef000 + 38606
    26  UIKit                          0x314ea86c 0x3147c000 + 452716
    27  astrogold                      0x000e9136 0xe2000 + 28982
    28  libdyld.dylib                  0x398eeab4 0x398ed000 + 6836
    Thread 1:
    0   libsystem_kernel.dylib         0x39992804 0x39992000 + 2052
    1   libdispatch.dylib              0x398e1050 0x398d9000 + 32848
    2   libdispatch.dylib              0x398db2de 0x398d9000 + 8926
    Thread 2:
    0   libsystem_kernel.dylib         0x39992a50 0x39992000 + 2640
    1   libsystem_kernel.dylib         0x39992848 0x39992000 + 2120
    2   CoreFoundation                 0x2ec205e4 0x2eb81000 + 652772
    3   CoreFoundation                 0x2ec1ed04 0x2eb81000 + 646404
    4   CoreFoundation                 0x2eb89724 0x2eb81000 + 34596
    5   CoreFoundation                 0x2eb89506 0x2eb81000 + 34054
    6   Foundation                     0x2f57d492 0x2f572000 + 46226
    7   Foundation                     0x2f5ce254 0x2f572000 + 377428
    8   astrogold                      0x00408f30 0xe2000 + 3305264
    9   Foundation                     0x2f63fa0a 0x2f572000 + 842250
    10  libsystem_pthread.dylib        0x39a0c956 0x39a0a000 + 10582
    11  libsystem_pthread.dylib        0x39a0c8c6 0x39a0a000 + 10438
    12  libsystem_pthread.dylib        0x39a0aae4 0x39a0a000 + 2788
    Thread 3 name:  com.apple.NSURLConnectionLoader
    Thread 3:
    0   libsystem_kernel.dylib         0x39992a50 0x39992000 + 2640
    1   libsystem_kernel.dylib         0x39992848 0x39992000 + 2120
    2   CoreFoundation                 0x2ec205e4 0x2eb81000 + 652772
    3   CoreFoundation                 0x2ec1ed04 0x2eb81000 + 646404
    4   CoreFoundation                 0x2eb89724 0x2eb81000 + 34596
    5   CoreFoundation                 0x2eb89506 0x2eb81000 + 34054
    6   Foundation                     0x2f5ca23c 0x2f572000 + 361020
    7   Foundation                     0x2f63fa0a 0x2f572000 + 842250
    8   libsystem_pthread.dylib        0x39a0c956 0x39a0a000 + 10582
    9   libsystem_pthread.dylib        0x39a0c8c6 0x39a0a000 + 10438
    10  libsystem_pthread.dylib        0x39a0aae4 0x39a0a000 + 2788
    Thread 4 name:  com.apple.CFSocket.private
    Thread 4:
    0   libsystem_kernel.dylib         0x399a5434 0x39992000 + 78900
    1   CoreFoundation                 0x2ec244de 0x2eb81000 + 668894
    2   libsystem_pthread.dylib        0x39a0c956 0x39a0a000 + 10582
    3   libsystem_pthread.dylib        0x39a0c8c6 0x39a0a000 + 10438
    4   libsystem_pthread.dylib        0x39a0aae4 0x39a0a000 + 2788
    Thread 5:
    0   libsystem_kernel.dylib         0x399a5c70 0x39992000 + 81008
    1   libsystem_pthread.dylib        0x39a0ac1e 0x39a0a000 + 3102
    2   libsystem_pthread.dylib        0x39a0aad8 0x39a0a000 + 2776
    Thread 6:
    0   libsystem_platform.dylib       0x39a069a6 0x39a05000 + 6566
    1   libobjc.A.dylib                0x393ffad6 0x393ed000 + 76502
    2   CoreFoundation                 0x2eb86140 0x2eb81000 + 20800
    3   CoreFoundation                 0x2eb8c0dc 0x2eb81000 + 45276
    4   CoreFoundation                 0x2eb9f6e4 0x2eb81000 + 124644
    5   astrogold                      0x0019ed06 0xe2000 + 773382
    6   Foundation                     0x2f59a64c 0x2f572000 + 165452
    7   Foundation                     0x2f58a870 0x2f572000 + 100464
    8   Foundation                     0x2f62e740 0x2f572000 + 771904
    9   libdispatch.dylib              0x398de25a 0x398d9000 + 21082
    10  libdispatch.dylib              0x398df684 0x398d9000 + 26244
    11  libdispatch.dylib              0x398df8d8 0x398d9000 + 26840
    12  libsystem_pthread.dylib        0x39a0ac14 0x39a0a000 + 3092
    13  libsystem_pthread.dylib        0x39a0aad8 0x39a0a000 + 2776
    Thread 7:
    0   libsystem_kernel.dylib         0x399a5c70 0x39992000 + 81008
    1   libsystem_pthread.dylib        0x39a0ac1e 0x39a0a000 + 3102
    2   libsystem_pthread.dylib        0x39a0aad8 0x39a0a000 + 2776
    Thread 8:
    0   libsystem_kernel.dylib         0x39992a50 0x39992000 + 2640
    1   libsystem_kernel.dylib         0x39992848 0x39992000 + 2120
    2   CoreFoundation                 0x2ec205e4 0x2eb81000 + 652772
    3   CoreFoundation                 0x2ec1ed04 0x2eb81000 + 646404
    4   CoreFoundation                 0x2eb89724 0x2eb81000 + 34596
    5   CoreFoundation                 0x2ebcd346 0x2eb81000 + 312134
    6   CoreMotion                     0x2f2484fc 0x2f20f000 + 234748
    7   libsystem_pthread.dylib        0x39a0c956 0x39a0a000 + 10582
    8   libsystem_pthread.dylib        0x39a0c8c6 0x39a0a000 + 10438
    9   libsystem_pthread.dylib        0x39a0aae4 0x39a0a000 + 2788
    Thread 9 name:  WebThread
    Thread 9:
    0   libsystem_kernel.dylib         0x39992a50 0x39992000 + 2640
    1   libsystem_kernel.dylib         0x39992848 0x39992000 + 2120
    2   CoreFoundation                 0x2ec205e4 0x2eb81000 + 652772
    3   CoreFoundation                 0x2ec1ed04 0x2eb81000 + 646404
    4   CoreFoundation                 0x2eb89724 0x2eb81000 + 34596
    5   CoreFoundation                 0x2eb89506 0x2eb81000 + 34054
    6   WebCore                        0x36ebfc70 0x36e01000 + 781424
    7   libsystem_pthread.dylib        0x39a0c956 0x39a0a000 + 10582
    8   libsystem_pthread.dylib        0x39a0c8c6 0x39a0a000 + 10438
    9   libsystem_pthread.dylib        0x39a0aae4 0x39a0a000 + 2788
    Thread 10 name:  JavaScriptCore::BlockFree
    Thread 10:
    0   libsystem_kernel.dylib         0x399a4f2c 0x39992000 + 77612
    1   libsystem_pthread.dylib        0x39a0bf62 0x39a0a000 + 8034
    2   libsystem_pthread.dylib        0x39a0cd9c 0x39a0a000 + 11676
    3   JavaScriptCore                 0x2fbb8308 0x2fba6000 + 74504
    4   JavaScriptCore                 0x2fbb5970 0x2fba6000 + 63856
    5   libsystem_pthread.dylib        0x39a0c956 0x39a0a000 + 10582
    6   libsystem_pthread.dylib        0x39a0c8c6 0x39a0a000 + 10438
    7   libsystem_pthread.dylib        0x39a0aae4 0x39a0a000 + 2788
    Thread 11 name:  JavaScriptCore::Marking
    Thread 11:
    0   libsystem_kernel.dylib         0x399a4f2c 0x39992000 + 77612
    1   libsystem_pthread.dylib        0x39a0bf62 0x39a0a000 + 8034
    2   libsystem_pthread.dylib        0x39a0cd9c 0x39a0a000 + 11676
    3   JavaScriptCore                 0x2fd56cb2 0x2fba6000 + 1772722
    4   JavaScriptCore                 0x2fd56d0c 0x2fba6000 + 1772812
    5   JavaScriptCore                 0x2fbb5970 0x2fba6000 + 63856
    6   libsystem_pthread.dylib        0x39a0c956 0x39a0a000 + 10582
    7   libsystem_pthread.dylib        0x39a0c8c6 0x39a0a000 + 10438
    8   libsystem_pthread.dylib        0x39a0aae4 0x39a0a000 + 2788
    Thread 0 crashed with ARM Thread State (32-bit):
        r0: 0x00000000    r1: 0x00000000      r2: 0x00000000      r3: 0x27d1f553
        r4: 0x00000006    r5: 0x3b90118c      r6: 0x0000000b      r7: 0x27d1f5bc
        r8: 0x0000000b    r9: 0x00000001     r10: 0x00626000     r11: 0x00000000
        ip: 0x00000148    sp: 0x27d1f5b0      lr: 0x39a0d7b7      pc: 0x399a51f0
      cpsr: 0x00000010
    Zane B Stein
    ("os_version":"iPhone OS 7.1.2 (11D257)","version":"104","bug_type":"198"}
    Incident Identifier: 3526E805-4C03-4956-83B6-2A4AB95B9EE4
    CrashReporter Key:   cfa389285f4559a21d797bfeec6a78c584e798d6
    Hardware Model:      iPhone5,4
    OS Version:          iPhone OS 7.1.2 (11D257)
    Kernel Version:      Darwin Kernel Version 14.0.0: Thu May 15 23:10:37 PDT 2014; root:xnu-2423.10.71~1/RELEASE_ARM_S5L8950X
    Date:                2014-09-02 14:24:12 +0800
    Time since snapshot: 220 ms
    Free pages:                              1448
    Active pages:                            17896
    Inactive pages:                          9268
    Speculative pages:                       11
    Throttled pages:                         209561
    Purgeable pages:                         261
    Wired pages:                             21682
    File-backed pages:                       26187
    Anonymous pages:                         988
    Compressions:                            456385
    Decompressions:                          85356
    Compressor Size:                         44
    Uncompressed Pages in Compressor:        59
    Largest process:   astrogold
    Processes
         Name                    <UUID>                       rpages       recent_max   fds      [reason]          (state)
    CloudKeychainPro <b9fbb8e4989732709cb18c481dfa61a9>          108              108  200                      (daemon) (idle)
        mediaremoted <051ef8b6e7c93fa49a0a2e15ea6e1f52>          193              193  200                      (daemon) (idle)
    MobileGestaltHel <c3c9c32948fe364f8103dd528164b610>          123              123  200                      (daemon) (idle)
             DuetLST <89027d811bd73931a4d45f71c9bbebc7>          472              472  200                      (daemon) (idle)
        itunesstored <00f47fa85c623cee9d55c9b004ba561d>         1426             1426  200                      (daemon) (idle)
                 lsd <8d2569b7b89033328609c73d07410b55>          149              149  200                      (daemon) (idle)
            sandboxd <712c543459bf3d81b0ec88bba199d802>           96               96  200                      (daemon) (idle)
                geod <6e5e9ae33f8638b7be848eac2c1ef70b>          166              166  200                      (daemon) (idle)
             assetsd <6f28405c4c1b35e9aff946c1c4799c0f>          868              868  200                      (daemon) (idle)
            installd <185a1eaa735b3aa38d98092ba8493ba0>          201              201  200                      (daemon) (idle)
           securityd <47657a3a48573d6a8e52ef4cc868248c>          617              617  200                      (daemon) (idle)
    networkd_privile <234d3717143e3bbba12acc5de334deaf>           81               81  200                      (daemon) (idle)
           accountsd <5a5640b47fe637bebb6254deff26eaee>          438              438  200                      (daemon) (idle)
            routined <d5590a1879153ed284886271907ea8fa>          344              344  200                      (daemon) (idle)
    EscrowSecurityAl <d0a689490be631efac2c764fe93300dc>          166              166  200                      (daemon)
            mstreamd <a2bb6401f1d63c7aa320a817d8839522>          406              406  200                      (daemon)
                tccd <ad9819a843e93a1680335febb52c7cc3>          227              227  200                      (daemon)
                 kbd <eba296f6bd4938688fa16a5e39fa477c>         2319             2319  200                      (daemon)
           CVMServer <c95a902a5ae331c2a5239b6cf98a0617>           89               89  200                      (daemon)
           astrogold <58c53f7c8e8931ec823713195426f59c>       166401           166401  200  [per-process-limit] (frontmost) (resume)
    identityservices <d1b907f8a41e3ebd9f270aa846040b07>          581              581  100                      (daemon)
               wifid <2b4c0ddf1a8439838868bf2be61d8bf1>         1286             1286   25                      (daemon)
             syslogd <5c06b8eec36032b49cc9421348ba47ea>          132              132   50                      (daemon)
           locationd <b813efaa4a6a314cafdbbd9b88c30796>         1732             1732  100                      (daemon)
              powerd <bd077d109d773bcd9041153b30ea034a>          128              129  100                      (daemon)
             imagent <79bd0fedda583ae3822051093f7681b5>          571              571  100                      (daemon)
                 vmd <f44f0a6a37293606865eb8862c10b653>          188              188  100                      (daemon)
       iaptransportd <818588012ed93eb7a10ccb22d8acadfe>          223              223   50                      (daemon)
        mediaserverd <e40c7476d9fe3d759bfd28b8d68dc7ba>         2233             2233  200                      (daemon)
       mDNSResponder <60e905f9582a3090ab6e7a257454389e>          226              226  100                      (daemon)
                apsd <b7e19d27180e34aba845e475eae7d3db>          510              510  100                      (daemon)
         dataaccessd <fdf81960fb903bd68616117fd29ce277>         2563             2563  200                      (daemon)
            sharingd <2c731a1c182637a39b004694b2a5e23d>          508              508   50                      (daemon)
        mobileassetd <08440fa17b3537afb347cf78aa039a67>          565              565  200                      (daemon)
         SpringBoard <f73e83ffc898302394baa2042ca232fd>         9211             9211  100                    
          backboardd <b5d33ca6da9c33d48e2c8ccb9930c3dc>         8716             8716   50                      (daemon)
          aggregated <3e381378eb7f3dd2846920cb5db91265>          523              523   50                      (daemon)
           lockdownd <d998e2bac7663966bd0285c07ed89111>          276              276  100                      (daemon)
             configd <20b29bb0286e347ebe7c42aa8ee421c9>          462              462  100                      (daemon)
           fseventsd <8876b6f5a0c13024a12cb3e148ddab61>          303              303  100                      (daemon)
        fairplayd.H2 <243ccf92ad4d34cbb4fdf7e078d55141>          130              130  100                      (daemon)
       wirelessproxd <47699be4861c30abbb375e1d3b9e15dc>          153              153  100                      (daemon)
            BTServer <51d0d4421dc73abf9d4844e2b155c340>          536              536  100                      (daemon)
           distnoted <7895f761ec323e31a356860060f8713d>          155              155  100                      (daemon)
      UserEventAgent <9aedc371d1c037e7b5d7b5577f0424a8>          756              756  100                      (daemon)
    WirelessCoexMana <f5dcce7805a9308bbbcf2d52751385ef>          132              132  100                      (daemon)
            networkd <148d4512d2c43efc95bafd487fd97f4a>          577              577  100                      (daemon)
    filecoordination <7b1b1b1b4fe0364c8e0adfd90f78b4a9>          207              207  200                      (daemon)
       medialibraryd <fdf252b3fb1a3646a836c0c3b5840464>          634              634  200                      (daemon)
         touchsetupd <0a4f35337aa13e55a3d7e56296499e14>          154              154  200                      (daemon)
                 ubd <30a03e11a5c43c7cbd6ecd1aaef27841>          470              470  200                      (daemon)
          CommCenter <463e099ed64e30ad9433b8ea3f4a4e94>         2039             2039  100                      (daemon)
             notifyd <5b4c0731afd533179b295e4f39e589d6>          335              335  100                      (daemon)
    **End**
    <Post Edited By Host>

    Thank you for your reply.
    >You can double-click the home button and then swipe upwards on the thumbnail of the app to force it closed.
    Did that
    >After that, power the phone off and back on again, test.
    Did that
    >If still a problem, force close the app again and then reset the phone, holding the sleep/wake and home buttons together until you see the Apple logo and then release. The phone will reboot, test.
    Did that
    >If still a problem, then connect the device to iTunes and restore from backup.
    Did that
    >If that does not work, it is possible there is something corrupt in the backup. The final step is restore as new, not from a backup.
    This is the only thing I had not done before I posted my initial request for help.  I will work on that....it's a last resort I was hoping not to do, but it sounds like I've already done everything else.
    Thank you.

  • How to call class os functions defined in share/vm/runtime/os.hpp?

    HI. I haven't coded in C for some time, and no experience with JNI
    I dabbled a bit in JNI and creating native functions.
    I would like to know, how can I call Java VM os functions from my own libraries without much hassle? e.g. os::javaTimeMillis(), or os::active_processor_count() ?
    #include "HelloWorld.h"
    JNIEXPORT void JNICALL Java_HelloWorld_sayHi
      (JNIEnv *env, jclass clazz) {
      printf("Hello\n");
    long x = os::javaTimeMillis(); // HOW TO DO THAT?
    Including src/share/vm/runtime/os.hpp seems overkill with lot of dependencies?
    http://hg.openjdk.java.net/jdk8/jdk8/hotspot/file/87ee5ee27509/src/share/vm/runtime/os.hpp
    Could I create a custom header file copy-pasting parts from os.hpp to make some functions known?
    And I don't want to java-call the native java methods that mapped to these os functions, but call C functions directly.

    Two parts
    1. How do you write C code.
    2. How do you use JNI to interface between java and C code.
    1 is independent from 2 but 2 requires 1 because you can't do it if you don't know how to write C code.
    If you want to do JNI then you start by writing C code and debugging the C code.  No JNI at all in that process.
    After you complete that then you write wrappers around the C code which are JNI.
    JNI code tends to make Java unstable because bugs in JNI code will cause the VM to crash.  So it is often better to find an executable that does what one wants and then use Java Runtime.exec to manage that executable.  That is going to be true even if one is writing the executable (like in C.)
    To learn C you should start with a C site.

  • Calling a dll function that as a structure

    I'm trying to call the following function with the Call library function node:
    XLstatus xlLinSetChannelParams (
    XLportHandle portHandle,
    XLaccess accessMask,
    XLlinStatPar statPar)
    The statPar parameter is a stucture which is define as follow
    typedef struct {
    unsigned int LINMode
    int baud rate;
    unsigned int LINVersion;
    unsigned int reserved;
    } XLlinStatPar;
    I used a cluster to pass the data to the function but labview is crashing everytime. The  C output of the CLFN is :
    typedef struct {
     unsigned long LinMode;
     long baudrate;
     unsigned long Linversion;
     unsigned long reserved;
     } TD1;
    long _xlLinSetChannelParams28(long portHandle, uInt64 accessMask,
     TD1 *statPar);
    Why is labview sending a pointer to the struct instead of the structure itself? Is this the cause of my problem? Any Solution?

    The CLFN ouput shown in my previous message was done with the "handle to value" parameter. As you stated, it sends a reference to the struct memory location.The problem is that i need to pass the structure value as an input and not a pointer to it (well, that's what i think the problem is). I read the various documents about CLFN and I tried the examples but they are all have function of that kind:
    returnval ExampleFunc (structPointer *struct)
    While the function in my dll is made like that
    returnval ExampleFunc (structValue struct) (see the real function in my first message)
    I included the dll and Vi and documentation for the xlLinSetChannelParams function.  The CLFN node that calls it is the fourth one (the one with a cluster as input). The first 3 CLFN are used to call the initialization function:init driver,get channel and open port.
    Attachments:
    LIN test.zip ‏130 KB

  • How to handle errno in native function?

    How to get the correct errno in a native function? I'm using Unix message queues in my native methods and I always get the errno = 0 (it should be ENOMSG = 35) returned when the desired message is not yet available (calling msgrcv with IPC_NOWAIT set). This program is running on IBM AIX 4.3. Please help...

    I cached and printed the errno in my C native function
    and it was 0?Well there are several possibilities.
    One it is zero. Which means that there is mis-match on your part as to why it should have a different value. If you print the value out in your C code right after you get it and it is zero then this is definitely the problem. The most likely reason is because the data that you pass is not what you think it is.
    Or you are not returning the cached value to java but rather something else. If you print the value out in your C code just after you get it, and it has the correct value then this is your problem. The mostly likely reason for this is that you are actually using two different variables (but you think it is one variable.) One possible reason for this is different way "static" is handled in C and C++. But there could be others.

Maybe you are looking for

  • Hints in Oracle 8i

    Is there any difference in the way Hints function in Oracle 7.3 & 8i & also within the different versions of 8i? Does hints always go in for cost based optimization or is it only in 8i?

  • PRs with addition of only line items and Clubbing Service and Normal POs

    Hi SAP Gurus We are in ECC 6.0 in our buisness process The PRs are created by the Project system they could create only one PR with the Same No and when ever a new PR is created it is adding up to the existing PRs line items where the line item has i

  • Please check for this account skype he is scammer

     now he use skype call to me my mobile phone i'm  IT Recruiter  it's have more impact my occupation please delete and block this account i must delete my account . i must use skype for business but now i can not .  now second time  he send mail and u

  • BW Source system plugin upgrade

    Hi,   We are in a process of ungrading PI_BASIS component from 2004 to 2005 and I need to know if there is anything to be done on the deltas before it. we have all sort of logistics applications like SD, PO etc.  and we dont want to lose any records.

  • Safari 4.0.3 and Adobe Flash Player 10

    I am running a dual 1.8 G5 powerpc. Once I was upgraded to Safari v. 4 I am unable to read certain web media that requires Adobe Flash. I have repeatedly gone to the Adobe site and completed the download procedure correctly and it tells me I have suc