Bug 293183 - Kstars crashes due to change in density of stars
Summary: Kstars crashes due to change in density of stars
Status: RESOLVED FIXED
Alias: None
Product: kstars
Classification: Unclassified
Component: general (show other bugs)
Version: 2.0.0
Platform: Ubuntu Packages Linux
: NOR crash (vote)
Target Milestone: ---
Assignee: Akarsh Simha
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-02-03 03:10 UTC by Sandesh
Modified: 2012-02-05 22:59 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sandesh 2012-02-03 03:10:30 UTC
Application: kstars (2.0.0)
KDE Platform Version: 4.7.4 (4.7.4)
Qt Version: 4.7.4
Operating System: Linux 3.0.0-15-generic x86_64
Distribution: Ubuntu 11.10

-- Information about the crash:
- What I was doing when the application crashed:
I was changing the density of stars and when I pressed the apply button,it crashed.This is happening every time.

The crash can be reproduced every time.

-- Backtrace:
Application: KStars (kstars), signal: Segmentation fault
[Current thread is 1 (Thread 0x7f248075c7a0 (LWP 3600))]

Thread 2 (Thread 0x7f246d8dd700 (LWP 3602)):
#0  0x00007f247c1ec773 in poll () from /lib/x86_64-linux-gnu/libc.so.6
#1  0x00007f2477c8bf68 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007f2477c8c792 in g_main_loop_run () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007f2473bb5516 in ?? () from /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0
#4  0x00007f2477cb12b6 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#5  0x00007f247bacfefc in start_thread () from /lib/x86_64-linux-gnu/libpthread.so.0
#6  0x00007f247c1f889d in clone () from /lib/x86_64-linux-gnu/libc.so.6
#7  0x0000000000000000 in ?? ()

Thread 1 (Thread 0x7f248075c7a0 (LWP 3600)):
[KCrash Handler]
#6  0x00007f2460945e90 in ?? ()
#7  0x0000000000482efb in SkyMapComposite::draw (this=0x26a4510, skyp=0x7fff13a0be80) at ../../kstars/skycomponents/skymapcomposite.cpp:247
#8  0x00000000005af534 in SkyMapQDraw::paintEvent (this=0x2532b50, event=<optimized out>) at ../../kstars/skymapqdraw.cpp:60
#9  0x00007f247cea3c9c in QWidget::event(QEvent*) () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#10 0x00007f247ce53474 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#11 0x00007f247ce582e1 in QApplication::notify(QObject*, QEvent*) () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#12 0x00007f247e4da466 in KApplication::notify(QObject*, QEvent*) () from /usr/lib/libkdeui.so.5
#13 0x00007f247dcfbafc in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#14 0x00007f247cea0bd4 in QWidgetPrivate::drawWidget(QPaintDevice*, QRegion const&, QPoint const&, int, QPainter*, QWidgetBackingStore*) () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#15 0x00007f247cea17b0 in QWidgetPrivate::paintSiblingsRecursive(QPaintDevice*, QList<QObject*> const&, int, QRegion const&, QPoint const&, int, QPainter*, QWidgetBackingStore*) () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#16 0x00007f247cea092c in QWidgetPrivate::drawWidget(QPaintDevice*, QRegion const&, QPoint const&, int, QPainter*, QWidgetBackingStore*) () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#17 0x00007f247cea17b0 in QWidgetPrivate::paintSiblingsRecursive(QPaintDevice*, QList<QObject*> const&, int, QRegion const&, QPoint const&, int, QPainter*, QWidgetBackingStore*) () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#18 0x00007f247cea092c in QWidgetPrivate::drawWidget(QPaintDevice*, QRegion const&, QPoint const&, int, QPainter*, QWidgetBackingStore*) () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#19 0x00007f247cea17b0 in QWidgetPrivate::paintSiblingsRecursive(QPaintDevice*, QList<QObject*> const&, int, QRegion const&, QPoint const&, int, QPainter*, QWidgetBackingStore*) () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#20 0x00007f247cea092c in QWidgetPrivate::drawWidget(QPaintDevice*, QRegion const&, QPoint const&, int, QPainter*, QWidgetBackingStore*) () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#21 0x00007f247d064273 in ?? () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#22 0x00007f247ce973b0 in QWidgetPrivate::syncBackingStore() () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#23 0x00007f247cea41ac in QWidget::event(QEvent*) () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#24 0x00007f247d265dab in QMainWindow::event(QEvent*) () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#25 0x00007f247e5d6ca8 in KXmlGuiWindow::event(QEvent*) () from /usr/lib/libkdeui.so.5
#26 0x00007f247ce53474 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#27 0x00007f247ce582e1 in QApplication::notify(QObject*, QEvent*) () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#28 0x00007f247e4da466 in KApplication::notify(QObject*, QEvent*) () from /usr/lib/libkdeui.so.5
#29 0x00007f247dcfbafc in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#30 0x00007f247dcff51f in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#31 0x00007f247dd26a73 in ?? () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#32 0x00007f2477c8ba5d in g_main_context_dispatch () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#33 0x00007f2477c8c258 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#34 0x00007f2477c8c429 in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#35 0x00007f247dd26ed6 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#36 0x00007f247cefb10e in ?? () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#37 0x00007f247dcff92f in QCoreApplication::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#38 0x0000000000482928 in SkyMapComposite::emitProgressText (this=<optimized out>, message=<optimized out>) at ../../kstars/skycomponents/skymapcomposite.cpp:473
#39 0x00000000004a21c0 in ConstellationNamesComponent::ConstellationNamesComponent (this=0x3653050, parent=<optimized out>, cultures=0x2869050) at ../../kstars/skycomponents/constellationnamescomponent.cpp:42
#40 0x0000000000483482 in SkyMapComposite::reloadCNames (this=0x26a4510) at ../../kstars/skycomponents/skymapcomposite.cpp:464
#41 0x00000000005795a4 in KStars::slotApplyConfigChanges (this=0x24bca70) at ../../kstars/kstarsactions.cpp:435
#42 0x0000000000576a2a in KStars::qt_metacall (this=0x24bca70, _c=QMetaObject::InvokeMetaMethod, _id=28, _a=0x7fff13a0e300) at ./kstars.moc:234
#43 0x00007f247dd0eeba in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#44 0x00007f247e420555 in KConfigDialog::settingsChanged(QString const&) () from /usr/lib/libkdeui.so.5
#45 0x00007f247e420d83 in KConfigDialog::KConfigDialogPrivate::_k_settingsChangedSlot() () from /usr/lib/libkdeui.so.5
#46 0x00007f247e420ecd in KConfigDialog::qt_metacall(QMetaObject::Call, int, void**) () from /usr/lib/libkdeui.so.5
#47 0x00007f247dd0eeba in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#48 0x00007f247e426196 in KConfigDialogManager::updateSettings() () from /usr/lib/libkdeui.so.5
#49 0x00007f247e426f94 in KConfigDialogManager::qt_metacall(QMetaObject::Call, int, void**) () from /usr/lib/libkdeui.so.5
#50 0x00007f247dd0eeba in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#51 0x00007f247e43106e in KDialog::slotButtonClicked(int) () from /usr/lib/libkdeui.so.5
#52 0x00007f247e431612 in KDialog::qt_metacall(QMetaObject::Call, int, void**) () from /usr/lib/libkdeui.so.5
#53 0x00007f247e5083a0 in KPageDialog::qt_metacall(QMetaObject::Call, int, void**) () from /usr/lib/libkdeui.so.5
#54 0x00007f247e420ea0 in KConfigDialog::qt_metacall(QMetaObject::Call, int, void**) () from /usr/lib/libkdeui.so.5
#55 0x00007f247dd0eeba in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#56 0x00007f247dd1508e in QSignalMapper::mapped(int) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#57 0x00007f247dd1562b in QSignalMapper::map(QObject*) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#58 0x00007f247dd15a80 in QSignalMapper::qt_metacall(QMetaObject::Call, int, void**) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#59 0x00007f247dd0eeba in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#60 0x00007f247d4c4642 in QAbstractButton::clicked(bool) () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#61 0x00007f247d20a1fe in ?? () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#62 0x00007f247d20b53b in ?? () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#63 0x00007f247d20b7ac in QAbstractButton::mouseReleaseEvent(QMouseEvent*) () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#64 0x00007f247cea3cea in QWidget::event(QEvent*) () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#65 0x00007f247ce53474 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#66 0x00007f247ce58cbb in QApplication::notify(QObject*, QEvent*) () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#67 0x00007f247e4da466 in KApplication::notify(QObject*, QEvent*) () from /usr/lib/libkdeui.so.5
#68 0x00007f247dcfbafc in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#69 0x00007f247ce54442 in QApplicationPrivate::sendMouseEvent(QWidget*, QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer<QWidget>&, bool) () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#70 0x00007f247ced39d5 in ?? () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#71 0x00007f247ced294e in QApplication::x11ProcessEvent(_XEvent*) () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#72 0x00007f247cefb4a2 in ?? () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#73 0x00007f2477c8ba5d in g_main_context_dispatch () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#74 0x00007f2477c8c258 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#75 0x00007f2477c8c429 in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#76 0x00007f247dd26ed6 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#77 0x00007f247cefb10e in ?? () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#78 0x00007f247dcfacf2 in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#79 0x00007f247dcfaef7 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#80 0x00007f247dcff789 in QCoreApplication::exec() () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#81 0x000000000043547e in main (argc=1, argv=0x7fff13a10b58) at ../../kstars/main.cpp:192

Possible duplicates by query: bug 281442.

Reported using DrKonqi
Comment 1 Akarsh Simha 2012-02-04 02:23:11 UTC
I hit this bug as well today. I changed the density of stars and enabled two catalogs that were not enabled earlier. Will look into it. Thanks for the report.
Comment 2 Akarsh Simha 2012-02-05 10:58:43 UTC
Okay, I can reproduce this bug fairly frequently, but not every time.

It looks like trying to draw while the constellation lines are still being reloaded is the problem, but I don't know if that's true.
Comment 3 Akarsh Simha 2012-02-05 22:59:58 UTC
Git commit 51c5f967e5954ef36682361889f252b49a8f9af3 by Akarsh Simha.
Committed on 05/02/2012 at 23:39.
Pushed by asimha into branch 'master'.

Possible fix for bug #293183.

The crash was caused by the following sequence of events:

* To reload constellation names / lines, the
  SkyMapComposite::reloadConstellationLines etc methods would delete
  the m_CNames and m_CLines instances and create new instances.

* In the process, the ConstellationNames etc constructors would emit
  progress text by way of SkyMapComposite::emitProgressText().

* This would display a splash screen (for too short a while to be seen
  most of the time. Maybe possible on slow computers). The splash
  screen seemed to call for a redraw of the sky map behind it.

* The redrawing of the sky map would access the m_CNames / m_CLines
  pointers and thereby cause a crash in many cases.

This crash sequence was verified by making the following change in
reloadConstellationLines and reloadConstellationNames:

* After delete m_CNames / m_CLines, add a m_CNames = 0 and m_CLines =
  0

The crash was reproducible _every time_ after this change (since the
pointers were now NULL and not pointing to an older block of memory)
and the backtrace after this change showed a call to a
ConstellationNames method with this = 0x0.

So this patch fixes the problem by making sure that we prevent the
drawing process while updating the constellation names / lines. The
code added (in the previous commit) also prevents recursive and
concurrent draws.

I'm not sure if this is the cleanest and the best solution. I'm
copying the mailing list to invite comments on this.

Will backport to 4.8

CCMAIL: kstars-devel@kde.org

M  +8    -0    kstars/skycomponents/skymapcomposite.cpp

http://commits.kde.org/kstars/51c5f967e5954ef36682361889f252b49a8f9af3