Spring Engine version: 96.0
AI Interface Java: from Spring 94.1
infolog.txt fragment:
Code: Select all
[f=0006563] [*nickname*] but whats tithe the ai
[f=0006632] [*nickname*] or bot
[f=0006632] Error: Segmentation fault (SIGSEGV) in spring 96.0
[f=0006632] Error: Stacktrace for Spring 96.0:
[f=0006632] Error: <0> ??:?
[f=0006632] Error: <1> ??:?
[f=0006632] Error: <2> /lib/x86_64-linux-gnu/libpthread.so.0(+0x10340) [0x7fc16b7e8340]
[f=0006632] Error: <3> ??:?
[f=0006632] Error: <4> [0x7fc11c2be790]
[f=0006632] Error: [ErrorMessageBox][1] msg="Spring has crashed:
Segmentation fault (SIGSEGV).
My Java code:
Code: Select all
@Override
public int message(int player, String message) {
try {
cpuTimer.start();
...
some test with message with string function.
...
// crash call maybe this:
if (clb.getGame().getTeamAllyTeam(clb.getGame().getPlayerTeam(player))!=clb.getGame().getTeamAllyTeam(owner.teamId)
&& !allowEnemyTeamCommand )
{
...
}
...
sendTextMsg("(test) Player " + player +" from team " +owner.clb.getGame().getPlayerTeam(player) + " say: '" + message+"'." , FieldBOT.MSG_DBG_ALL);
cpuTimer.stop();
} catch (Exception e) {
sendTextMsg("ERROR message, exception: "+e.toString(), MSG_ERR);
StringWriter sw = new StringWriter();
PrintWriter pw = new PrintWriter(sw);
e.printStackTrace(pw); // print stack
sendTextMsg("STACK TRACE> "+sw.toString(), MSG_ERR);
cpuTimer.stop();
return -1; // signaling: error
}
return 0; // signaling: OK
}
I think the reason for bug is not exist range check in getGame().getTeamAllyTeam(-1), where player is spectator and clb.getGame().getPlayerTeam(player) return -1.
I do not want all Spring crash. I want throw AI Exception.