Bug 477925 - Kpat Spider crashes after dealing cards then holding down ctrl-z
Summary: Kpat Spider crashes after dealing cards then holding down ctrl-z
Status: RESOLVED FIXED
Alias: None
Product: kpat
Classification: Applications
Component: general (show other bugs)
Version: 24.01.80
Platform: Other Linux
: NOR crash
Target Milestone: ---
Assignee: Stephan Kulow
URL:
Keywords: qt6
Depends on:
Blocks:
 
Reported: 2023-12-02 17:29 UTC by Darin Miller
Modified: 2023-12-13 23:53 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Darin Miller 2023-12-02 17:29:32 UTC
SUMMARY
***
NOTE: If you are reporting a crash, please try to attach a backtrace with debug symbols.
See https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports
***


STEPS TO REPRODUCE
1. Launch a spider game in Kpat
2. Click the card deck a few times to distribute the next set of cards.
3. Hold Ctrl-z to undo the distributions and kpat will crash.

OBSERVED RESULT
kpat crashes

EXPECTED RESULT
Retore cards to state of the previous move.

SOFTWARE/OS VERSIONS
Operating System: KDE neon Unstable Edition
KDE Plasma Version: 5.90.0
KDE Frameworks Version: 5.246.0
Qt Version: 6.6.0
Kernel Version: 6.2.0-37-generic (64-bit)
Graphics Platform: X11
Processors: 16 × AMD Ryzen 7 5800X 8-Core Processor
Memory: 31.2 GiB of RAM
Graphics Processor: AMD Radeon RX 6750 XT
Manufacturer: Gigabyte Technology Co., Ltd.
Product Name: X570S AORUS ELITE AX
System Version: -CF

ADDITIONAL INFORMATION
Older versions (23.08.3) of kpat do not crash when holding ctrl-z.

gdb output:

ASSERT failure in QList<T>::insert: "index out of range", file /usr/include/x86_64-linux-gnu/qt6/QtCore/qlist.h, line 868

Thread 1 "kpat" received signal SIGABRT, Aborted.
__pthread_kill_implementation (no_tid=0, signo=6, threadid=140737237797568) at ./nptl/pthread_kill.c:44
Download failed: Invalid argument.  Continuing without source file ./nptl/./nptl/pthread_kill.c.
44      ./nptl/pthread_kill.c: No such file or directory.
(gdb) backtrace
#0  __pthread_kill_implementation (no_tid=0, signo=6, threadid=140737237797568) at ./nptl/pthread_kill.c:44
#1  __pthread_kill_internal (signo=6, threadid=140737237797568) at ./nptl/pthread_kill.c:78
#2  __GI___pthread_kill (threadid=140737237797568, signo=signo@entry=6) at ./nptl/pthread_kill.c:89
#3  0x00007ffff5842476 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
#4  0x00007ffff58287f3 in __GI_abort () at ./stdlib/abort.c:79
#5  0x00007ffff64d6fb7 in qAbort () at ./src/corelib/global/qglobal.cpp:161
#6  0x00007ffff64d2465 in qt_message_fatal<QString&> (message=..., context=...) at ./src/corelib/global/qlogging.cpp:2003
#7  qt_message(QtMsgType, const QMessageLogContext &, const char *, typedef __va_list_tag __va_list_tag *) (msgType=msgType@entry=QtFatalMsg, context=..., msg=<optimized out>, 
    ap=ap@entry=0x7fffffffcff0) at ./src/corelib/global/qlogging.cpp:378
#8  0x00007ffff64d79e3 in QMessageLogger::fatal (this=<optimized out>, msg=<optimized out>) at ./src/corelib/global/qlogging.cpp:901
#9  0x00007ffff64a5968 in qt_assert_x (where=where@entry=0x7ffff7c2a4c0 "QList<T>::insert", what=what@entry=0x7ffff7c2a40b "index out of range", 
    file=file@entry=0x7ffff7c299f0 "/usr/include/x86_64-linux-gnu/qt6/QtCore/qlist.h", line=line@entry=868) at ./src/corelib/global/qassert.cpp:77
#10 0x00007ffff7c01527 in QList<KCard*>::emplace<KCard*&> (this=<optimized out>, i=<optimized out>) at /usr/include/x86_64-linux-gnu/qt6/QtCore/qlist.h:868
#11 QList<KCard*>::emplace<KCard*&> (i=9, this=0x555555db29b8) at /usr/include/x86_64-linux-gnu/qt6/QtCore/qlist.h:866
#12 QList<KCard*>::insert (t=<optimized out>, i=9, this=0x555555db29b8) at /usr/include/x86_64-linux-gnu/qt6/QtCore/qlist.h:472
#13 KCardPile::insert (this=<optimized out>, index=9, card=0x555555ea14d0) at ./src/libkcardgame/kcardpile.cpp:384
#14 0x0000555555592247 in DealerScene::undoOrRedo (this=<optimized out>, undo=<optimized out>) at ./src/dealer.cpp:1083
#15 0x00007ffff6426b9e in QtPrivate::QSlotObjectBase::call (a=<optimized out>, r=<optimized out>, this=<optimized out>, this=<optimized out>, r=<optimized out>, a=<optimized out>)
    at ./src/corelib/kernel/qobjectdefs_impl.h:433
#16 doActivate<false> (sender=0x555555b074b0, signal_index=7, argv=0x7fffffffd360) at ./src/corelib/kernel/qobject.cpp:4021
#17 0x00007ffff6c3b406 in QAction::triggered (this=this@entry=0x555555b074b0, _t1=<optimized out>) at ./obj-x86_64-linux-gnu/src/gui/Gui_autogen/include/moc_qaction.cpp:642
#18 0x00007ffff6c3f164 in QAction::activate (this=0x555555b074b0, event=<optimized out>) at ./src/gui/kernel/qaction.cpp:1102
#19 0x00007ffff6c3f2a8 in QAction::event (e=0x7fffffffd5a0, this=0x555555b074b0) at ./src/gui/kernel/qaction.cpp:1044
#20 QAction::event (this=0x555555b074b0, e=0x7fffffffd5a0) at ./src/gui/kernel/qaction.cpp:1027
#21 0x00007ffff75f079b in QApplicationPrivate::notify_helper (this=<optimized out>, receiver=0x555555b074b0, e=0x7fffffffd5a0) at ./src/widgets/kernel/qapplication.cpp:3290
#22 0x00007ffff645e828 in QCoreApplication::notifyInternal2 (receiver=0x555555b074b0, event=event@entry=0x7fffffffd5a0) at ./src/corelib/kernel/qcoreapplication.cpp:1118
#23 0x00007ffff645e86d in QCoreApplication::sendEvent (receiver=<optimized out>, event=event@entry=0x7fffffffd5a0) at ./src/corelib/kernel/qcoreapplication.cpp:1536
#24 0x00007ffff6c4d3b3 in QShortcutMap::dispatchEvent (this=<optimized out>, e=0x7fffffffd690) at ./src/gui/kernel/qshortcutmap.cpp:636
#25 0x00007ffff6c4dacb in QShortcutMap::tryShortcut (this=0x555555731158, e=0x7fffffffd690) at ./src/gui/kernel/qshortcutmap.cpp:310
#26 0x00007ffff694dc0e in QWindowSystemInterface::handleShortcutEvent (window=<optimized out>, timestamp=<optimized out>, keyCode=90, modifiers=..., nativeScanCode=52, 
    nativeVirtualKey=122, nativeModifiers=20, text=..., autorepeat=false, count=1) at ./src/gui/kernel/qwindowsysteminterface.cpp:449
#27 0x00007ffff68ef60a in QGuiApplicationPrivate::processKeyEvent (e=0x555555c23570) at ./src/gui/kernel/qguiapplication.cpp:2422
#28 0x00007ffff69549ac in QWindowSystemInterface::sendWindowSystemEvents (flags=flags@entry=...) at ./src/gui/kernel/qwindowsysteminterface.cpp:1109
#29 0x00007ffff0dc6a1e in xcbSourceDispatch (source=<optimized out>) at ./src/plugins/platforms/xcb/qxcbeventdispatcher.cpp:57
#30 0x00007ffff454ad3b in g_main_context_dispatch () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#31 0x00007ffff45a0258 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#32 0x00007ffff45483e3 in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#33 0x00007ffff625de60 in QEventDispatcherGlib::processEvents (this=0x5555557ce6f0, flags=...) at ./src/corelib/kernel/qeventdispatcher_glib.cpp:393
#34 0x00007ffff6460a5b in QEventLoop::exec (this=this@entry=0x7fffffffda30, flags=..., flags@entry=...) at ./src/corelib/global/qflags.h:34
#35 0x00007ffff646268c in QCoreApplication::exec () at ./src/corelib/global/qflags.h:74
#36 0x00007ffff68e9940 in QGuiApplication::exec () at ./src/gui/kernel/qguiapplication.cpp:1921
#37 0x00007ffff75e8c89 in QApplication::exec () at ./src/widgets/kernel/qapplication.cpp:2569
#38 0x00005555555854dd in main (argc=<optimized out>, argv=<optimized out>) at ./src/main.cpp:344
Comment 1 Bug Janitor Service 2023-12-03 01:54:33 UTC
A possibly relevant merge request was started @ https://invent.kde.org/games/kpat/-/merge_requests/59
Comment 2 Darin Miller 2023-12-03 07:09:11 UTC
I can confirm patch https://invent.kde.org/games/kpat/-/merge_requests/59 fixes crl-z (undo) issue.  Thanks for the fast fix!
Comment 3 Albert Astals Cid 2023-12-13 23:53:26 UTC
Git commit ad71e6a8e644d1061c31a72b1f5375344d37a20a by Albert Astals Cid.
Committed on 14/12/2023 at 00:52.
Pushed by aacid into branch 'master'.

Fix crash when undoing

M  +12   -1    src/dealer.cpp

https://invent.kde.org/games/kpat/-/commit/ad71e6a8e644d1061c31a72b1f5375344d37a20a