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

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

XMLWordPrintable

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

      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.

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

            thiago Thiago Macieira
            thiago Thiago Macieira
            Votes:
            2 Vote for this issue
            Watchers:
            12 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes