Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LeveyJenningsSimple-example segfaults #22

Open
krf opened this issue Aug 3, 2021 · 1 comment
Open

LeveyJenningsSimple-example segfaults #22

krf opened this issue Aug 3, 2021 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@krf
Copy link
Contributor

krf commented Aug 3, 2021

Steps to reproduce:

Run valgrind ./bin/LeveyJenningsSimple-example

Result:

==220254== Invalid read of size 8
==220254==    at 0x4959143: KDChart::Chart::Private::paintAll(QPainter*) (src/kdab/KDChart/src/KDChart/KDChartChart.cpp:1093)
==220254==    by 0x495A5C9: KDChart::Chart::paintEvent(QPaintEvent*) (src/kdab/KDChart/src/KDChart/KDChartChart.cpp:1410)
==220254==    by 0x4CFD5DD: QWidget::event(QEvent*) (in /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5.15.2)
==220254==    by 0x495D0AB: KDChart::Chart::event(QEvent*) (src/kdab/KDChart/src/KDChart/KDChartChart.cpp:1768)
==220254==    by 0x4CBA782: QApplicationPrivate::notify_helper(QObject*, QEvent*) (in /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5.15.2)
==220254==    by 0x5C027B9: QCoreApplication::notifyInternal2(QObject*, QEvent*) (in /usr/lib/x86_64-linux-gnu/libQt5Core.so.5.15.2)
==220254==    by 0x4CF5539: QWidgetPrivate::sendPaintEvent(QRegion const&) (in /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5.15.2)
==220254==    by 0x4CF5D61: QWidgetPrivate::drawWidget(QPaintDevice*, QRegion const&, QPoint const&, QFlags<QWidgetPrivate::DrawWidgetFlag>, QPainter*, QWidgetRepaintManager*) (in /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5.15.2)
==220254==    by 0x4CF71C2: QWidgetPrivate::paintSiblingsRecursive(QPaintDevice*, QList<QObject*> const&, int, QRegion const&, QPoint const&, QFlags<QWidgetPrivate::DrawWidgetFlag>, QPainter*, QWidgetRepaintManager*) (in /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5.15.2)
==220254==    by 0x4CF6FE1: QWidgetPrivate::paintSiblingsRecursive(QPaintDevice*, QList<QObject*> const&, int, QRegion const&, QPoint const&, QFlags<QWidgetPrivate::DrawWidgetFlag>, QPainter*, QWidgetRepaintManager*) (in /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5.15.2)
==220254==    by 0x4CF6FE1: QWidgetPrivate::paintSiblingsRecursive(QPaintDevice*, QList<QObject*> const&, int, QRegion const&, QPoint const&, QFlags<QWidgetPrivate::DrawWidgetFlag>, QPainter*, QWidgetRepaintManager*) (in /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5.15.2)
==220254==    by 0x4CF5A7B: QWidgetPrivate::drawWidget(QPaintDevice*, QRegion const&, QPoint const&, QFlags<QWidgetPrivate::DrawWidgetFlag>, QPainter*, QWidgetRepaintManager*) (in /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5.15.2)
==220254==  Address 0x17fad360 is 0 bytes inside a block of size 96 free'd
==220254==    at 0x484584F: operator delete(void*) (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==220254==    by 0x4955EB9: KDChart::Chart::Private::slotLayoutPlanes() (src/kdab/KDChart/src/KDChart/KDChartChart.cpp:652)
==220254==    by 0x5C3A5FF: ??? (in /usr/lib/x86_64-linux-gnu/libQt5Core.so.5.15.2)
==220254==    by 0x49CE3A2: KDChart::LeveyJenningsAxis::paintAsAbscissa(KDChart::PaintContext*) (src/kdab/KDChart/src/KDChart/Cartesian/KDChartLeveyJenningsAxis.cpp:210)
==220254==    by 0x49A3AB2: KDChart::CartesianAxis::paint(QPainter*) (src/kdab/KDChart/src/KDChart/Cartesian/KDChartCartesianAxis.cpp:553)
==220254==    by 0x4970D2C: KDChart::AbstractArea::paintAll(QPainter&) (src/kdab/KDChart/src/KDChart/KDChartAbstractArea.cpp:130)
==220254==    by 0x495914E: KDChart::Chart::Private::paintAll(QPainter*) (src/kdab/KDChart/src/KDChart/KDChartChart.cpp:1093)
==220254==    by 0x495A5C9: KDChart::Chart::paintEvent(QPaintEvent*) (src/kdab/KDChart/src/KDChart/KDChartChart.cpp:1410)
==220254==    by 0x4CFD5DD: QWidget::event(QEvent*) (in /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5.15.2)
==220254==    by 0x495D0AB: KDChart::Chart::event(QEvent*) (src/kdab/KDChart/src/KDChart/KDChartChart.cpp:1768)
==220254==    by 0x4CBA782: QApplicationPrivate::notify_helper(QObject*, QEvent*) (in /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5.15.2)
==220254==    by 0x5C027B9: QCoreApplication::notifyInternal2(QObject*, QEvent*) (in /usr/lib/x86_64-linux-gnu/libQt5Core.so.5.15.2)
==220254==  Block was alloc'd at
==220254==    at 0x4842FB3: operator new(unsigned long) (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==220254==    by 0x49568CF: KDChart::Chart::Private::slotLayoutPlanes() (src/kdab/KDChart/src/KDChart/KDChartChart.cpp:951)
==220254==    by 0x5C3A5FF: ??? (in /usr/lib/x86_64-linux-gnu/libQt5Core.so.5.15.2)
==220254==    by 0x4958BC2: KDChart::Chart::Private::updateDirtyLayouts() (src/kdab/KDChart/src/KDChart/KDChartChart.cpp:1057)
==220254==    by 0x4959067: KDChart::Chart::Private::paintAll(QPainter*) (src/kdab/KDChart/src/KDChart/KDChartChart.cpp:1079)
==220254==    by 0x495A5C9: KDChart::Chart::paintEvent(QPaintEvent*) (src/kdab/KDChart/src/KDChart/KDChartChart.cpp:1410)
==220254==    by 0x4CFD5DD: QWidget::event(QEvent*) (in /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5.15.2)
==220254==    by 0x495D0AB: KDChart::Chart::event(QEvent*) (src/kdab/KDChart/src/KDChart/KDChartChart.cpp:1768)
==220254==    by 0x4CBA782: QApplicationPrivate::notify_helper(QObject*, QEvent*) (in /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5.15.2)
==220254==    by 0x5C027B9: QCoreApplication::notifyInternal2(QObject*, QEvent*) (in /usr/lib/x86_64-linux-gnu/libQt5Core.so.5.15.2)
==220254==    by 0x4CF5539: QWidgetPrivate::sendPaintEvent(QRegion const&) (in /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5.15.2)
==220254==    by 0x4CF5D61: QWidgetPrivate::drawWidget(QPaintDevice*, QRegion const&, QPoint const&, QFlags<QWidgetPrivate::DrawWidgetFlag>, QPainter*, QWidgetRepaintManager*) (in /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5.15.2)

Problem:
The member planeLayoutItems gets modified during iteration over it inside the Chart::Private::paintAll method.

This must be a longer term issue. It doesn't seem to be related to the recent Qt 6 port of KDChart (checked by reverting the code base to the previous state).

@krf krf added the bug Something isn't working label Aug 3, 2021
@krf krf assigned krf and ivan-cukic Aug 3, 2021
@krf
Copy link
Contributor Author

krf commented Aug 3, 2021

@ivan-cukic Could you have a look maybe? You have the best overview of KDChart internals right now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants