Bug 456934

Summary: Kpat crashes while switching games
Product: [Applications] kpat Reporter: Brian Kaye <bdk>
Component: generalAssignee: Stephan Kulow <coolo>
Status: RESOLVED FIXED    
Severity: crash CC: bdk, kde-games-bugs-null
Priority: NOR Keywords: drkonqi
Version First Reported In: 22.04.1   
Target Milestone: ---   
Platform: Fedora RPMs   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: New crash information added by DrKonqi

Description Brian Kaye 2022-07-20 02:56:02 UTC
Application: kpat (22.04.1)

Qt Version: 5.15.3
Frameworks Version: 5.96.0
Operating System: Linux 5.18.11-200.fc36.x86_64 x86_64
Windowing System: X11
Distribution: "Fedora release 36 (Thirty Six)"
DrKonqi: 5.25.3 [KCrashBackend]

-- Information about the crash:
Switching games after golf game success causes crash. Does not occur every time.

The crash can be reproduced sometimes.

-- Backtrace:
Application: KPatience (kpat), signal: Segmentation fault

[KCrash Handler]
#4  MemoryManager::new_from_block (s=48, this=0x55cf9cffac30) at /usr/src/debug/kpat-22.04.1-1.fc36.x86_64/src/patsolve/memory.cpp:157
#5  Solver<9ul>::pack_position (this=0x55cf9e67b190) at /usr/src/debug/kpat-22.04.1-1.fc36.x86_64/src/patsolve/patsolve.cpp:217
#6  Solver<9ul>::insert (node=0x7ffdfa218ee0, d=0, cluster=<synthetic pointer>, this=0x55cf9e67b190) at /usr/src/debug/kpat-22.04.1-1.fc36.x86_64/src/patsolve/patsolve.cpp:887
#7  Solver<9ul>::new_position (this=this@entry=0x55cf9e67b190, parent=parent@entry=0x0, m=m@entry=0x7ffdfa218f30) at /usr/src/debug/kpat-22.04.1-1.fc36.x86_64/src/patsolve/patsolve.cpp:919
#8  0x000055cf9bea7c2e in Solver<9ul>::doit (this=0x55cf9e67b190) at /usr/src/debug/kpat-22.04.1-1.fc36.x86_64/src/patsolve/patsolve.cpp:505
#9  Solver<9ul>::patsolve (this=0x55cf9e67b190, _max_positions=<optimized out>) at /usr/src/debug/kpat-22.04.1-1.fc36.x86_64/src/patsolve/patsolve.cpp:800
#10 0x000055cf9be81c33 in DealerScene::isGameLost (this=0x55cf9d1cc200) at /usr/src/debug/kpat-22.04.1-1.fc36.x86_64/src/dealer.cpp:1844
#11 DealerScene::isGameLost (this=0x55cf9d1cc200) at /usr/src/debug/kpat-22.04.1-1.fc36.x86_64/src/dealer.cpp:1727
#12 0x000055cf9be874ba in DealerScene::takeState (this=this@entry=0x55cf9d1cc200) at /usr/src/debug/kpat-22.04.1-1.fc36.x86_64/src/dealer.cpp:1331
#13 0x000055cf9be89739 in DealerScene::animationDone (this=0x55cf9d1cc200) at /usr/src/debug/kpat-22.04.1-1.fc36.x86_64/src/dealer.cpp:1546
#14 0x00007f8ca8cdac36 in void doActivate<false>(QObject*, int, void**) () from /lib64/libQt5Core.so.5
#15 0x00007f8ca8cdac36 in void doActivate<false>(QObject*, int, void**) () from /lib64/libQt5Core.so.5
#16 0x00007f8ca8cdac36 in void doActivate<false>(QObject*, int, void**) () from /lib64/libQt5Core.so.5
#17 0x00007f8ca8cddfce in QTimer::timeout(QTimer::QPrivateSignal) () from /lib64/libQt5Core.so.5
#18 0x00007f8ca8cd1525 in QObject::event(QEvent*) () from /lib64/libQt5Core.so.5
#19 0x00007f8ca99aec82 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /lib64/libQt5Widgets.so.5
#20 0x00007f8ca8ca7658 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /lib64/libQt5Core.so.5
#21 0x00007f8ca8cf7681 in QTimerInfoList::activateTimers() () from /lib64/libQt5Core.so.5
#22 0x00007f8ca8cf7fa4 in idleTimerSourceDispatch(_GSource*, int (*)(void*), void*) () from /lib64/libQt5Core.so.5
#23 0x00007f8ca6926faf in g_main_context_dispatch () from /lib64/libglib-2.0.so.0
#24 0x00007f8ca697c2c8 in g_main_context_iterate.constprop () from /lib64/libglib-2.0.so.0
#25 0x00007f8ca6924940 in g_main_context_iteration () from /lib64/libglib-2.0.so.0
#26 0x00007f8ca8cf82fa in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib64/libQt5Core.so.5
#27 0x00007f8ca8ca60ba in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib64/libQt5Core.so.5
#28 0x00007f8ca8cae162 in QCoreApplication::exec() () from /lib64/libQt5Core.so.5
#29 0x000055cf9be77596 in main (argc=<optimized out>, argv=<optimized out>) at /usr/src/debug/kpat-22.04.1-1.fc36.x86_64/src/main.cpp:353
[Inferior 1 (process 373529) detached]

The reporter indicates this bug may be a duplicate of or related to bug 397817.

Reported using DrKonqi
Comment 1 Stephan Kulow 2023-02-28 19:17:01 UTC
This is the old solver running that was massakred and is no longer tested due to most using blackhole solver. I'll remove it
Comment 2 Brian Kaye 2023-02-28 19:26:49 UTC
(In reply to Stephan Kulow from comment #1)
> This is the old solver running that was massakred and is no longer tested
> due to most using blackhole solver. I'll remove it

How does one determine which solver is being used. The problem persists. The problem only occurs when switching between golf and klonike. I switch  Freecell>Golf>Kondike>Grandfather'sClock>.....>Spider. Then reverse.The problem does not occur in the reverse direction
Comment 3 Stephan Kulow 2023-02-28 19:37:09 UTC
Check ldd on your kpat binary - if it links blackhole, then you're using that. If not, then you're using the old code. But the crash very much is in the old code.
Comment 4 Brian Kaye 2023-02-28 19:39:50 UTC
(In reply to Brian Kaye from comment #2)
> (In reply to Stephan Kulow from comment #1)
> > This is the old solver running that was massakred and is no longer tested
> > due to most using blackhole solver. I'll remove it
> 
> How does one determine which solver is being used. The problem persists. The
> problem only occurs when switching between golf and klonike. I switch 
> Freecell>Golf>Kondike>Grandfather'sClock>.....>Spider. Then reverse.The
> problem does not occur in the reverse direction

The version I am running is 22.12.2 from a Fedora RPM
Comment 5 Brian Kaye 2023-02-28 19:45:11 UTC
ldd /usr/bin/kpat|grep blackhole generates null output
Comment 6 Stephan Kulow 2023-02-28 19:50:28 UTC
Yep, as I expected. I remove the old code, so it won't crash on you anymore. You won't have a solver either, but that's a bug worthy to report to fedora.
Comment 7 Brian Kaye 2023-02-28 20:18:16 UTC
(In reply to Stephan Kulow from comment #6)
> Yep, as I expected. I remove the old code, so it won't crash on you anymore.
> You won't have a solver either, but that's a bug worthy to report to fedora.

I would prefer to have the solver there even if it crashes occasionally. What can I do to help?
Comment 8 Brian Kaye 2023-03-17 01:42:50 UTC
Created attachment 157343 [details]
New crash information added by DrKonqi

kpat (22.12.3) using Qt 5.15.8

Kpatience Version 22.12.3 fedora 37 . Successfully wond Golf game and waited 2 minutes. When I picked klondike it crashed.

-- Backtrace (Reduced):
#4  MemoryManager::new_from_block (s=48, this=0x56498917e670) at /usr/src/debug/kpat-22.12.3-1.fc37.x86_64/src/patsolve/memory.cpp:156
#5  Solver<9ul>::pack_position (this=0x56498add54b0) at /usr/src/debug/kpat-22.12.3-1.fc37.x86_64/src/patsolve/patsolve.cpp:217
#6  Solver<9ul>::insert (node=0x7ffe2949f940, d=0, cluster=<synthetic pointer>, this=0x56498add54b0) at /usr/src/debug/kpat-22.12.3-1.fc37.x86_64/src/patsolve/patsolve.cpp:887
#7  Solver<9ul>::new_position (this=this@entry=0x56498add54b0, parent=parent@entry=0x0, m=m@entry=0x7ffe2949f990) at /usr/src/debug/kpat-22.12.3-1.fc37.x86_64/src/patsolve/patsolve.cpp:919
#8  0x00005649872cfbbe in Solver<9ul>::doit (this=0x56498add54b0) at /usr/src/debug/kpat-22.12.3-1.fc37.x86_64/src/patsolve/patsolve.cpp:505
Comment 9 Stephan Kulow 2023-06-17 11:56:46 UTC
the crashing code is gone from newer kpat versions.