Bug 328236 - crash when changing owner in start new game dialogue
Summary: crash when changing owner in start new game dialogue
Status: RESOLVED FIXED
Alias: None
Product: konquest
Classification: Applications
Component: general (show other bugs)
Version: 2.1
Platform: Ubuntu Linux
: NOR crash
Target Milestone: ---
Assignee: Pierre Ducroquet
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-11-30 01:44 UTC by Alexander Schuch
Modified: 2013-12-07 19:17 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 4.11.5


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Schuch 2013-11-30 01:44:36 UTC
SEGV when changing owner in start new game dialogue, see reproduction steps. This happens in master as well.

Reproducible: Always

Steps to Reproduce:
1. Open "Start New Game" dialogue.
2. Set a board size larger than minimum, for example default 10x10.
3. Create new board via "Randomise" until a planet is beyond 4x4 minimum board, for example until a planet is at the very bottom row.
4. Select that planet.
5. Shrink board so that this position leaves the new board boundaries, for example decrement "height" to 9.
6. Change owner of planet.
Actual Results:  
Application: Konquest (konquest), signal: Segmentation fault
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[Current thread is 1 (Thread 0x7f67f95587c0 (LWP 4535))]

Thread 2 (Thread 0x7f67e704e700 (LWP 4536)):
#0  0x00007f67f693dfbd in poll () at ../sysdeps/unix/syscall-template.S:81
#1  0x00007f67f3b0b1dc in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007f67f3b0b304 in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007f67f73c8036 in QEventDispatcherGlib::processEvents (this=0x7f67e00008c0, flags=...) at kernel/qeventdispatcher_glib.cpp:426
#4  0x00007f67f739838f in QEventLoop::processEvents (this=this@entry=0x7f67e704dd90, flags=...) at kernel/qeventloop.cpp:149
#5  0x00007f67f7398618 in QEventLoop::exec (this=this@entry=0x7f67e704dd90, flags=...) at kernel/qeventloop.cpp:204
#6  0x00007f67f729a410 in QThread::exec (this=this@entry=0x19ae400) at thread/qthread.cpp:542
#7  0x00007f67f7379edf in QInotifyFileSystemWatcherEngine::run (this=0x19ae400) at io/qfilesystemwatcher_inotify.cpp:256
#8  0x00007f67f729cbec in QThreadPrivate::start (arg=0x19ae400) at thread/qthread_unix.cpp:338
#9  0x00007f67f3fddf8e in start_thread (arg=0x7f67e704e700) at pthread_create.c:311
#10 0x00007f67f694aa0d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:113

Thread 1 (Thread 0x7f67f95587c0 (LWP 4535)):
[KCrash Handler]
#6  t (this=<optimized out>) at /repository/git/anongit.kde.org/konquest/dialogs/newgamedlg.cc:681
#7  operator[] (i=<optimized out>, this=<optimized out>) at /usr/include/qt4/QtCore/qlist.h:478
#8  sector (coord=..., this=0x1e604b0) at /repository/git/anongit.kde.org/konquest/map/map.h:68
#9  NewGameDlg::slotNewOwner (this=0x1ed60b0, index=1) at /repository/git/anongit.kde.org/konquest/dialogs/newgamedlg.cc:525
#10 0x00007f67f73ae0ef in QMetaObject::activate (sender=sender@entry=0x1eebd20, m=m@entry=0x7f67f8a86bc0 <QComboBox::staticMetaObject>, local_signal_index=local_signal_index@entry=5, argv=argv@entry=0x7fff668271b0) at kernel/qobject.cpp:3539
#11 0x00007f67f83af261 in QComboBox::currentIndexChanged (this=this@entry=0x1eebd20, _t1=1) at .moc/release-shared/moc_qcombobox.cpp:316
#12 0x00007f67f83af2c7 in QComboBoxPrivate::_q_emitCurrentIndexChanged (this=this@entry=0x1ef1300, index=...) at widgets/qcombobox.cpp:1278
#13 0x00007f67f83af4d0 in QComboBoxPrivate::setCurrentIndex (this=this@entry=0x1ef1300, mi=...) at widgets/qcombobox.cpp:2049
#14 0x00007f67f83af6a4 in QComboBoxPrivate::_q_itemSelected (this=0x1ef1300, item=...) at widgets/qcombobox.cpp:1247
#15 0x00007f67f73ae0ef in QMetaObject::activate (sender=sender@entry=0x23a9880, m=m@entry=0x7f67f8aa5ca0 <QComboBoxPrivateContainer::staticMetaObject>, local_signal_index=local_signal_index@entry=0, argv=argv@entry=0x7fff66827420) at kernel/qobject.cpp:3539
#16 0x00007f67f8645c72 in QComboBoxPrivateContainer::itemSelected (this=this@entry=0x23a9880, _t1=...) at .moc/release-shared/moc_qcombobox_p.cpp:253
#17 0x00007f67f83ac2c7 in QComboBoxPrivateContainer::eventFilter (this=0x23a9880, o=0x2443730, e=0x7fff66827b70) at widgets/qcombobox.cpp:691
#18 0x00007f67f73997a6 in QCoreApplicationPrivate::sendThroughObjectEventFilters (this=this@entry=0x1455960, receiver=receiver@entry=0x2443730, event=event@entry=0x7fff66827b70) at kernel/qcoreapplication.cpp:1056
#19 0x00007f67f7fd98bc in QApplicationPrivate::notify_helper (this=this@entry=0x1455960, receiver=receiver@entry=0x2443730, e=e@entry=0x7fff66827b70) at kernel/qapplication.cpp:4563
#20 0x00007f67f7fdca33 in QApplication::notify (this=this@entry=0x7fff66829db0, receiver=receiver@entry=0x2443730, e=e@entry=0x7fff66827b70) at kernel/qapplication.cpp:4110
#21 0x00007f67f8f5c1a6 in KApplication::notify (this=0x7fff66829db0, receiver=0x2443730, event=0x7fff66827b70) at ../../kdeui/kernel/kapplication.cpp:311
#22 0x00007f67f739963e in QCoreApplication::notifyInternal (this=0x7fff66829db0, receiver=receiver@entry=0x2443730, event=event@entry=0x7fff66827b70) at kernel/qcoreapplication.cpp:946
#23 0x00007f67f7fdf933 in sendEvent (event=<optimized out>, receiver=<optimized out>) at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:231
#24 QApplicationPrivate::sendMouseEvent (receiver=0x2443730, event=event@entry=0x7fff66827b70, alienWidget=0x2443730, nativeWidget=nativeWidget@entry=0x23a9880, buttonDown=buttonDown@entry=0x7f67f8ab7308 <qt_button_down>, lastMouseReceiver=..., spontaneous=spontaneous@entry=true) at kernel/qapplication.cpp:3178
#25 0x00007f67f8054d1c in QETWidget::translateMouseEvent (this=this@entry=0x23a9880, event=event@entry=0x7fff668282f0) at kernel/qapplication_x11.cpp:4565
#26 0x00007f67f8053e81 in QApplication::x11ProcessEvent (this=0x7fff66829db0, event=event@entry=0x7fff668282f0) at kernel/qapplication_x11.cpp:3746
#27 0x00007f67f807f042 in x11EventSourceDispatch (s=0x145a300, callback=0x0, user_data=0x0) at kernel/qguieventdispatcher_glib.cpp:146
#28 0x00007f67f3b0af05 in g_main_context_dispatch () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#29 0x00007f67f3b0b248 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#30 0x00007f67f3b0b304 in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#31 0x00007f67f73c8016 in QEventDispatcherGlib::processEvents (this=0x142f3f0, flags=...) at kernel/qeventdispatcher_glib.cpp:424
#32 0x00007f67f807f13e in QGuiEventDispatcherGlib::processEvents (this=<optimized out>, flags=...) at kernel/qguieventdispatcher_glib.cpp:204
#33 0x00007f67f739838f in QEventLoop::processEvents (this=this@entry=0x7fff668286d0, flags=...) at kernel/qeventloop.cpp:149
#34 0x00007f67f7398618 in QEventLoop::exec (this=this@entry=0x7fff668286d0, flags=...) at kernel/qeventloop.cpp:204
#35 0x00007f67f8494338 in QDialog::exec (this=this@entry=0x1ed60b0) at dialogs/qdialog.cpp:554
#36 0x0000000000419860 in GameView::startNewGame (this=0x1e97730) at /repository/git/anongit.kde.org/konquest/gameview.cc:481
#37 0x00007f67f73ae0ef in QMetaObject::activate (sender=sender@entry=0x15dca10, m=m@entry=0x7f67f8a7b7a0 <QAction::staticMetaObject>, local_signal_index=local_signal_index@entry=1, argv=argv@entry=0x7fff66828890) at kernel/qobject.cpp:3539
#38 0x00007f67f7fd3152 in QAction::triggered (this=this@entry=0x15dca10, _t1=false) at .moc/release-shared/moc_qaction.cpp:277
#39 0x00007f67f7fd4580 in QAction::activate (this=0x15dca10, event=<optimized out>) at kernel/qaction.cpp:1257
#40 0x00007f67f8398b5f in QAbstractButtonPrivate::click (this=this@entry=0x19b9d60) at widgets/qabstractbutton.cpp:530
#41 0x00007f67f8398e0c in QAbstractButton::mouseReleaseEvent (this=0x19c1bf0, e=0x7fff66829140) at widgets/qabstractbutton.cpp:1123
#42 0x00007f67f84558ea in QToolButton::mouseReleaseEvent (this=<optimized out>, e=<optimized out>) at widgets/qtoolbutton.cpp:718
#43 0x00007f67f8026a89 in QWidget::event (this=0x19c1bf0, event=0x7fff66829140) at kernel/qwidget.cpp:8375
#44 0x00007f67f7fd98ec in QApplicationPrivate::notify_helper (this=this@entry=0x1455960, receiver=receiver@entry=0x19c1bf0, e=e@entry=0x7fff66829140) at kernel/qapplication.cpp:4567
#45 0x00007f67f7fdca33 in QApplication::notify (this=this@entry=0x7fff66829db0, receiver=receiver@entry=0x19c1bf0, e=e@entry=0x7fff66829140) at kernel/qapplication.cpp:4110
#46 0x00007f67f8f5c1a6 in KApplication::notify (this=0x7fff66829db0, receiver=0x19c1bf0, event=0x7fff66829140) at ../../kdeui/kernel/kapplication.cpp:311
#47 0x00007f67f739963e in QCoreApplication::notifyInternal (this=0x7fff66829db0, receiver=receiver@entry=0x19c1bf0, event=event@entry=0x7fff66829140) at kernel/qcoreapplication.cpp:946
#48 0x00007f67f7fdf933 in sendEvent (event=<optimized out>, receiver=<optimized out>) at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:231
#49 QApplicationPrivate::sendMouseEvent (receiver=receiver@entry=0x19c1bf0, event=event@entry=0x7fff66829140, alienWidget=alienWidget@entry=0x19c1bf0, nativeWidget=nativeWidget@entry=0x1ca3940, buttonDown=buttonDown@entry=0x7f67f8ab7308 <qt_button_down>, lastMouseReceiver=..., spontaneous=spontaneous@entry=true) at kernel/qapplication.cpp:3178
#50 0x00007f67f8054e54 in QETWidget::translateMouseEvent (this=this@entry=0x1ca3940, event=event@entry=0x7fff668298c0) at kernel/qapplication_x11.cpp:4631
#51 0x00007f67f8053e81 in QApplication::x11ProcessEvent (this=0x7fff66829db0, event=event@entry=0x7fff668298c0) at kernel/qapplication_x11.cpp:3746
#52 0x00007f67f807f042 in x11EventSourceDispatch (s=0x145a300, callback=0x0, user_data=0x0) at kernel/qguieventdispatcher_glib.cpp:146
#53 0x00007f67f3b0af05 in g_main_context_dispatch () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#54 0x00007f67f3b0b248 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#55 0x00007f67f3b0b304 in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#56 0x00007f67f73c8016 in QEventDispatcherGlib::processEvents (this=0x142f3f0, flags=...) at kernel/qeventdispatcher_glib.cpp:424
#57 0x00007f67f807f13e in QGuiEventDispatcherGlib::processEvents (this=<optimized out>, flags=...) at kernel/qguieventdispatcher_glib.cpp:204
#58 0x00007f67f739838f in QEventLoop::processEvents (this=this@entry=0x7fff66829c90, flags=...) at kernel/qeventloop.cpp:149
#59 0x00007f67f7398618 in QEventLoop::exec (this=this@entry=0x7fff66829c90, flags=...) at kernel/qeventloop.cpp:204
#60 0x00007f67f739dcf6 in QCoreApplication::exec () at kernel/qcoreapplication.cpp:1218
#61 0x00007f67f7fd7ffc in QApplication::exec () at kernel/qapplication.cpp:3828
#62 0x0000000000412737 in main (argc=1, argv=0x7fff66829ee8) at /repository/git/anongit.kde.org/konquest/Konquest.cc:59

