Bug 446409 - Knights crashes everytime gnuchess vs Stockfish
Summary: Knights crashes everytime gnuchess vs Stockfish
Status: RESOLVED FIXED
Alias: None
Product: knights
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: openSUSE Linux
: NOR crash
Target Milestone: ---
Assignee: Alexander Semke
URL:
Keywords: drkonqi
Depends on:
Blocks:
 
Reported: 2021-12-03 09:19 UTC by 2ndemosthenes
Modified: 2021-12-05 10:36 UTC (History)
3 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description 2ndemosthenes 2021-12-03 09:19:19 UTC
Application: knights (2.6.21083)

Qt Version: 5.15.2
Frameworks Version: 5.88.0
Operating System: Linux 5.15.3-1-default x86_64
Windowing System: X11
Distribution: "openSUSE Tumbleweed"
DrKonqi: 5.23.3 [KCrashBackend]

-- Information about the crash:
- What I was doing when the application crashed:
I set the app to play a GNUChess vs Stockfish game and it crashes everytime, it doesn't happen when playing vs either of them(Human vs engine)

The crash can be reproduced every time.

-- Backtrace:
Application: Knights (knights), signal: Floating point exception

[KCrash Handler]
#4  0x0000557295ff0113 in Knights::UciProtocol::requestNextMove (this=0x557298675050) at /usr/src/debug/knights-21.08.3-1.1.x86_64/src/proto/uciprotocol.cpp:145
#5  0x00005572960141f3 in Knights::Manager::startGame (this=0x557296038520 <(anonymous namespace)::Q_QGS_instance::innerFunction()::holder>) at /usr/src/debug/knights-21.08.3-1.1.x86_64/src/gamemanager.cpp:438
#6  Knights::MainWindow::protocolInitSuccesful (this=0x557297b5b2a0) at /usr/src/debug/knights-21.08.3-1.1.x86_64/src/knights.cpp:427
#7  0x00007fd9b7db4043 in ?? () from /lib64/libQt5Core.so.5
#8  0x00007fd9b7da9fee in QObject::event(QEvent*) () from /lib64/libQt5Core.so.5
#9  0x00007fd9b892ca7f in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /lib64/libQt5Widgets.so.5
#10 0x00007fd9b7d7d9fa in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /lib64/libQt5Core.so.5
#11 0x00007fd9b7d80a47 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () from /lib64/libQt5Core.so.5
#12 0x00007fd9b7dd5853 in ?? () from /lib64/libQt5Core.so.5
#13 0x00007fd9b52e3d4f in g_main_context_dispatch () from /lib64/libglib-2.0.so.0
#14 0x00007fd9b52e40d8 in ?? () from /lib64/libglib-2.0.so.0
#15 0x00007fd9b52e418f in g_main_context_iteration () from /lib64/libglib-2.0.so.0
#16 0x00007fd9b7dd4ed4 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib64/libQt5Core.so.5
#17 0x00007fd9b7d7c3fb in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib64/libQt5Core.so.5
#18 0x00007fd9b7d846e0 in QCoreApplication::exec() () from /lib64/libQt5Core.so.5
#19 0x0000557295fd942a in main (argc=<optimized out>, argv=<optimized out>) at /usr/src/debug/knights-21.08.3-1.1.x86_64/src/main.cpp:94
[Inferior 1 (process 14565) detached]

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

Possible duplicates by query: bug 369393, bug 336413, bug 324020.

Reported using DrKonqi
This report was filed against 'kde' because the product 'knights' could not be located in Bugzilla. Add it to drkonqi's mappings file!
Comment 1 Albert Astals Cid 2021-12-03 22:37:26 UTC
Works fine here https://i.imgur.com/G5lFJ06.gif

Are you setting different options ?
Comment 2 2ndemosthenes 2021-12-05 08:02:31 UTC
(In reply to Albert Astals Cid from comment #1)
> Works fine here https://i.imgur.com/G5lFJ06.gif
> 
> Are you setting different options ?

No, I didn't change anything.
I didn't notice it first but I tried again and it only happens when I enable "Use Time Control", when it's disabled, everything works fine
Comment 3 Alexander Semke 2021-12-05 09:57:17 UTC
(In reply to 2ndemosthenes from comment #2)
> (In reply to Albert Astals Cid from comment #1)
> > Works fine here https://i.imgur.com/G5lFJ06.gif
> > 
> > Are you setting different options ?
> 
> No, I didn't change anything.
> I didn't notice it first but I tried again and it only happens when I enable
> "Use Time Control", when it's disabled, everything works fine

It's a "division by zero" bug. I'll fix it quickly. Thanks for reporting it!
Comment 4 Alexander Semke 2021-12-05 10:36:05 UTC
Git commit 8ed2d95295db4d011eca6124f65571bb1db061a5 by Alexander Semke.
Committed on 05/12/2021 at 10:34.
Pushed by asemke into branch 'release/21.12'.

Avoid division by zero when calculation the number of moves to go in the
UCI protocol with time control activated.
FIXED-IN: 21.12.1

M  +5    -3    src/proto/uciprotocol.cpp

https://invent.kde.org/games/knights/commit/8ed2d95295db4d011eca6124f65571bb1db061a5