Bug 325077

Summary: KAlgebra crashed when I try to reduce plot
Product: [Applications] kalgebra Reporter: Keyu Tao <taoky1999>
Component: generalAssignee: Aleix Pol <aleixpol>
Status: RESOLVED FIXED    
Severity: crash CC: ahitech, diogoagdiogenes, john.moore.ga
Priority: NOR Keywords: drkonqi
Version: 0.11   
Target Milestone: ---   
Platform: Fedora RPMs   
OS: Linux   
Latest Commit: Version Fixed In: 4.12
Sentry Crash Report:

Description Keyu Tao 2013-09-19 01:50:44 UTC
Application: kalgebra (0.11)
KDE Platform Version: 4.10.5
Qt Version: 4.8.5
Operating System: Linux 3.10.11-200.fc19.x86_64 x86_64
Distribution: "Fedora release 19 (Schrödinger’s Cat)"

-- Information about the crash:
- What I was doing when the application crashed:

KAlgebra crashed again. When I plot 'y=root(x,y)' and try to use the mouse wheel to reduce the plot. KAlgebra crashed.

The crash can be reproduced every time.

-- Backtrace:
Application: KAlgebra (kalgebra), signal: Segmentation fault
Using host libthread_db library "/lib64/libthread_db.so.1".
[Current thread is 1 (Thread 0x7f57d2e3c8c0 (LWP 2376))]

Thread 3 (Thread 0x7f57c03e3700 (LWP 2377)):
#0  0x00007f57d280a575 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#1  0x00007f57c20bdc9b in radeon_drm_cs_emit_ioctl () from /usr/lib64/dri/r600_dri.so
#2  0x00007f57d2806c53 in start_thread () from /lib64/libpthread.so.0
#3  0x00007f57d2231d3d in clone () from /lib64/libc.so.6

Thread 2 (Thread 0x7f57befe8700 (LWP 2378)):
#0  0x00007f57d2809a6c in pthread_mutex_unlock () from /lib64/libpthread.so.0
#1  0x0000003db5087281 in g_mutex_unlock () from /lib64/libglib-2.0.so.0
#2  0x0000003db5048006 in g_main_context_iterate.isra.22 () from /lib64/libglib-2.0.so.0
#3  0x0000003db50481fc in g_main_context_iteration () from /lib64/libglib-2.0.so.0
#4  0x0000003dbd1a7166 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib64/libQtCore.so.4
#5  0x0000003dbd178ecf in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib64/libQtCore.so.4
#6  0x0000003dbd1791c5 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib64/libQtCore.so.4
#7  0x0000003dbd07866f in QThread::exec() () from /lib64/libQtCore.so.4
#8  0x0000003dbd15a733 in QInotifyFileSystemWatcherEngine::run() () from /lib64/libQtCore.so.4
#9  0x0000003dbd07ad0f in QThreadPrivate::start(void*) () from /lib64/libQtCore.so.4
#10 0x00007f57d2806c53 in start_thread () from /lib64/libpthread.so.0
#11 0x00007f57d2231d3d in clone () from /lib64/libc.so.6

