#1144761 3dchess: Playing against computer causes segfault.

Package:
3dchess
Source:
3dchess
Description:
Play chess across 3 boards!
Submitter:
Dirk Mittler
Date:
2026-08-20 02:11:01 UTC
Severity:
normal
#1144761#5
Date:
2026-08-18 21:43:58 UTC
From:
To:
Dear Maintainer,

   * What led up to the situation?

Command-line '3Dc -play black'

   * What exactly did you do (or not do) that was effective (or
     ineffective)?

I made my second move against computer opponent.

   * What was the outcome of this action?

All windows vanish and a nonspecific "Segmentation Fault" message dumped in terminal.

   * What outcome did you expect instead?

The computer's AI is supposed to compute its second move.

#1144761#10
Date:
2026-08-18 21:57:52 UTC
From:
To:
Dear Maintainer,

I think that two additional pieces of information might be helpful in
trying to cut to the root of the real bug.

This is a separate bug to the minor bug, that after the program
launches, the 3 boards must be repositioned no longer to overlap. If one
fails to do that, any move causes a crash. But this is so minor it's not
even worth investigating.

The program works fine when only used as a board, and when not playing
against the AI. When just used as a board, it distinguishes legal moves
from illegal ones and only permits legal moves. I can do that for as
many moves as I like - no crash.

#1144761#15
Date:
2026-08-20 02:03:22 UTC
From:
To:
Dear Maintainer,

I have found the more precise location of this error.

The way the game works, there is more than one variant of fool's mate
that succeeds in 2 moves. When the game starts, the AI automatically
aims for this fool's mate, and, if the Human player is unaware, puts him
into fool's mate.

The real bug is that the AI would like to display a message to state,
'Check Mate'. Trying to print this message is what kills the program.

I found this out by trying to put the AI into fool's mate. The AI steps
out of the way, and succeeds at playing its second move without causing
a crash.

So, one might ponder that ~the only real problem be~ that the Human
player never gets to see how he was mated, because instead of showing
him how, the boards vanish.

But, the solution isn't quite so simple. If the Human steps out of the
way of fool's mate, then in an equal way, the AI will simply try to put
him into 'Check', which needs to be announced. And then, the game
crashes because the message could not be printed that the player was put
into check. So the game is really, still not playable against the AI.

If a Linux user cannot play against the machine, it's very unlikely that
they will find another Linux user who's willing to play this game in a
hot-seat scenario.

One fact which I find revealing, though, is that if I put the AI into
'Check Mate', the game displays "Player Wins" correctly, and reveals
where it's supposed to print its announcements to the player (without
crashing in the course of a completed game). Doing so takes place in the
(smaller) main window, that also displays the piece count. Hence,
printing a message for the player to see should not require opening a
new window.


Dirk Mittler