Bug - Fixed updateCurrentAction/nextRound loop

Theraze

Active member
Have gotten this on two characters today, when starting combat. The combat just gets stuck and gives a debug log... I cut the uCA/nR down to only a page or two, but it continues on for another 10-20 pages. When I left it, the log ended up being over 100mb, this time I quit before it displayed the combat page and it was only 19mb... anyways, error:
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
KoLmafia v14.5 r9204, Windows 7, Java 1.6.0_24
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Please note: do not post this log in the KoLmafia thread. If you
would like the dev team to look at it, please write a bug report
at kolmafia.us. Include specific information about what you were
doing when you made this and include the log as an attachment.
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Timestamp: Sat Apr 02 12:29:23 PDT 2011
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

Unexpected error, debug log printed.
Unexpected error, debug log printed.
class java.lang.StackOverflowError: null
java.lang.StackOverflowError
at java.io.FileOutputStream.writeBytes(Native Method)
at java.io.FileOutputStream.write(Unknown Source)
at java.io.BufferedOutputStream.flushBuffer(Unknown Source)
at java.io.BufferedOutputStream.flush(Unknown Source)
at java.io.PrintStream.write(Unknown Source)
at sun.nio.cs.StreamEncoder.writeBytes(Unknown Source)
at sun.nio.cs.StreamEncoder.implFlushBuffer(Unknown Source)
at sun.nio.cs.StreamEncoder.flushBuffer(Unknown Source)
at java.io.OutputStreamWriter.flushBuffer(Unknown Source)
at java.io.PrintStream.write(Unknown Source)
at java.io.PrintStream.print(Unknown Source)
at java.io.PrintStream.println(Unknown Source)
at net.sourceforge.kolmafia.StaticEntity.printStackTrace(StaticEntity.java:1040)
at net.sourceforge.kolmafia.StaticEntity.printStackTrace(StaticEntity.java:1020)
at net.sourceforge.kolmafia.textui.Interpreter.execute(Interpreter.java:206)
at net.sourceforge.kolmafia.combat.Macrofier.macrofy(Macrofier.java:137)
at net.sourceforge.kolmafia.request.FightRequest.nextRound(FightRequest.java:539)
at net.sourceforge.kolmafia.request.FightRequest.updateCurrentAction(FightRequest.java:833)
at net.sourceforge.kolmafia.request.FightRequest.nextRound(FightRequest.java:650)
at net.sourceforge.kolmafia.request.FightRequest.updateCurrentAction(FightRequest.java:833)
at net.sourceforge.kolmafia.request.FightRequest.nextRound(FightRequest.java:650)
at net.sourceforge.kolmafia.request.FightRequest.updateCurrentAction(FightRequest.java:833)
at net.sourceforge.kolmafia.request.FightRequest.nextRound(FightRequest.java:650)
at net.sourceforge.kolmafia.request.FightRequest.updateCurrentAction(FightRequest.java:833)
at net.sourceforge.kolmafia.request.FightRequest.nextRound(FightRequest.java:650)
at net.sourceforge.kolmafia.request.FightRequest.updateCurrentAction(FightRequest.java:833)
at net.sourceforge.kolmafia.request.FightRequest.nextRound(FightRequest.java:650)
at net.sourceforge.kolmafia.request.FightRequest.updateCurrentAction(FightRequest.java:833)
at net.sourceforge.kolmafia.request.FightRequest.nextRound(FightRequest.java:650)

Edit: Attached a debug log with a different action being stuck that I caught faster.
 

Attachments

Last edited:
Your CCS is doing "combo xxx" where "xxx" is not a valid disco or rave combo.
Can we see your CCS, please?
 
Was using the nemesis script which means that it was doing it as a combat filter, like this, I think...
Code:
 string macro = "pickpocket; "; // dummy action that KoL will execute before starting the combat
 matcher rave_steal = create_matcher( "(.+),(.+),(.+)", get_property( "raveCombo5" ) );
    rave_steal.find();
 for i from 1 to 3 macro += "skill " + rave_steal.group( i ).to_skill().to_int() +"; ";
 macro += "attack; repeat;";
 
 while ( my_adventures() > 0 )
 {
  if ( my_mp() < 10 && !restore_mp( 10 ) ) return vprint( "Out of MP, exiting... please configure Mafia's automatic MP restoring",-1 );
  adventure( 1 ,$location[ Outside the Club ], macro );
  if ( check_raveosity() ) return vprint( "Enough Raveosity items gathered.",6 );
  
 }
 
Your stack trace indicates that FightRequest got a "next action" which was literally "combo " followed by <something>, where <something> was not a valid Disco or Rave combo name.

Edit: OK, I looked at the Nemesis script. That generated macro stuff was a red herring; that's not what it was doing. I see the following function:

Code:
// combat filter, needs to be at the top level
string randrave( int rnd, string opp, string text )
{
	if ( combo_identified() ) return "combo Random Steal";
	return "combo Random Rave";
}

"Random Steal" should be "Rave Steal".

There is no way for a normal CCS to submit a bogus combo name; it takes a buggy script, like this one, to do it. I'll look into it not taking an infinite loop in that case - although, I am sure you or somebody will submit a bug report about why KoLmafia is not using a Rave Steal when your combat filter clearly says to do it (and you'll submit macro generating code which is not called to prove it), but I don't see what else I can do.
 
Last edited:
Apologies. I'd have posted it there if I'd known that were the issue. I'll note it in the nemesis script. Anyways to have it so that if an invalid combo is submitted, mafia cancels the request instead of giving a debug?
 
What does "get raveCombo5" return in the gCLI?

EDIT: woops, I waited too long.

EDIT2: thanks for noticing that Veracity.
 
Last edited:
Revision 9205 should abort with a bogus combo.

Code:
// combat filter, needs to be at the top level
string bogus( int rnd, string opp, string text )
{
	return "combo Random Steal";
}

adventure( 1 ,$location[ Giant's Castle ], "bogus" );

Now does this:

> combo-bug

Visit to Beanstalk: Giant's Castle in progress...

[12613] Giant's Castle
Encounter: Goth Giant
Strategy: attack with weapon
Round 0: Veracity wins initiative!
Invalid combo 'Random Steal' requested
You're on your own, partner.
Click here to continue in the relay browser.
 
Back
Top