Expected Results:  
Nothing, not even a crash.
Comment 1 michael 2013-12-01 03:51:44 UTC
Fix up for review at https://git.reviewboard.kde.org/r/114232
Comment 2 Alexander Schuch 2013-12-07 18:35:42 UTC
Git commit c937b221a2d0c49833c43dd46b9c64ad9d0644ba by Alexander Schuch.
Committed on 07/12/2013 at 18:21.
Pushed by aschuch into branch 'KDE/4.11'.

Disable planet owner combo box if required.

Changing the owner of a planet in new game dialogue currently crashes if
the selected planet moves off the map due to a resize. Steps to reproduce
are in the bug report. This patch makes owner combo box follow same rules
for enabling as production and kill percentage.

Patched by Michael Reeves.
This is implemented in Konquest 2.1.
FIXED-IN: 4.11
REVIEW: 114232

M  +2    -0    dialogs/newgamedlg.cc

http://commits.kde.org/konquest/c937b221a2d0c49833c43dd46b9c64ad9d0644ba
Comment 3 Alexander Schuch 2013-12-07 18:59:49 UTC
Git commit 285d5ea5a893a3b16a901be9a08bf4e49e0d7dfc by Alexander Schuch.
Committed on 07/12/2013 at 18:21.
Pushed by aschuch into branch 'KDE/4.12'.

