Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. Qt creator plugin crash
Qt 6.11 is out! See what's new in the release blog

Qt creator plugin crash

Scheduled Pinned Locked Moved Qt Creator and other tools
12 Posts 2 Posters 8.2k 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.
  • E Offline
    E Offline
    eugenk
    wrote on last edited by
    #1

    Hi ! I have try to build simplest qt creator plugin using standart Libraries->Qt creator plugin selection from project wizard. Of course, previosly I build debug version of qt creator from sources, using qmake with flags -r -spec macx-g++ CONFIG+=debug CONFIG+=x86_64 CONFIG+=declarative_debug CONFIG+=qml_debug, which qt creator uses for debuging (plugin also was built with the same flags). Plugin was successfully compiled and installed to my qt creator debuging assembly. But when I try to run it, qt creator (my debugging assembly of course) crashes, although it worked well without my plugin. Crash occours BEFORE(!!!) call of
    MyPluginPlugin::initialize(),
    in function
    AnalyzerManagerPrivate::modeChanged() (from qt creator code itself)
    here is it code:
    @
    void AnalyzerManagerPrivate::modeChanged(IMode *mode)
    {
    if (mode && mode == m_mode) {
    m_mainWindow->setDockActionsVisible(true);
    static bool firstTime = true;
    if (firstTime)
    selectSavedTool();
    firstTime = false;
    updateRunActions();
    } else {
    m_mainWindow->setDockActionsVisible(false);
    }
    }
    @
    in the first call of this function. The reason of crash: m_mainWindow = NULL.
    When I add if(!m_mainWindow) return; into beginning of function, it begins works.
    But function initialize() of my plugin not called at all. All other plugins loads correctly and qt creator works.
    Can anybody say, wath is wrong ?

    P.S. My working enironment is: MacOS 10.8.2, QtSDK 5.0.0, Qt Creator 2.6.1. Qt Creator sources also 2.6.1

    Regards
    Eugene

    1 Reply Last reply
    0
    • E Offline
      E Offline
      eugenk
      wrote on last edited by
      #2

      Addition.
      I have see, how plugins initilizes. The initialization code is :
      @
      bool PluginSpecPrivate::initializePlugin()
      {
      ...............................
      ...............................
      if (!plugin->initialize(arguments, &err)) {
      errorString = QCoreApplication::translate("PluginSpec", "Plugin initialization failed: %1").arg(err);
      hasError = true;
      return false;
      }
      }
      @
      plugin->initialize(arguments, &err) is namelly call of plugin initialize() function. For all plugins except my, calls correct initialize(). For my plugin calls initialize() function of CorePlugin ! My initialize() function not calls ! Can anybody say, what wrong I to do ???

      1 Reply Last reply
      0
      • ? Offline
        ? Offline
        A Former User
        wrote on last edited by
        #3

        Is your plugin in its own namespace?

        1 Reply Last reply
        0
        • E Offline
          E Offline
          eugenk
          wrote on last edited by
          #4

          No. Is it important ??? Just try !!! :)

          1 Reply Last reply
          0
          • E Offline
            E Offline
            eugenk
            wrote on last edited by
            #5

            Sorry, I mistakes when say no. Yes. It uses own namespace. Plugin code was generated by wizard and I not change any string. I thing now that in has some incorrect shared library model. But cannot understand exactly. If cannot solve problem untill tomorrov, I'll use IDA.

            1 Reply Last reply
            0
            • ? Offline
              ? Offline
              A Former User
              wrote on last edited by
              #6

              Sorry, no idea then. Are you sure that you are using exactly the same compiler and Qt that was used to build Creator with? It is somewhat picky...

              Does it load your plugin at all? On linux you can check with strace, no idea which tool does something similar on the mac though.

              1 Reply Last reply
              0
              • E Offline
                E Offline
                eugenk
                wrote on last edited by
                #7

                Yes. Compiler was exactly the same. Moreover, now I reassemble debugging qt creator using qt creartor, instead command line. Result not changes. At first occours call of
                AnalyzerManagerPrivate::modeChanged()
                with m_mainWindow=NULL,
                at second MyPlugin::initilize() not calls.
                Now I'm downloading QT SDK 5.0.0 for my virtual Linux and WindowsXP mashines and try will try them. Maybe it is only MacOS problem. Although more probably, that it is a problem of qt creator wizard, which creates plugin projetcs with some wrong options. Indeed, qt creator with it's own .pro builds and works absolutelly well.

                1 Reply Last reply
                0
                • ? Offline
                  ? Offline
                  A Former User
                  wrote on last edited by
                  #8

                  I have to admit that I never used the Qt Creator plugin wizard:) I just add my code into the Qt Creator build system and am done with it.

                  1 Reply Last reply
                  0
                  • E Offline
                    E Offline
                    eugenk
                    wrote on last edited by
                    #9

                    Result of building and test under Linux (32-bit Ubuntu running on VMWare)

                    /home/eugenk/Projects/QT/build/qtcreator/debug/lib/qtcreator/plugins/MyCompany/libMyPlugin.so: Plugin verification data mismatch in '/home/eugenk/Projects/QT/build/qtcreator/debug/lib/qtcreator/plugins/MyCompany/libMyPlugin.so'

                    Plugin was not loaded at all ! So it is clear, that wizard template for plugin is incorrect and cannot be uzed.

                    Sorry, can you tell, how to add my code into qt creator build system in version 2.6.1 ?

                    1 Reply Last reply
                    0
                    • ? Offline
                      ? Offline
                      A Former User
                      wrote on last edited by
                      #10

                      Did you "file a bug report":https://bugreports.qt-project.org/ about this? We should fix that wizard:-)

                      The error message you are seeing is actually triggered by Qt 5, due to the json information being missing. So this is a Qt 5 issue and the code does work fine with a Qt 4-based Qt Creator. We will need to update the build system to generate and include that json file.

                      1 Reply Last reply
                      0
                      • E Offline
                        E Offline
                        eugenk
                        wrote on last edited by
                        #11

                        Not, I not write yet, but will to do.

                        By the way, if you are a member of qt creator team, can you give me an advice, where can I read about qt creator internals and plugins development ? I know Writing-Qt-Cretor-plugins.pdf, but this document is rather old. Do you know some regular developer's documentation ?

                        I want to write plugin for D laguage (http://dlang.org/) support. It seems me more reasonable idea, that MonoD (MonoDevelop) or DDT (Eclipse), because very fast D compiler DMD comes with c-sources, and for C++-based IDE I'll get ready D-parser at once. So D-editor will be not very work-expencive part. And maybe debuger also will be not very hard...

                        1 Reply Last reply
                        0
                        • ? Offline
                          ? Offline
                          A Former User
                          wrote on last edited by
                          #12

                          http://doc.qt.digia.com/qtcreator-extending/ is the best we have. We do change a lot of things all the time (there are no binary guarantees whatsoever for Qt Creator!), so documentation does get outdated fast.

                          I am not sure we would accept a D plugin: Each plugin has some maintenance overhead (even 3rd party ones) as we need to keep them at the very least in a state where they can be built, reviews need to be done, etc.

                          D has no connection whatsoever to Qt development as far as I know, so I am not sure it is a good fit for a Qt-centric IDE. Having said that: You are of course free to have the plugin outside Creator. It is not the first such plugin.

                          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