Fixed segfault in manager program
authorSam Moore <matches@ucc.asn.au>
Thu, 8 Dec 2011 06:22:34 +0000 (14:22 +0800)
committerSam Moore <matches@ucc.asn.au>
Thu, 8 Dec 2011 06:22:34 +0000 (14:22 +0800)
commit7f7bc05439b70b3139086086608996de3c9ae2ed
tree25c7a6b3679b54fdbaebeb97abc93e575202e044
parent17a20de4017ccfadef219d830a28ecccfe6f5106
Fixed segfault in manager program

Caused by the Program base class attempting to write EOF to programs
which had already exited. This caused a SIGPIPE signal.

The SIGPIPE handler function Game::HandleBrokenPipe then attempted to log the
event by calling Game::theGame->logMessage

However, since the program was exiting, DestroyGame had been called
and Game::theGame was in the process of being deleted.

Fixed by removing the fputc(output, EOF) line in Program::~Program.

It is ironic that this only became an issue since I modified the sample
AI to actually obey the protocol and exit as soon as "QUIT" is recieved...
12 files changed:
manager/controller.cpp
manager/game.cpp
manager/main.cpp
manager/program.cpp
samples/dummy/Makefile [deleted file]
samples/dummy/dummy.cpp [deleted file]
samples/dummy/info [deleted file]
samples/forfax/Makefile [deleted file]
samples/forfax/forfax.cpp [deleted file]
samples/forfax/forfax.h [deleted file]
samples/forfax/info [deleted file]
samples/forfax/main.cpp [deleted file]

UCC git Repository :: git.ucc.asn.au