Disable planet owner combo box if required.

Changing the owner of a planet in new game dialogue currently crashes if
the selected planet moves off the map due to a resize. Steps to reproduce
are in the bug report. This patch makes owner combo box follow same rules
for enabling as production and kill percentage.

Patched by Michael Reeves.
This is implemented in Konquest 2.1.
FIXED-IN: 4.11
REVIEW: 114232
(cherry picked from commit c937b221a2d0c49833c43dd46b9c64ad9d0644ba)

M  +2    -0    dialogs/newgamedlg.cc

http://commits.kde.org/konquest/285d5ea5a893a3b16a901be9a08bf4e49e0d7dfc
Comment 4 Alexander Schuch 2013-12-07 19:14:29 UTC
Git commit c53883f622744b737f388cc2d72a0f74bd1d8598 by Alexander Schuch.
Committed on 07/12/2013 at 18:21.
Pushed by aschuch into branch 'master'.

Disable planet owner combo box if required.

Changing the owner of a planet in new game dialogue currently crashes if
the selected planet moves off the map due to a resize. Steps to reproduce
are in the bug report. This patch makes owner combo box follow same rules
for enabling as production and kill percentage.

Patched by Michael Reeves.
This is implemented in Konquest 2.1.
FIXED-IN: 4.11
REVIEW: 114232
(cherry picked from commit c937b221a2d0c49833c43dd46b9c64ad9d0644ba)
(cherry picked from commit 285d5ea5a893a3b16a901be9a08bf4e49e0d7dfc)

M  +2    -0    dialogs/newgamedlg.cc

http://commits.kde.org/konquest/c53883f622744b737f388cc2d72a0f74bd1d8598