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

QThread crash on thread-exit with adopted threads started by winpthreads

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P1: Critical
    • 6.9.0
    • 6.9
    • Core: Threads
    • None
    • Windows, MinGW
    • Windows

    Description

      See QTBUG-131476 for the debugging details of the older regression-from-6.3 issue. This task is concentrated on the regression introduced in 6.9 with commit 4578e3f898e2c3221e08c1a39272993cb7790cd1(6.9), which replaced the adopted-thread-watcher-thread mechanism with a thread_local. Unfortunately, the state of thread_local on Windows is a mess.

      As far as I can tell, since that commit, QThreadData will crash if:

      • it's an adopted thread
      • the adopted thread was started by winpthreads
      • the toolchain used libgcc's __emutls support

      Qt doesn't directly use winpthreads on Windows, which is why our unit tests haven't caught this. But if you use libstdc++ threading support like std::thread and std::async, it will on your behalf. So this is a unit-test to add to tst_qthread.cpp.

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              thiago Thiago Macieira
              thiago Thiago Macieira
              Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes