Bug 449639 - Segmentation fault while playing against the computer
Summary: Segmentation fault while playing against the computer
Status: RESOLVED FIXED
Alias: None
Product: knights
Classification: Applications
Component: general (show other bugs)
Version: 2.6.21122
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: Alexander Semke
URL:
Keywords:
: 468227 (view as bug list)
Depends on:
Blocks:
 
Reported: 2022-02-05 07:44 UTC by Adam Jimerson
Modified: 2024-11-01 13:39 UTC (History)
3 users (show)

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


Attachments
Backtrace from segfault. (2.38 KB, text/plain)
2022-02-05 07:44 UTC, Adam Jimerson
Details
Game log (204 bytes, text/x-log)
2022-02-05 07:45 UTC, Adam Jimerson
Details
dbg log (106.29 KB, text/x-log)
2022-05-27 22:25 UTC, Arisa Snowbell
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Adam Jimerson 2022-02-05 07:44:48 UTC
Created attachment 146295 [details]
Backtrace from segfault.

SUMMARY
While playing a game against the computer using the gnuchess game engine and the xboard protocal Knights crashed with a segmentation fault.


STEPS TO REPRODUCE
1.  Start a new game with 1 human player and one computer playing (gnuchess & xboard)
2.  Play the game for a little while
3.  Game will crash while "Computer is thinking"

OBSERVED RESULT
The game hung at "computer is thinking" for several minutes before eventually crashing.


EXPECTED RESULT
Game shouldn't crash


SOFTWARE/OS VERSIONS
Operating System: Arch Linux
KDE Plasma Version: 5.23.5
KDE Frameworks Version: 5.90.0
Qt Version: 5.15.2
Kernel Version: 5.16.5-arch1-1 (64-bit)
Graphics Platform: X11
Processors: 8 × Intel® Core™ i7-6820HQ CPU @ 2.70GHz
Memory: 31.2 GiB of RAM
Graphics Processor: Quadro M1000M/PCIe/SSE2

ADDITIONAL INFORMATION
Comment 1 Adam Jimerson 2022-02-05 07:45:36 UTC
Created attachment 146296 [details]
Game log

Attaching the game log file as well just encase it is helpful.
Comment 2 Arisa Snowbell 2022-05-27 22:25:40 UTC
Created attachment 149274 [details]
dbg log

Every time I let Stockfish fight against itself it crashes, I used dbg with debuginfod to get all the info into log file so I am uploading it here. The log has a lot of useless info but when you look there is also all the info to fix the bug.
Comment 3 Ben Bonacci 2023-04-11 11:56:22 UTC
*** Bug 468227 has been marked as a duplicate of this bug. ***
Comment 4 Bug Janitor Service 2024-02-16 20:45:09 UTC
A possibly relevant merge request was started @ https://invent.kde.org/games/knights/-/merge_requests/22
Comment 5 Albert Astals Cid 2024-02-18 23:32:45 UTC
Git commit 3572b3f4e79b57b5a56248100cc8652c219bac06 by Albert Astals Cid, on behalf of Dawid Trendota.
Committed on 18/02/2024 at 23:32.
Pushed by aacid into branch 'master'.

Fix crash while playing against CPU

Crash was caused by dereference of invalidates QList iterator. Fixed by
using removeIf instead of remove values in iterator based
loop.

Closes #449639

M  +4    -3    src/rules/chessrules.cpp

https://invent.kde.org/games/knights/-/commit/3572b3f4e79b57b5a56248100cc8652c219bac06
Comment 6 Albert Astals Cid 2024-02-18 23:35:14 UTC
Git commit 68447942a52c8cc8a732a1cc71c5bf7f0cb85d5d by Albert Astals Cid, on behalf of Dawid Trendota.
Committed on 18/02/2024 at 23:35.
Pushed by aacid into branch 'release/24.02'.

Fix crash while playing against CPU

Crash was caused by dereference of invalidates QList iterator. Fixed by
using removeIf instead of remove values in iterator based
loop.

Closes #449639

(cherry picked from commit 3572b3f4e79b57b5a56248100cc8652c219bac06)

M  +4    -3    src/rules/chessrules.cpp

https://invent.kde.org/games/knights/-/commit/68447942a52c8cc8a732a1cc71c5bf7f0cb85d5d