Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-71446

Double initialize of globalData

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • Not Evaluated
    • None
    • 5.11.2
    • Network: SSL
    • None
    • OpenSSL 1.1.1
    • 611423099667d2dc18e6fb63967cbbfd8a65829c

    Description

      A program linked with openssl 1.1.1 + libQt5Network.so.5.11.2 freezes during startup because the constructor of globalData, defined in src/network/ssl/qsslsocket.cpp:353, causes a bunch of methods to be called, eventually calling globalData(). This is the backtrace:

       

      #0  (anonymous namespace)::Q_QGS_globalData::innerFunction ()
          at ssl/qsslsocket.cpp:353
      #1  0x0000000801e20cf1 in QGlobalStatic<QSslSocketGlobalData, (anonymous namespace)::Q_QGS_globalData::innerFunction(), (anonymous namespace)::Q_QGS_globalData::guard>::operator()() (
          this=0x801e64508 <globalData>)
          at ../../include/QtCore/../../src/corelib/global/qglobalstatic.h:138
      #2  0x0000000801e20d5b in QSslSocketPrivate::setDefaultSupportedCiphers (ciphers=...)
          at ssl/qsslsocket.cpp:2126
      #3  0x0000000801e3a736 in QSslSocketPrivate::resetDefaultCiphers ()
          at ssl/qsslsocket_openssl.cpp:471
      #4  0x0000000801e41eee in QSslSocketPrivate::ensureCiphersAndCertsLoaded ()
          at ssl/qsslsocket_openssl11.cpp:120
      #5  0x0000000801e3907b in QSslSocketPrivate::ensureInitialized ()
          at ssl/qsslsocket_openssl.cpp:416
      #6  0x0000000801e13da2 in QSslCertificatePrivate::QSslCertificatePrivate (this=0x8055a3d30)
          at ssl/qsslcertificate_p.h:86
      #7  0x0000000801e12a76 in QSslCertificate::QSslCertificate (this=0x8055c1208, data=..., format=QSsl::Pem)
          at ssl/qsslcertificate.cpp:157
      #8  0x0000000801e1634e in QSslConfigurationPrivate::QSslConfigurationPrivate (this=0x8055c1200)
          at ssl/qsslconfiguration_p.h:87
      #9  0x0000000801e23cf7 in QSslSocketGlobalData::QSslSocketGlobalData (
          this=0x801e64510 <(anonymous namespace)::Q_QGS_globalData::innerFunction()::holder>)
          at ssl/qsslsocket.cpp:342
      #10 0x0000000801e23165 in (anonymous namespace)::Q_QGS_globalData::innerFunction()::Holder::Holder() (
          this=0x801e64510 <(anonymous namespace)::Q_QGS_globalData::innerFunction()::holder>)
          at ssl/qsslsocket.cpp:353
      #11 0x0000000801e23116 in (anonymous namespace)::Q_QGS_globalData::innerFunction ()
          at ssl/qsslsocket.cpp:353
      

       

      Notice that frame #0 and #11 are the same.

       

      src/network/ssl/qsslsocket_mac.cpp contains this comment:

       

      void QSslSocketPrivate::ensureInitialized()
       {
       const QMutexLocker locker(qt_securetransport_mutex);
       if (s_loadedCiphersAndCerts)
       return;
      // We have to set it before setDefaultSupportedCiphers,
       // since this function can trigger static (global)'s initialization
       // and as a result - recursive ensureInitialized call
       // from QSslCertificatePrivate's ctor.
       s_loadedCiphersAndCerts = true;
      

       

       

      although not the same, something similar is happening in this case too.

      Attachments

        Issue Links

          For Gerrit Dashboard: QTBUG-71446
          # Subject Branch Project Status CR V

          Activity

            People

              tpochep Timur Pocheptsov
              vasild Vasil Dimov
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes