Bug 258182

Summary: Crash in Moon Phase Almanach
Product: [Applications] kstars Reporter: Diego Candido <kell.92.k>
Component: generalAssignee: Akarsh Simha <akarsh.simha>
Status: RESOLVED FIXED    
Severity: crash CC: alexey.skladnoy, jldorcab, kde, mfg, mutlaqja
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Unlisted Binaries   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: New crash information added by DrKonqi

Description Diego Candido 2010-11-28 15:26:50 UTC
Version:           unspecified (using KDE 4.5.1) 
OS:                Linux

When clicking on Calculator -> Solar System -> Moon Phase Almanac program crash

Reproducible: Always

Steps to Reproduce:
Click on Calculator -> Solar System -> Moon Phase Almanac program crash

Actual Results:  
Program crash and do the following report:

Application: KStars (kstars), signal: Segmentation fault
[Current thread is 1 (Thread 0x7f1815542780 (LWP 10113))]

Thread 2 (Thread 0x7f180d377710 (LWP 10119)):
#0  0x00000030032690ff in g_thread_self () from /lib/libglib-2.0.so.0
#1  0x0000003003242300 in g_main_context_acquire () from /lib/libglib-2.0.so.0
#2  0x0000003003243df5 in ?? () from /lib/libglib-2.0.so.0
#3  0x00000030032447b5 in g_main_loop_run () from /lib/libglib-2.0.so.0
#4  0x0000003005ea60f4 in ?? () from /usr/lib/libgio-2.0.so.0
#5  0x00000030032697e4 in ?? () from /lib/libglib-2.0.so.0
#6  0x00007f1810fdf971 in start_thread (arg=<value optimized out>) at pthread_create.c:304
#7  0x00007f1810ab894d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
#8  0x0000000000000000 in ?? ()

Thread 1 (Thread 0x7f1815542780 (LWP 10113)):
[KCrash Handler]
#6  0x00007f181261dd00 in QPixmap::isNull() const () from /usr/lib/libQtGui.so.4
#7  0x00007f181269c86f in QPainter::drawPixmap(QPointF const&, QPixmap const&) () from /usr/lib/libQtGui.so.4
#8  0x0000000000447458 in drawPixmap (this=<value optimized out>, painter=0x7fffcb4961a0, row=<value optimized out>, col=<value optimized out>, colorScheme=<value optimized out>) at /usr/include/qt4/QtGui/qpainter.h:852
#9  MoonPhaseCalendar::paintCell (this=<value optimized out>, painter=0x7fffcb4961a0, row=<value optimized out>, col=<value optimized out>, colorScheme=<value optimized out>) at /home/joxer/kk/kdeedu/kstars/kstars/widgets/moonphasecalendarwidget.cpp:283
#10 0x000000000044779a in MoonPhaseCalendar::paintEvent (this=0x367d450, e=<value optimized out>) at /home/joxer/kk/kdeedu/kstars/kstars/widgets/moonphasecalendarwidget.cpp:116
#11 0x00007f181258cc2e in QWidget::event(QEvent*) () from /usr/lib/libQtGui.so.4
#12 0x00007f1812536fdc in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib/libQtGui.so.4
#13 0x00007f181253caed in QApplication::notify(QObject*, QEvent*) () from /usr/lib/libQtGui.so.4
#14 0x00007f18134e4156 in KApplication::notify(QObject*, QEvent*) () from /usr/lib/libkdeui.so.5
#15 0x00007f181135dcdc in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /usr/lib/libQtCore.so.4
#16 0x00007f181259367d in QWidgetPrivate::drawWidget(QPaintDevice*, QRegion const&, QPoint const&, int, QPainter*, QWidgetBackingStore*) () from /usr/lib/libQtGui.so.4
#17 0x00007f18127673a6 in ?? () from /usr/lib/libQtGui.so.4
#18 0x00007f1812586730 in QWidgetPrivate::syncBackingStore() () from /usr/lib/libQtGui.so.4
#19 0x00007f181258d2f5 in QWidget::event(QEvent*) () from /usr/lib/libQtGui.so.4
#20 0x00007f1812536fdc in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib/libQtGui.so.4
#21 0x00007f181253caed in QApplication::notify(QObject*, QEvent*) () from /usr/lib/libQtGui.so.4
#22 0x00007f18134e4156 in KApplication::notify(QObject*, QEvent*) () from /usr/lib/libkdeui.so.5
#23 0x00007f181135dcdc in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /usr/lib/libQtCore.so.4
#24 0x00007f1811360c22 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () from /usr/lib/libQtCore.so.4
#25 0x00007f181138a653 in ?? () from /usr/lib/libQtCore.so.4
#26 0x0000003003240342 in g_main_context_dispatch () from /lib/libglib-2.0.so.0
#27 0x00000030032442a8 in ?? () from /lib/libglib-2.0.so.0
#28 0x000000300324445c in g_main_context_iteration () from /lib/libglib-2.0.so.0
#29 0x00007f181138a193 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#30 0x00007f18125e9a4e in ?? () from /usr/lib/libQtGui.so.4
#31 0x00007f181135ca02 in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#32 0x00007f181135cdec in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#33 0x00007f1811360ebb in QCoreApplication::exec() () from /usr/lib/libQtCore.so.4
#34 0x000000000058fda2 in main (argc=<value optimized out>, argv=<value optimized out>) at /home/joxer/kk/kdeedu/kstars/kstars/main.cpp:191


Expected Results:  
Should show moon phase almanac
Comment 1 Alexey Khudiakov 2011-02-24 18:27:01 UTC
Could not reproduce on latest trunk. Didn't try to bisect yet.
Comment 2 Alexey Khudiakov 2011-06-12 17:46:52 UTC
*** Bug 274405 has been marked as a duplicate of this bug. ***
Comment 3 jldorcab 2011-07-03 17:43:23 UTC
Created attachment 61583 [details]
New crash information added by DrKonqi

kstars (2.0.0) on KDE Platform 4.6.00 (4.6.0) "release 6" using Qt 4.7.1

- What I was doing when the application crashed:

I did select 
Tools/Calculator/Solar System/Moon Phase Almanac. The application Crashed.

-- Backtrace (Reduced):
#6  operator! (this=0x0) at ../../src/corelib/tools/qshareddata.h:198
#7  QPixmap::isNull (this=0x0) at image/qpixmap.cpp:545
#8  0x00007fb668fb08ff in QPainter::drawPixmap (this=<value optimized out>, p=..., pm=...) at painting/qpainter.cpp:5255
#9  0x000000000043bf5f in _start ()
Comment 4 Akarsh Simha 2011-10-15 06:38:03 UTC
If I remember, we fixed this in trunk at some point. May need to backport.
Comment 5 Alexey Khudiakov 2011-11-17 13:27:12 UTC
*** Bug 281073 has been marked as a duplicate of this bug. ***
Comment 6 Alexey Khudiakov 2011-11-17 17:10:18 UTC
Confirmed in the HEAD
Comment 7 Alexey Khudiakov 2011-11-24 14:20:13 UTC
Git commit fbd7acc57108d733d402cb8624a5d1e25bafc477 by Khudyakov Alexey.
Committed on 17/11/2011 at 18:46.
Pushed by khudyakov into branch 'master'.

Fix crash in moon phase almanach

1. Read Moon images from texture manager
2. Store array of pixmaps instead of array of pointers to pixmap
   and avoid manual memory management entirely.

CCBUG: 258182

M  +15   -23   kstars/widgets/moonphasecalendarwidget.cpp
M  +1    -1    kstars/widgets/moonphasecalendarwidget.h

http://commits.kde.org/kstars/fbd7acc57108d733d402cb8624a5d1e25bafc477
Comment 8 Alexey Khudiakov 2011-11-25 11:40:11 UTC
Git commit 32d656d205a5ba917efb4199dc337623447f5f5b by Khudyakov Alexey.
Committed on 17/11/2011 at 18:46.
Pushed by khudyakov into branch 'KDE/4.7'.

Backport fix for 258182 to 4.7

Fix crash in moon phase almanach

1. Read Moon images from texture manager
2. Store array of pixmaps instead of array of pointers to pixmap
   and avoid manual memory management entirely.

CCBUG: 258182

M  +15   -23   kstars/widgets/moonphasecalendarwidget.cpp
M  +1    -1    kstars/widgets/moonphasecalendarwidget.h

http://commits.kde.org/kstars/32d656d205a5ba917efb4199dc337623447f5f5b