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

Stack overflow on high zoom out of QChart with a logarithmic axis

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Reported
    • Priority: P2: Important
    • Resolution: Unresolved
    • Affects Version/s: 5.12.3
    • Fix Version/s: None
    • Component/s: Charts
    • Labels:
      None
    • Environment:
      Ubuntu 18.04 amd64
    • Platform/s:
      Linux/X11

      Description

      An attempt to zoom out a chart with a logarithmic axis too many times leads to crash. Namely, if you maximize the window of the following program on a FullHD screen, and then right-click the chart 9 or 10 times to zoom out, you'll get a segfault due to stack overflow on the final click.

      #include <QtCharts>
      #include <QApplication>
      
      int main(int argc, char** argv)
      {
      	QApplication a(argc,argv);
      
      	QChartView view;
      	view.setRubberBand(QChartView::RectangleRubberBand);
      
      	const auto series=new QLineSeries;
      	for(int i=1;i<100;++i)
      		series->append(i,i);
      	view.chart()->addSeries(series);
      
      	const auto axisY=new QLogValueAxis;
      	axisY->setBase(10);
      	view.chart()->addAxis(axisY, Qt::AlignLeft);
      
      	series->attachAxis(axisY);
      
      	view.show();
      
      	return a.exec();
      }
      

      The backtrace looks like follows:

      #0  0x00007ffff72d645f in QString::reallocData(unsigned int, bool) () at /opt/qt512/lib/libQt5Core.so.5
      #1  0x00007ffff645f978 in QTextBlock::text() const () at /opt/qt512/lib/libQt5Gui.so.5
      #2  0x00007ffff643634c in QTextEngine::validate() const () at /opt/qt512/lib/libQt5Gui.so.5
      #3  0x00007ffff643d461 in QTextEngine::itemize() const () at /opt/qt512/lib/libQt5Gui.so.5
      #4  0x00007ffff644773c in QTextLayout::beginLayout() () at /opt/qt512/lib/libQt5Gui.so.5
      #5  0x00007ffff649307d in  () at /opt/qt512/lib/libQt5Gui.so.5
      #6  0x00007ffff6494594 in  () at /opt/qt512/lib/libQt5Gui.so.5
      #7  0x00007ffff649a402 in  () at /opt/qt512/lib/libQt5Gui.so.5
      #8  0x00007ffff649aa09 in  () at /opt/qt512/lib/libQt5Gui.so.5
      #9  0x00007ffff649ac78 in QTextDocumentLayout::doLayout(int, int, int) () at /opt/qt512/lib/libQt5Gui.so.5
      #10 0x00007ffff649bbd3 in QTextDocumentLayout::documentChanged(int, int, int) () at /opt/qt512/lib/libQt5Gui.so.5
      #11 0x00007ffff6479400 in QTextDocumentPrivate::clear() () at /opt/qt512/lib/libQt5Gui.so.5
      #12 0x00007ffff6467aea in QTextDocument::setHtml(QString const&) () at /opt/qt512/lib/libQt5Gui.so.5
      #13 0x00007ffff7a9fa80 in  () at /opt/qt512/lib/libQt5Widgets.so.5
      #14 0x00007ffff7eda497 in QtCharts::ChartPresenter::textBoundingRect(QFont const&, QString const&, double) () at /opt/qt512/lib/libQt5Charts.so.5
      #15 0x00007ffff7f190d3 in QtCharts::ChartLogValueAxisY::sizeHint(Qt::SizeHint, QSizeF const&) const () at /opt/qt512/lib/libQt5Charts.so.5
      #16 0x00007ffff7bbe173 in  () at /opt/qt512/lib/libQt5Widgets.so.5
      #17 0x00007ffff7bbe940 in QGraphicsLayoutItem::effectiveSizeHint(Qt::SizeHint, QSizeF const&) const () at /opt/qt512/lib/libQt5Widgets.so.5
      #18 0x00007ffff7f7b620 in QtCharts::CartesianChartLayout::calculateAxisGeometry(QRectF const&, QList<QtCharts::ChartAxisElement*> const&, bool) const () at /opt/qt512/lib/libQt5Charts.so.5
      #19 0x00007ffff7f7af13 in QtCharts::AbstractChartLayout::setGeometry(QRectF const&) () at /opt/qt512/lib/libQt5Charts.so.5
      #20 0x00007ffff7efd777 in QtCharts::ChartAxisElement::handleRangeChanged(double, double) () at /opt/qt512/lib/libQt5Charts.so.5
      #21 0x00007ffff7466a45 in QMetaObject::activate(QObject*, int, int, void**) () at /opt/qt512/lib/libQt5Core.so.5
      #22 0x00007ffff7f0288d in QtCharts::QAbstractAxisPrivate::rangeChanged(double, double) () at /opt/qt512/lib/libQt5Charts.so.5
      #23 0x00007ffff7f19d03 in QtCharts::QLogValueAxisPrivate::setRange(double, double) () at /opt/qt512/lib/libQt5Charts.so.5
      #24 0x00007ffff7466a45 in QMetaObject::activate(QObject*, int, int, void**) () at /opt/qt512/lib/libQt5Core.so.5
      #25 0x00007ffff7f26a00 in QtCharts::AbstractDomain::rangeVerticalChanged(double, double) () at /opt/qt512/lib/libQt5Charts.so.5
      #26 0x00007ffff7f29f5a in QtCharts::XLogYDomain::setRange(double, double, double, double) () at /opt/qt512/lib/libQt5Charts.so.5
      #27 0x00007ffff7466a45 in QMetaObject::activate(QObject*, int, int, void**) () at /opt/qt512/lib/libQt5Core.so.5
      #28 0x00007ffff7f0288d in QtCharts::QAbstractAxisPrivate::rangeChanged(double, double) () at /opt/qt512/lib/libQt5Charts.so.5
      #29 0x00007ffff7f19d03 in QtCharts::QLogValueAxisPrivate::setRange(double, double) () at /opt/qt512/lib/libQt5Charts.so.5
      #30 0x00007ffff7466a45 in QMetaObject::activate(QObject*, int, int, void**) () at /opt/qt512/lib/libQt5Core.so.5
      #31 0x00007ffff7f26a00 in QtCharts::AbstractDomain::rangeVerticalChanged(double, double) () at /opt/qt512/lib/libQt5Charts.so.5
      #32 0x00007ffff7f29f5a in QtCharts::XLogYDomain::setRange(double, double, double, double) () at /opt/qt512/lib/libQt5Charts.so.5
      
      
      ... (lots of repetitions of the six calls) ...
      
      #66685 0x00007ffff7f26a00 in QtCharts::AbstractDomain::rangeVerticalChanged(double, double) () at /opt/qt512/lib/libQt5Charts.so.5
      #66686 0x00007ffff7f29f5a in QtCharts::XLogYDomain::setRange(double, double, double, double) () at /opt/qt512/lib/libQt5Charts.so.5
      #66687 0x00007ffff7466a45 in QMetaObject::activate(QObject*, int, int, void**) () at /opt/qt512/lib/libQt5Core.so.5
      #66688 0x00007ffff7f0288d in QtCharts::QAbstractAxisPrivate::rangeChanged(double, double) () at /opt/qt512/lib/libQt5Charts.so.5
      #66689 0x00007ffff7f19d03 in QtCharts::QLogValueAxisPrivate::setRange(double, double) () at /opt/qt512/lib/libQt5Charts.so.5
      #66690 0x00007ffff7466a45 in QMetaObject::activate(QObject*, int, int, void**) () at /opt/qt512/lib/libQt5Core.so.5
      #66691 0x00007ffff7f26a00 in QtCharts::AbstractDomain::rangeVerticalChanged(double, double) () at /opt/qt512/lib/libQt5Charts.so.5
      #66692 0x00007ffff7ed49da in QtCharts::ChartDataSet::zoomOutDomain(QRectF const&) () at /opt/qt512/lib/libQt5Charts.so.5
      #66693 0x00007ffff7ee1995 in QtCharts::QChartPrivate::zoomOut(double) () at /opt/qt512/lib/libQt5Charts.so.5
      #66694 0x00007ffff7ee3448 in QtCharts::QChartView::mouseReleaseEvent(QMouseEvent*) () at /opt/qt512/lib/libQt5Charts.so.5
      #66695 0x00007ffff7904fd8 in QWidget::event(QEvent*) () at /opt/qt512/lib/libQt5Widgets.so.5
      #66696 0x00007ffff79a7c9e in QFrame::event(QEvent*) () at /opt/qt512/lib/libQt5Widgets.so.5
      #66697 0x00007ffff7bfc6b3 in QGraphicsView::viewportEvent(QEvent*) () at /opt/qt512/lib/libQt5Widgets.so.5
      #66698 0x00007ffff7436c5d in QCoreApplicationPrivate::sendThroughObjectEventFilters(QObject*, QEvent*) () at /opt/qt512/lib/libQt5Core.so.5
      #66699 0x00007ffff78c4c35 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /opt/qt512/lib/libQt5Widgets.so.5
      #66700 0x00007ffff78cd058 in QApplication::notify(QObject*, QEvent*) () at /opt/qt512/lib/libQt5Widgets.so.5
      #66701 0x00007ffff7436ed8 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () at /opt/qt512/lib/libQt5Core.so.5
      #66702 0x00007ffff78cb65f in QApplicationPrivate::sendMouseEvent(QWidget*, QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer<QWidget>&, bool, bool) () at /opt/qt512/lib/libQt5Widgets.so.5
      #66703 0x00007ffff791fec1 in  () at /opt/qt512/lib/libQt5Widgets.so.5
      #66704 0x00007ffff7922b5a in  () at /opt/qt512/lib/libQt5Widgets.so.5
      #66705 0x00007ffff78c4c5c in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /opt/qt512/lib/libQt5Widgets.so.5
      #66706 0x00007ffff78cc190 in QApplication::notify(QObject*, QEvent*) () at /opt/qt512/lib/libQt5Widgets.so.5
      #66707 0x00007ffff7436ed8 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () at /opt/qt512/lib/libQt5Core.so.5
      #66708 0x00007ffff634a8fb in QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::MouseEvent*) () at /opt/qt512/lib/libQt5Gui.so.5
      #66709 0x00007ffff634ba65 in QGuiApplicationPrivate::processWindowSystemEvent(QWindowSystemInterfacePrivate::WindowSystemEvent*) () at /opt/qt512/lib/libQt5Gui.so.5
      #66710 0x00007ffff63242bb in QWindowSystemInterface::sendWindowSystemEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /opt/qt512/lib/libQt5Gui.so.5
      #66711 0x00007ffff03ada6a in  () at /opt/qt512/plugins/platforms/../../lib/libQt5XcbQpa.so.5
      #66712 0x00007ffff4d3b387 in g_main_context_dispatch () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
      #66713 0x00007ffff4d3b5c0 in  () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
      #66714 0x00007ffff4d3b64c in g_main_context_iteration () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
      #66715 0x00007ffff7493f7f in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /opt/qt512/lib/libQt5Core.so.5
      #66716 0x00007ffff74351fa in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () at /opt/qt512/lib/libQt5Core.so.5
      #66717 0x00007ffff743e330 in QCoreApplication::exec() () at /opt/qt512/lib/libQt5Core.so.5
      #66718 0x00005555555551a3 in main(int, char**) (argc=1, argv=0x7fffffffdcf8) at test.cpp:24
      

        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:
              10110111 Ruslan Kabatsayev
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:

                Gerrit Reviews

                There are no open Gerrit changes