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

[REG 5.14.2->5.15.2] Windows: QtChart::QChart in Worker Thread Crash

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Reported
    • Priority: P1: Critical
    • Resolution: Unresolved
    • Affects Version/s: 5.15.2
    • Fix Version/s: None
    • Component/s: Charts
    • Labels:
      None
    • Environment:
      OS: Microsoft Windows 10 Pro 64-bit (version 10.0.18363 Build 18363)

      Compilers:
      5.15.2: Microsoft Visual C++ Compiler 16.8.31019.35 (amd64)
      5.14.2: Microsoft Visual C++ Compiler 15.9.28307.1401 (x86_amd64)
    • Platform/s:
      Windows

      Description

      Minimal reproducible example: https://github.com/adrianyuenmi/ScatterSeriesTest

      Regression

      • Does not crash on Qt 5.14.2 (MSVC2017 64bit)
      • Crashes on Qt 5.15.2 (MSVC2019 64bit)

      Use Case

      I want to generate a QImage of a line chart in a worker thread. QChartView cannot be employed in my case as the QWidget cannot be created in non-GUI threads.

      The current implementation is somewhat convoluted. The QChart has to be attached to a QGraphicsScene, which is then rendered by a QPainter attached to the output QImage.

      Bug Reproduction

      • Build and run the application in Debug mode
      • Press the top button "Generate In-Range" to generate a QChart which is displayed.
      • Repeatedly pressing the top button did not generate any bugs. Application behaviour is normal.
      • Press the bottom button "Generate Out-of-Range", a(n incorrectly renderred) graph is displayed
      • Repeatedly pressing should cause a crash with the below message.
      "ASSERT failure in QCoreApplication::sendEvent: "Cannot send events to objects owned by a different thread. Current thread 0x0x1d488bbcb40. Receiver '' (of type 'QTextDocument') was created in thread 0x0x1d48646c120", file kernel\qcoreapplication.cpp, line 558 Debug Error!

      Secondary Bug

      Occurs for both Qt 5.14.2 and 5.15.2.

      The QChart renders strangely when there is at least one value outside of (y-)axis range. Did not test for x-axis.

      See the attached image.

        Attachments

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

          Activity

            People

            Assignee:
            e0348803 Miikka Heikkinen
            Reporter:
            meridian-adrian Adrian Y
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:

                Gerrit Reviews

                There are no open Gerrit changes