Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. General talk
  3. Qt 6
  4. How to debug the segmentation fault error ?Cant find for a long while
Forum Updated to NodeBB v4.3 + New Features

How to debug the segmentation fault error ?Cant find for a long while

Scheduled Pinned Locked Moved Unsolved Qt 6
6 Posts 2 Posters 656 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • nicker playerN Offline
    nicker playerN Offline
    nicker player
    wrote on last edited by
    #1

    When I called the jni function with the jvm.dll by imported from the project
    It occured the error below.I dont know why,someone told me that its wrong with the pointer of the JVM.
    But I dont know why.
    Is it possible is the reason that there is the pointer Im using the wrong way?![alt text](image url)

    JNIEnv *  mJvmEnv;
    JavaVM * mJvm;
    long mVersion;
    JavaVMInitArgs vmInitArgs;
    //error line
    JNI_CreateJavaVM(&mJvm, (void**)&mJvmEnv, &vmInitArgs);
    

    QQ图片20220622095600.png
    Please help me

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Based on this Stack Overflow thread, you are likely not giving enough parameter to properly create the Java virtual machine.

      Note that this has nothing to do with Qt although you are using Qt Creator.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      nicker playerN 1 Reply Last reply
      1
      • SGaistS SGaist

        Hi,

        Based on this Stack Overflow thread, you are likely not giving enough parameter to properly create the Java virtual machine.

        Note that this has nothing to do with Qt although you are using Qt Creator.

        nicker playerN Offline
        nicker playerN Offline
        nicker player
        wrote on last edited by
        #3

        @SGaist
        I think I've gived the enouth parameters
        like the classpath or the -xms eg
        it worked well when I didnot used the debug.
        Once i debuged the program,it occured the segmentation fault when called the

        JNI_CreateJavaVM(&mJvm, (void**)&mJvmEnv, &vmInitArgs);
        

        So is there any possible that its a bug of the jvm.dll?or Im using the wrong parameters?Please

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          That's the kind of details you should state directly when asking a question. Based on your original code sample and description, there's no way to know that your issue happens in debug mode and not in release.

          Do you have a debug version of the jvm.dll ?

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          nicker playerN 1 Reply Last reply
          1
          • SGaistS SGaist

            That's the kind of details you should state directly when asking a question. Based on your original code sample and description, there's no way to know that your issue happens in debug mode and not in release.

            Do you have a debug version of the jvm.dll ?

            nicker playerN Offline
            nicker playerN Offline
            nicker player
            wrote on last edited by
            #5

            @SGaist
            NO,I cannot find the debug version of the jvm.dll,
            I searched a lot from the net.Unfortunately there's no one.
            If the debug version could help,Will you help me to get one ?

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              That I can't do.

              On the idea side, did you try to activate the Java debugging mode ?

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              0

              • Login

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Groups
              • Search
              • Get Qt Extensions
              • Unsolved