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. QtNetwork and OpenSSL threading...
QtWS25 Last Chance

QtNetwork and OpenSSL threading...

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 2 Posters 305 Views
  • 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.
  • D Offline
    D Offline
    Didier M.
    wrote on last edited by Didier M.
    #1

    I have what seems like a deadlock issue in my app, which of course only happens in release and disappears as soon as I try to add any kind of debugging logging or code. I’m posting here in the hope that someone can maybe share a similar experience or suggest an avenue I can use to try and figure out the cause of the problem. This will also lay out my assumptions, some of which may be misguided.

    I’m currently using Qt 5.12.4 and I see the deadlock on macOS 10.14 and 10.15. I use QtNetwork to download a receipt from a web server via https. I assume this uses OpenSLL to do so. I assume that would be the dylib installed on the machine itself since I do not ship any other OpenSSL dylib with my app.

    The receipt’s signature is then tested using OpenSLL in my app directly.l I’m assuming this is using the same OpenSSL dylib that Qt uses since, again, I do not have any other linked that I know of.

    I’m aware that OpenSSL (at least pre 1.1.1) is not meant to be thread-safe when using its objects. I had a crash in my app that took place in an assertion in the std::recursive_mutex destructor from inside the openSSL library. I assume that somehow this meant that my app was using OpenSSL on multiple threads (which is was even though it was doing do on different objects) so I decided to be safe and I forced all my own OpenSSL calls to be from the main thread. This is the point where this deadlock started happening.

    Now, I’m not 100% sure it’s a real deadlock. The app just hangs on init at the point where it seems like QtNetword would do the QNetworkManager post call to download the receipt. Again, not 100% sure of the spot since I can’t add debug logs or the app doesn’t lock up anymore.

    Does this ring a bell for anyone on interactions between QTNetwork and OpenSSL? Anyone can suggest something I can try to get more info on where the issue comes from? Any ideas appreciated.

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

      Hi,

      Did you build Qt yourself ? Because otherwise, Qt doesn't use OpenSSL on macOS since a long time. It uses the SecureTransport framework.

      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
      1
      • D Offline
        D Offline
        Didier M.
        wrote on last edited by
        #3

        I'm using the commercial binaries so this definitely helps clarify my assumptions. I was assuming OpenSSL because the Windows commercial binaries seem to use OpenSSL but I guess I never bothered to verify this.

        So my deadlock/issue is somewhere else. Thanks for the quick help!

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

          Just in case, try checking with 5.13.1 and 5.12.5. Maybe something changed in between and your issue might already be solved.

          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
          1

          • Login

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