Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QCA::initializer destructor crashes app

QCA::initializer destructor crashes app

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 3 Posters 2.0k Views 2 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.
  • K Offline
    K Offline
    ketjow
    wrote on last edited by ketjow
    #1

    Hi,
    I have following problem, that app crashes when

    QCA::Initializer init;
    

    goes out of scope, to be more precisely, when destructor is invoked.
    It happens only on deployed application, which is installed on clean windows 7 without qt creator. The first time when I lunch app there, I can do whatever I want and it works flawless, but when I lunch app second time and invoke some qca methods like QCA::supportedFeatures(), application would crash when destructor will be invoked.
    When I lunch it second time and i won't invoke any qca methods, destructor will be invoked successfully.

    I moved QCA::Initializer object on the begining of the main function like I read here , the issue from that post was connected with linux, but it's always worth to try :D.

    I'm sure that destuctor is crasing app, beacouse, when I put some qdebugs in this way Ł

    if(true) 
    {
       QCA::Initializer init; 
       // some work with qca like QCA::supportedFeatures()
      qDebug() << __LINE__ ;
    }
     qDebug() << __LINE__ ;
    

    onlz first qdebug will be printed before crash happens.

    Have you got any idea what should I check, maybe should i initialize it as a pointer ?

    EDIT:
    I make a little changes in code to make it easier to reproduce by invoking qca method in main function, so it looks this way:

    int main(int argc, char *argv[])
    {
        QCA::Initializer init;
        // code of application 
        QApplication a(argc, argv);
        qDebug() << __FILE__ << __LINE__ << QCA::supportedFeatures();
        // some application code 
        return  a.exec();
    }
    

    After this modification, I launch app on clean windows and when i close the window it crashes. Debug is printed and it shows me that my library supports so many function:
    "("random", "md5", "sha1", "keystorelist", "sha0", "ripemd160", "md4", "sha224", "sha256", "sha384", "sha512", "hmac(md5)", "hmac(sha1)", "hmac(sha224)", "hmac(sha256)", "hmac(sha384)", "hmac(sha512)", "hmac(ripemd160)", "aes128-ecb", "aes128-cfb", "aes128-cbc", "aes128-cbc-pkcs7", "aes128-ofb", "aes128-ctr", "aes192-ecb", "aes192-cfb", "aes192-cbc", "aes192-cbc-pkcs7", "aes192-ofb", "aes192-ctr", "aes256-ecb", "aes256-cbc", "aes256-cbc-pkcs7", "aes256-cfb", "aes256-ofb", "aes256-ctr", "blowfish-ecb", "blowfish-cbc-pkcs7", "blowfish-cbc", "blowfish-cfb", "blowfish-ofb", "tripledes-ecb", "tripledes-cbc", "des-ecb", "des-ecb-pkcs7", "des-cbc", "des-cbc-pkcs7", "des-cfb", "des-ofb", "cast5-ecb", "cast5-cbc", "cast5-cbc-pkcs7", "cast5-cfb", "cast5-ofb", "pbkdf1(sha1)", "pbkdf2(sha1)", "pkey", "dlgroup", "rsa", "dsa", "dh", "cert", "csr", "crl", "certcollection", "pkcs12", "tls", "cms", "ca") "

    I think the problem is still with deinit() which is called in constructor of QCA::Initializer as I wrote before.

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

      Hi,

      Which version of Qt are you using ? And QCA ?

      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
      • jmrodrigJ Offline
        jmrodrigJ Offline
        jmrodrig
        wrote on last edited by
        #3

        Hi,

        I have exactly the same problem.
        I use Qt 5.7, QCA 2.1.1, and msvc2015 32bit.
        My app crashes when "QCA::Initializer init;" goes out of scope.
        Has anybody an idea to solve the problem?

        Thanks

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

          You should move QCA's init after your app object creation.

          Qt's internal structures/data are ready to be used only after a QXXXApplication has been created.

          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