Thread 1 (Thread 0x7f57d2e3c8c0 (LWP 2376)):
[KCrash Handler]
#5  0x0000003dc26122bf in QList<QPointF>::append(QPointF const&) () from /lib64/libanalitzaplot.so.4
#6  0x0000003dc2610ed6 in MarchingSquares::tipo01(QList<sArista2D>) () from /lib64/libanalitzaplot.so.4
#7  0x0000003dc2611249 in MarchingSquares::identificar_tipo(sMarching_Square) () from /lib64/libanalitzaplot.so.4
#8  0x0000003dc261142b in MarchingSquares::buildGeometry() () from /lib64/libanalitzaplot.so.4
#9  0x0000003dc2621564 in FunctionImplicit::update(QRectF const&) () from /lib64/libanalitzaplot.so.4
#10 0x0000003dc262cccd in Analitza::Plotter2D::updateFunctions(QModelIndex const&, int, int) () from /lib64/libanalitzaplot.so.4
#11 0x0000003dc262cf7f in Analitza::Plotter2D::updateScale(bool) () from /lib64/libanalitzaplot.so.4
#12 0x0000003dc262d00b in Analitza::Plotter2D::setViewport(QRectF const&, bool) () from /lib64/libanalitzaplot.so.4
#13 0x0000003dc262eb3c in Analitza::Plotter2D::scaleViewport(double, QPoint const&) () from /lib64/libanalitzaplot.so.4
#14 0x0000003dbfe176ec in QWidget::event(QEvent*) () from /lib64/libQtGui.so.4
#15 0x0000003dbfdc84dc in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /lib64/libQtGui.so.4
#16 0x0000003dbfdcfaf4 in QApplication::notify(QObject*, QEvent*) () from /lib64/libQtGui.so.4
#17 0x0000003dc20415ba in KApplication::notify(QObject*, QEvent*) () from /lib64/libkdeui.so.5
#18 0x0000003dbd17a26d in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /lib64/libQtCore.so.4
#19 0x0000003dbfe3c0df in QETWidget::translateWheelEvent(int, int, int, QFlags<Qt::MouseButton>, QFlags<Qt::KeyboardModifier>, Qt::Orientation) () from /lib64/libQtGui.so.4
#20 0x0000003dbfe3fe0c in QETWidget::translateMouseEvent(_XEvent const*) () from /lib64/libQtGui.so.4
#21 0x0000003dbfe3e39c in QApplication::x11ProcessEvent(_XEvent*) () from /lib64/libQtGui.so.4
#22 0x0000003dbfe64e54 in x11EventSourceDispatch(_GSource*, int (*)(void*), void*) () from /lib64/libQtGui.so.4
#23 0x0000003db5047e06 in g_main_context_dispatch () from /lib64/libglib-2.0.so.0
#24 0x0000003db5048158 in g_main_context_iterate.isra.22 () from /lib64/libglib-2.0.so.0
#25 0x0000003db50481fc in g_main_context_iteration () from /lib64/libglib-2.0.so.0
#26 0x0000003dbd1a7145 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib64/libQtCore.so.4
#27 0x0000003dbfe64fc6 in QGuiEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib64/libQtGui.so.4
#28 0x0000003dbd178ecf in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib64/libQtCore.so.4
#29 0x0000003dbd1791c5 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib64/libQtCore.so.4
#30 0x0000003dbd17e45b in QCoreApplication::exec() () from /lib64/libQtCore.so.4
#31 0x0000000000414ed9 in main ()

Reported using DrKonqi
Comment 1 Keyu Tao 2013-09-19 01:54:02 UTC
By the way, using 3D Plot doesn't have this problem. This bug only appears in 2D Plot.
Comment 2 Aleix Pol 2013-10-27 16:33:20 UTC
Git commit 0d8b51273fa82b53e2679c2d4f09f55612cfc58b by Aleix Pol.
Committed on 27/10/2013 at 16:32.
Pushed by apol into branch 'master'.

Fix crash in marchingsquares

Make sure we don't overflow when looking for the triangles... I think.
Improve the tests while at it.

M  +5    -0    analitzagui/plotsview2d.cpp
M  +2    -0    analitzagui/plotsview2d.h
M  +1    -1    analitzaplot/private/utils/marchingsquares.cpp
M  +14   -1    analitzaplot/tests/planecurvetest.cpp

http://commits.kde.org/analitza/0d8b51273fa82b53e2679c2d4f09f55612cfc58b
Comment 3 Aleix Pol 2013-10-28 11:53:24 UTC
*** Bug 325053 has been marked as a duplicate of this bug. ***
Comment 4 Aleix Pol 2013-10-28 11:54:54 UTC
*** Bug 323574 has been marked as a duplicate of this bug. ***
Comment 5 Aleix Pol 2013-10-28 11:58:29 UTC
*** Bug 321958 has been marked as a duplicate of this bug. ***
Comment 6 Jekyll Wu 2013-11-01 07:33:27 UTC
*** Bug 326160 has been marked as a duplicate of this bug. ***